5 A Linux/Unix GUI for Nokia mobile phones.
6 Copyright (C) 1999 Pavel Janík ml., Hugh Blemings
7 & Ján Derfiòák <ja@mail.upjs.sk>.
9 Released under the terms of the GNU GPL, see file COPYING for more details.
14 Revision 1.1.1.4 2002/04/03 00:08:28 short
15 Found in "gnokii-working" directory, some November-patches version
17 Revision 1.12 2001/02/02 08:09:57 ja
18 New dialogs for 6210/7110 in xgnokii. Fixed the smsd for new capabilty code.
23 #ifndef XGNOKII_CONTACTS_H
24 #define XGNOKII_CONTACTS_H
28 #include "gsm-common.h"
31 #define IO_BUF_LEN 160
33 /* Structure to keep memory status information */
35 int MaxME; /* Maximum Phone memory entries. */
36 int UsedME; /* Actualy used Phone memory entries. */
37 int FreeME; /* FreeME = MaxME - UsedME */
38 int MaxSM; /* Maximum SIM memory entries. */
43 /* Array to hold contacts entry */
44 typedef GPtrArray* ContactsMemory;
46 /* Structure to keep contacts memory entry status */
48 E_Unchanged, /* Entry is not empty and is unchanged. */
49 E_Changed, /* Entry is not empty and is changed. */
50 E_Deleted, /* Entry was deleted. */
51 E_Empty /* Entry is empty. */
54 /* Memory entry data */
56 GSM_PhonebookEntry entry; /* Phonebook entry self. */
57 EntryStatus status; /* Entry status. */
60 /* Structure to hold information of Edit and New dialogs */
62 PhonebookEntry *pbEntry;
68 GtkWidget *memoryTypePhone;
69 GtkWidget *memoryTypeSIM;
71 GtkWidget *groupLabel;
79 PhonebookEntry *pbEntry;
85 /* Structure to hold information for FindEntry dialog. */
94 /* Contains fileName for Export dialog. */
100 /* Hold widgets for SelectContactDialog */
103 GtkWidget *clist; /* list of contacts */
104 GtkWidget *clistScrolledWindow;
105 GtkWidget *okButton; /* Ok and Cancel button widgets */
106 GtkWidget *cancelButton;
110 /* Max length for status line. (Line that shows used/max information for
112 #define STATUS_INFO_LENGTH 40
115 /* Structure to hold information for status line (bottom line of window) */
118 gchar text[STATUS_INFO_LENGTH]; /* Status line text. */
119 gint ch_ME:1; /* 1 if phone memory was changed */
120 gint ch_SM:1; /* 1 if phone SIM was changed */
124 /* Structure to hold information for progress dialog */
140 gchar pattern[GSM_MAX_PHONEBOOK_NAME_LENGTH + 1];
147 GdkPixmap *simMemPix, *phoneMemPix;
152 extern void GUI_CreateContactsWindow (void);
154 extern void GUI_ShowContacts (void);
156 /* return != 0 if user has unsaved changes in contacts memory */
157 extern gint GUI_ContactsIsChanged (void);
159 /* return TRUE if Contacts memory was read from phone or from file */
160 extern bool GUI_ContactsIsIntialized (void);
162 /* Read contacts from phone */
163 extern void GUI_ReadContacts (void);
165 /* Save contacts to phone */
166 extern void GUI_SaveContacts (void);
168 /* Create save question dialog and can end application */
169 extern void GUI_QuitSaveContacts (void);
171 extern void GUI_RefreshContacts (void);
173 /* Function take number and return name belonged to number.
174 If no name is found, return NULL;
175 Do not modify returned name! */
176 extern gchar *GUI_GetName (gchar *number);
178 extern gchar *GUI_GetNameExact (gchar *number);
180 extern gchar *GUI_GetNumber (gchar *name);
181 /* Function show dialog with contacts and let select entries.
182 See xgnokii_contacts.c for sample of use. */
183 extern SelectContactData *GUI_SelectContactDialog (void);
185 extern void GUI_RefreshGroupMenu (void);
187 extern PhonebookEntry *GUI_GetEntry (GSM_MemoryType, gint);
189 void ExtPbkChanged (GtkWidget *widget, gpointer data );