7 A Linux/Unix GUI for Nokia mobile phones.
8 Copyright (C) 1999 Pavel Janík ml., Hugh Blemings
9 & Ján Derfiòák <ja@mail.upjs.sk>.
11 Released under the terms of the GNU GPL, see file COPYING for more details.
15 #ifndef XGNOKII_CONTACTS_H
16 #define XGNOKII_CONTACTS_H
20 #include "gsm-common.h"
23 #define IO_BUF_LEN 160
25 /* Structure to keep memory status information */
27 int MaxME; /* Maximum Phone memory entries. */
28 int UsedME; /* Actualy used Phone memory entries. */
29 int FreeME; /* FreeME = MaxME - UsedME */
30 int MaxSM; /* Maximum SIM memory entries. */
35 /* Array to hold contacts entry */
36 typedef GPtrArray* ContactsMemory;
38 /* Structure to keep contacts memory entry status */
40 E_Unchanged, /* Entry is not empty and is unchanged. */
41 E_Changed, /* Entry is not empty and is changed. */
42 E_Deleted, /* Entry was deleted. */
43 E_Empty /* Entry is empty. */
46 /* Memory entry data */
48 GSM_PhonebookEntry entry; /* Phonebook entry self. */
49 EntryStatus status; /* Entry status. */
52 /* Structure to hold information of Edit and New dialogs */
54 PhonebookEntry *pbEntry;
60 GtkWidget *memoryTypePhone;
61 GtkWidget *memoryTypeSIM;
63 GtkWidget *groupLabel;
71 PhonebookEntry *pbEntry;
77 /* Structure to hold information for FindEntry dialog. */
86 /* Contains fileName for Export dialog. */
92 /* Hold widgets for SelectContactDialog */
95 GtkWidget *clist; /* list of contacts */
96 GtkWidget *clistScrolledWindow;
97 GtkWidget *okButton; /* Ok and Cancel button widgets */
98 GtkWidget *cancelButton;
102 /* Max length for status line. (Line that shows used/max information for
104 #define STATUS_INFO_LENGTH 40
107 /* Structure to hold information for status line (bottom line of window) */
110 gchar text[STATUS_INFO_LENGTH]; /* Status line text. */
111 gint ch_ME:1; /* 1 if phone memory was changed */
112 gint ch_SM:1; /* 1 if phone SIM was changed */
116 /* Structure to hold information for progress dialog */
132 gchar pattern[GSM_MAX_PHONEBOOK_NAME_LENGTH + 1];
139 GdkPixmap *simMemPix, *phoneMemPix;
144 extern void GUI_CreateContactsWindow (void);
146 extern void GUI_ShowContacts (void);
148 /* return != 0 if user has unsaved changes in contacts memory */
149 extern gint GUI_ContactsIsChanged (void);
151 /* return TRUE if Contacts memory was read from phone or from file */
152 extern bool GUI_ContactsIsIntialized (void);
154 /* Read contacts from phone */
155 extern void GUI_ReadContacts (void);
157 /* Save contacts to phone */
158 extern void GUI_SaveContacts (void);
160 /* Create save question dialog and can end application */
161 extern void GUI_QuitSaveContacts (void);
163 extern void GUI_RefreshContacts (void);
165 /* Function take number and return name belonged to number.
166 If no name is found, return NULL;
167 Do not modify returned name! */
168 extern gchar *GUI_GetName (gchar *number);
170 extern gchar *GUI_GetNameExact (gchar *number);
172 extern gchar *GUI_GetNumber (gchar *name);
173 /* Function show dialog with contacts and let select entries.
174 See xgnokii_contacts.c for sample of use. */
175 extern SelectContactData *GUI_SelectContactDialog (void);
177 extern void GUI_RefreshGroupMenu (void);
179 extern PhonebookEntry *GUI_GetEntry (GSM_MemoryType, gint);
181 void ExtPbkChanged (GtkWidget *widget, gpointer data );