Files removed from mygnokii distribution
[gnokii.git] / include / gsm-phonebook.h
1 /*
2
3   G N O K I I
4
5   A Linux/Unix toolset and driver for Nokia mobile phones.
6
7   Released under the terms of the GNU GPL, see file COPYING for more details.
8         
9 */
10
11 #ifndef __gsm_phonebook_h
12 #define __gsm_phonebook_h
13
14 #include "gsm-sms.h"
15
16 /* Limits for sizing of array in GSM_PhonebookEntry. Individual handsets may
17    not support these lengths so they have their own limits set. */
18
19 #define GSM_MAX_PHONEBOOK_NAME_LENGTH   (50)   /* For 7110 */
20 #define GSM_MAX_PHONEBOOK_NUMBER_LENGTH (48)   /* For 7110 */
21 #define GSM_MAX_PHONEBOOK_TEXT_LENGTH   (60)   /* For 7110 */
22 #define GSM_MAX_PHONEBOOK_SUB_ENTRIES   (8)    /* For 7110 */
23 #define GSM_MAX_PHONEBOOK_LOGO_LENGTH   (126)  /* For 7110 */
24                                                /* 7110 is able to in one
25                                                 * entry 5 numbers and 2
26                                                 * texts [email,notice,postal] */
27
28 /* Here is a macro for models that do not support caller groups. */
29
30 #define GSM_GROUPS_NOT_SUPPORTED -1
31
32 /* This data type is used to report the number of used and free positions in
33    memory (sim or internal). */
34
35 typedef struct {
36   GSM_MemoryType MemoryType; /* Type of the memory */
37   int Used;                  /* Number of used positions */
38   int Free;                  /* Number of free positions */
39 } GSM_MemoryStatus;
40
41 /* Some phones (in this moment 6210/7110) supports extended phonebook
42    with additional datas. Here we have structure for them */
43 typedef enum
44 {
45   GSM_General = 0x0a,
46   GSM_Mobile  = 0x03,
47   GSM_Work    = 0x06,
48   GSM_Fax     = 0x04,
49   GSM_Home    = 0x02,
50   GSM_SIM     = 0x00
51 } GSM_Number_Type;
52
53 typedef enum
54 {
55   GSM_Number     = 0x0b,
56   GSM_Note       = 0x0a,
57   GSM_Postal     = 0x09,
58   GSM_Email      = 0x08,
59   GSM_Name       = 0x07,
60   GSM_RingtoneNo = 0x0C,
61   GSM_Date       = 0x13,  /* Date is used for DC,RC,etc (last calls) */
62   GSM_LogoOn     = 0x1C,
63   GSM_GroupLogo  = 0x1B,
64   GSM_GroupNo    = 0x1E
65 } GSM_EntryType;
66
67 typedef struct {
68     char Number[GSM_MAX_PHONEBOOK_TEXT_LENGTH+1]; /* Number */
69     GSM_DateTime Date;                            /* or the last calls list */
70 } GSM_SubPhonebookEntrydata;
71
72 typedef struct {
73   GSM_EntryType   EntryType;
74   GSM_Number_Type NumberType;
75   GSM_SubPhonebookEntrydata data;
76   int             BlockNumber;
77 } GSM_SubPhonebookEntry;
78
79 /* Define datatype for phonebook entry, used for getting/writing phonebook
80    entries. */
81
82 typedef struct {
83   bool Empty;                                       /* Is this entry empty? */
84   char Name[GSM_MAX_PHONEBOOK_NAME_LENGTH + 1];     /* Plus 1 for
85                                                        nullterminator. */
86   char Number[GSM_MAX_PHONEBOOK_NUMBER_LENGTH + 1]; /* Number */
87   GSM_MemoryType MemoryType;                        /* Type of memory */
88   int Group;                                        /* Group */
89   int Location;                                     /* Location */
90   GSM_SubPhonebookEntry SubEntries[GSM_MAX_PHONEBOOK_SUB_ENTRIES];
91                                                     /* For phones with
92                                                      * additional phonebook
93                                                      * entries */
94   int SubEntriesCount;                              /* Should be 0, if extended
95                                                        phonebook is not used */
96 } GSM_PhonebookEntry;
97
98 char *GSM_GetVCARD(GSM_PhonebookEntry *entry, int version);
99
100 int GSM_SavePhonebookEntryToSMS(GSM_MultiSMSMessage *SMS,
101                                 GSM_PhonebookEntry *entry, int version);
102
103 #endif  /* __gsm_phonebook_h */