2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 2001 Match Grun
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * Definitions for accessing JPilot database files.
22 * JPilot is Copyright(c) by Judd Montgomery.
23 * Visit http://www.jpilot.org for more details.
33 #include <pi-address.h>
36 #include "addrcache.h"
38 typedef struct _JPilotFile JPilotFile;
44 AddressCache *addressCache;
45 struct AddressAppInfo addrInfo;
46 gboolean readMetadata;
50 // ItemFolder *rootFolder;
55 #define JPILOT_NUM_LABELS 22 // Number of labels
56 #define JPILOT_NUM_PHONELABELS 8 // Number of phone number labels
57 #define JPILOT_NUM_CATEG 16 // Number of categories
58 #define JPILOT_LEN_LABEL 15 // Max length of label
59 #define JPILOT_LEN_CATEG 15 // Max length of category
60 #define JPILOT_NUM_ADDR_PHONE 5 // Number of phone entries a person can have
62 /* Function prototypes */
63 JPilotFile *jpilot_create ( void );
64 JPilotFile *jpilot_create_path ( const gchar *path );
65 void jpilot_set_name ( JPilotFile* pilotFile, const gchar *value );
66 void jpilot_set_file ( JPilotFile* pilotFile, const gchar *value );
67 void jpilot_free ( JPilotFile *pilotFile );
68 gint jpilot_get_status ( JPilotFile *pilotFile );
69 gboolean jpilot_get_modified ( JPilotFile *pilotFile );
70 gboolean jpilot_get_accessed ( JPilotFile *pilotFile );
71 void jpilot_set_accessed ( JPilotFile *pilotFile, const gboolean value );
72 gboolean jpilot_get_read_flag ( JPilotFile *pilotFile );
73 ItemFolder *jpilot_get_root_folder ( JPilotFile *pilotFile );
74 gchar *jpilot_get_name ( JPilotFile *pilotFile );
76 void jpilot_force_refresh ( JPilotFile *pilotFile );
77 void jpilot_print_file ( JPilotFile *jpilotFile, FILE *stream );
78 void jpilot_print_short ( JPilotFile *pilotFile, FILE *stream );
79 gint jpilot_read_data ( JPilotFile *pilotFile );
80 GList *jpilot_get_list_person ( JPilotFile *pilotFile );
81 GList *jpilot_get_list_folder ( JPilotFile *pilotFile );
82 GList *jpilot_get_all_persons ( JPilotFile *pilotFile );
84 GList *jpilot_load_label ( JPilotFile *pilotFile, GList *labelList );
85 GList *jpilot_get_category_list ( JPilotFile *pilotFile );
86 gchar *jpilot_get_category_name ( JPilotFile *pilotFile, gint catID );
87 GList *jpilot_load_phone_label ( JPilotFile *pilotFile, GList *labelList );
88 GList *jpilot_load_custom_label ( JPilotFile *pilotFile, GList *labelList );
90 gboolean jpilot_validate ( const JPilotFile *pilotFile );
91 gchar *jpilot_find_pilotdb ( void );
93 gint jpilot_test_read_file ( const gchar *fileSpec );
95 void jpilot_clear_custom_labels ( JPilotFile *pilotFile );
96 void jpilot_add_custom_label ( JPilotFile *pilotFile, const gchar *labelName );
97 GList *jpilot_get_custom_labels ( JPilotFile *pilotFile );
98 gboolean jpilot_test_custom_label ( JPilotFile *pilotFile, const gchar *labelName );
99 gboolean jpilot_test_pilot_lib ( void );
101 #endif /* USE_JPILOT */
103 #endif /* __JPILOT_H__ */