Statistics
| Revision:

root / src / jpilot.h @ 3044

History | View | Annotate | Download (4.1 kB)

1 1 hiro
/*
2 1 hiro
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 1 hiro
 * Copyright (C) 2001 Match Grun
4 1 hiro
 *
5 1 hiro
 * This program is free software; you can redistribute it and/or modify
6 1 hiro
 * it under the terms of the GNU General Public License as published by
7 1 hiro
 * the Free Software Foundation; either version 2 of the License, or
8 1 hiro
 * (at your option) any later version.
9 1 hiro
 *
10 1 hiro
 * This program is distributed in the hope that it will be useful,
11 1 hiro
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 1 hiro
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 1 hiro
 * GNU General Public License for more details.
14 1 hiro
 *
15 1 hiro
 * You should have received a copy of the GNU General Public License
16 1 hiro
 * along with this program; if not, write to the Free Software
17 1 hiro
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 1 hiro
 */
19 1 hiro
20 1 hiro
/*
21 1 hiro
 * Definitions for accessing JPilot database files.
22 1 hiro
 * JPilot is Copyright(c) by Judd Montgomery.
23 1 hiro
 * Visit http://www.jpilot.org for more details.
24 1 hiro
 */
25 1 hiro
26 1 hiro
#ifndef __JPILOT_H__
27 1 hiro
#define __JPILOT_H__
28 1 hiro
29 1 hiro
#ifdef HAVE_CONFIG_H
30 1 hiro
#  include "config.h"
31 1 hiro
#endif
32 1 hiro
33 1 hiro
#ifdef USE_JPILOT
34 1 hiro
35 1 hiro
#include <glib.h>
36 1 hiro
#include <stdio.h>
37 1 hiro
38 1 hiro
#ifdef HAVE_LIBPISOCK_PI_ADDRESS_H
39 1 hiro
#  include <libpisock/pi-address.h>
40 1 hiro
#else
41 1 hiro
#  include <pi-address.h>
42 1 hiro
#endif
43 1 hiro
44 1 hiro
#include "addritem.h"
45 1 hiro
#include "addrcache.h"
46 1 hiro
47 1 hiro
typedef struct _JPilotFile JPilotFile;
48 1 hiro
49 1 hiro
struct _JPilotFile {
50 1 hiro
        gchar                 *name;
51 1 hiro
        FILE                  *file;
52 1 hiro
        gchar                 *path;
53 1 hiro
        AddressCache          *addressCache;
54 1 hiro
        struct AddressAppInfo addrInfo;
55 1 hiro
        gboolean              readMetadata;
56 1 hiro
        GList                 *customLabels;
57 1 hiro
        GList                 *labelInd;
58 1 hiro
        gint                  retVal;
59 1 hiro
        gboolean              accessFlag;
60 1 hiro
        gboolean              havePC3;
61 1 hiro
        time_t                pc3ModifyTime;
62 1 hiro
};
63 1 hiro
64 1 hiro
/* Limits */
65 1 hiro
#define JPILOT_NUM_LABELS        22        /* Number of labels */
66 1 hiro
#define JPILOT_NUM_PHONELABELS        8         /* Number of phone number labels */
67 1 hiro
#define JPILOT_NUM_CATEG        16        /* Number of categories */
68 1 hiro
#define JPILOT_LEN_LABEL        15        /* Max length of label */
69 1 hiro
#define JPILOT_LEN_CATEG        15        /* Max length of category */
70 1 hiro
#define JPILOT_NUM_ADDR_PHONE        5        /* Number of phone entries a person
71 1 hiro
                                           can have */
72 1 hiro
73 1 hiro
/* Function prototypes */
74 1 hiro
JPilotFile *jpilot_create                ( void );
75 1 hiro
JPilotFile *jpilot_create_path                ( const gchar *path );
76 1 hiro
void jpilot_set_name                        ( JPilotFile* pilotFile, const gchar *value );
77 1 hiro
void jpilot_set_file                        ( JPilotFile* pilotFile, const gchar *value );
78 1 hiro
void jpilot_free                        ( JPilotFile *pilotFile );
79 1 hiro
gint jpilot_get_status                        ( JPilotFile *pilotFile );
80 1 hiro
gboolean jpilot_get_modified                ( JPilotFile *pilotFile );
81 1 hiro
gboolean jpilot_get_accessed                ( JPilotFile *pilotFile );
82 1 hiro
void jpilot_set_accessed                ( JPilotFile *pilotFile, const gboolean value );
83 1 hiro
gboolean jpilot_get_read_flag                ( JPilotFile *pilotFile );
84 1 hiro
ItemFolder *jpilot_get_root_folder        ( JPilotFile *pilotFile );
85 1 hiro
gchar *jpilot_get_name                        ( JPilotFile *pilotFile );
86 1 hiro
87 1 hiro
void jpilot_force_refresh                ( JPilotFile *pilotFile );
88 1 hiro
void jpilot_print_file                        ( JPilotFile *jpilotFile, FILE *stream );
89 1 hiro
void jpilot_print_short                        ( JPilotFile *pilotFile, FILE *stream );
90 1 hiro
gint jpilot_read_data                        ( JPilotFile *pilotFile );
91 1 hiro
GList *jpilot_get_list_person                ( JPilotFile *pilotFile );
92 1 hiro
GList *jpilot_get_list_folder                ( JPilotFile *pilotFile );
93 1 hiro
GList *jpilot_get_all_persons                ( JPilotFile *pilotFile );
94 1 hiro
95 1 hiro
GList *jpilot_load_label                ( JPilotFile *pilotFile, GList *labelList );
96 1 hiro
GList *jpilot_get_category_list                ( JPilotFile *pilotFile );
97 1 hiro
gchar *jpilot_get_category_name                ( JPilotFile *pilotFile, gint catID );
98 1 hiro
GList *jpilot_load_phone_label                ( JPilotFile *pilotFile, GList *labelList );
99 1 hiro
GList *jpilot_load_custom_label                ( JPilotFile *pilotFile, GList *labelList );
100 1 hiro
101 1 hiro
gboolean jpilot_validate                ( const JPilotFile *pilotFile );
102 1 hiro
gchar *jpilot_find_pilotdb                ( void );
103 1 hiro
104 1 hiro
gint jpilot_test_read_file                ( const gchar *fileSpec );
105 1 hiro
106 1 hiro
void jpilot_clear_custom_labels                ( JPilotFile *pilotFile );
107 1 hiro
void jpilot_add_custom_label                ( JPilotFile *pilotFile, const gchar *labelName );
108 1 hiro
GList *jpilot_get_custom_labels                ( JPilotFile *pilotFile );
109 1 hiro
gboolean jpilot_test_custom_label        ( JPilotFile *pilotFile, const gchar *labelName );
110 1 hiro
/* gboolean jpilot_test_pilot_lib                ( void ); */
111 1 hiro
112 1 hiro
gint jpilot_read_modified                ( JPilotFile *pilotFile );
113 1 hiro
114 1 hiro
#endif /* USE_JPILOT */
115 1 hiro
116 1 hiro
#endif /* __JPILOT_H__ */