5 A Linux/Unix GUI for Nokia mobile phones.
7 Released under the terms of the GNU GPL, see file COPYING for more details.
13 #ifndef XGNOKII_CONTACTS_H
14 #define XGNOKII_CONTACTS_H
18 #include "gsm-common.h"
21 #define IO_BUF_LEN 160
23 /* Structure to keep memory status information */
25 int MaxME; /* Maximum Phone memory entries. */
26 int UsedME; /* Actualy used Phone memory entries. */
27 int FreeME; /* FreeME = MaxME - UsedME */
28 int MaxSM; /* Maximum SIM memory entries. */
33 /* Array to hold contacts entry */
34 typedef GPtrArray* ContactsMemory;
36 /* Structure to keep contacts memory entry status */
38 E_Unchanged, /* Entry is not empty and is unchanged. */
39 E_Changed, /* Entry is not empty and is changed. */
40 E_Deleted, /* Entry was deleted. */
41 E_Empty /* Entry is empty. */
44 /* Memory entry data */
46 GSM_PhonebookEntry entry; /* Phonebook entry self. */
47 EntryStatus status; /* Entry status. */
50 /* Structure to hold information of Edit and New dialogs */
52 PhonebookEntry *pbEntry;
58 GtkWidget *memoryTypePhone;
59 GtkWidget *memoryTypeSIM;
61 GtkWidget *groupLabel;
69 PhonebookEntry *pbEntry;
75 /* Structure to hold information for FindEntry dialog. */
84 /* Contains fileName for Export dialog. */
90 /* Hold widgets for SelectContactDialog */
93 GtkWidget *clist; /* list of contacts */
94 GtkWidget *clistScrolledWindow;
95 GtkWidget *okButton; /* Ok and Cancel button widgets */
96 GtkWidget *cancelButton;
100 /* Max length for status line. (Line that shows used/max information for
102 #define STATUS_INFO_LENGTH 40
105 /* Structure to hold information for status line (bottom line of window) */
108 gchar text[STATUS_INFO_LENGTH]; /* Status line text. */
109 gint ch_ME:1; /* 1 if phone memory was changed */
110 gint ch_SM:1; /* 1 if phone SIM was changed */
114 /* Structure to hold information for progress dialog */
130 gchar pattern[GSM_MAX_PHONEBOOK_NAME_LENGTH + 1];
137 GdkPixmap *simMemPix, *phoneMemPix;
142 extern void GUI_CreateContactsWindow (void);
144 extern void GUI_ShowContacts (void);
146 /* return != 0 if user has unsaved changes in contacts memory */
147 extern gint GUI_ContactsIsChanged (void);
149 /* return TRUE if Contacts memory was read from phone or from file */
150 extern bool GUI_ContactsIsIntialized (void);
152 /* Read contacts from phone */
153 extern void GUI_ReadContacts (void);
155 /* Save contacts to phone */
156 extern void GUI_SaveContacts (void);
158 /* Create save question dialog and can end application */
159 extern void GUI_QuitSaveContacts (void);
161 extern void GUI_RefreshContacts (void);
163 /* Function take number and return name belonged to number.
164 If no name is found, return NULL;
165 Do not modify returned name! */
166 extern gchar *GUI_GetName (gchar *number);
168 extern gchar *GUI_GetNameExact (gchar *number);
170 extern gchar *GUI_GetNumber (gchar *name);
171 /* Function show dialog with contacts and let select entries.
172 See xgnokii_contacts.c for sample of use. */
173 extern SelectContactData *GUI_SelectContactDialog (void);
175 extern void GUI_RefreshGroupMenu (void);
177 extern PhonebookEntry *GUI_GetEntry (GSM_MemoryType, gint);
179 void ExtPbkChanged (GtkWidget *widget, gpointer data );