Gammu internals  1.38.0
gammu-backup.h
Go to the documentation of this file.
1 
7 #ifndef __gammu_backup_h
8 #define __gammu_backup_h
9 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #include <gammu-message.h>
20 #include <gammu-memory.h>
21 #include <gammu-calendar.h>
22 #include <gammu-bitmap.h>
23 #include <gammu-wap.h>
24 #include <gammu-settings.h>
25 #include <gammu-ringtone.h>
26 #include <gammu-config.h>
27 
28 #ifdef GSM_ENABLE_BACKUP
29 
35 #define GSM_BACKUP_MAX_SMS 100000
36 
42 typedef struct {
46  GSM_SMSMessage *SMS[GSM_BACKUP_MAX_SMS + 1];
47 } GSM_SMS_Backup;
48 
59 GSM_Error GSM_ReadSMSBackupFile(const char *FileName, GSM_SMS_Backup * backup);
60 
71 GSM_Error GSM_AddSMSBackupFile(const char *FileName, GSM_SMS_Backup * backup);
72 
80 void GSM_ClearSMSBackup(GSM_SMS_Backup * backup);
81 
89 void GSM_FreeSMSBackup(GSM_SMS_Backup * backup);
90 
98 #define GSM_BACKUP_MAX_PHONEPHONEBOOK 1001
99 
106 #define GSM_BACKUP_MAX_SIMPHONEBOOK 251
107 
114 #define GSM_BACKUP_MAX_CALLER 101
115 
122 #define GSM_BACKUP_MAX_SMSC 10
123 
130 #define GSM_BACKUP_MAX_WAPBOOKMARK 40
131 
138 #define GSM_BACKUP_MAX_WAPSETTINGS 30
139 
146 #define GSM_BACKUP_MAX_MMSSETTINGS 30
147 
154 #define GSM_BACKUP_MAX_SYNCMLSETTINGS 30
155 
162 #define GSM_BACKUP_MAX_CHATSETTINGS 30
163 
170 #define GSM_BACKUP_MAX_RINGTONES 30
171 
178 #define GSM_BACKUP_MAX_PROFILES 10
179 
186 #define GSM_BACKUP_MAX_FMSTATIONS 20
187 
194 #define GSM_BACKUP_MAX_GPRSPOINT 10
195 
202 #define GSM_BACKUP_MAX_NOTE 50
203 
209 typedef struct {
213  char IMEI[GSM_MAX_IMEI_LENGTH];
221  char Creator[80];
225  GSM_DateTime DateTime;
229  gboolean DateTimeAvailable;
233  char MD5Original[100];
237  char MD5Calculated[100];
241  GSM_MemoryEntry *PhonePhonebook[GSM_BACKUP_MAX_PHONEPHONEBOOK + 1];
245  GSM_MemoryEntry *SIMPhonebook[GSM_BACKUP_MAX_SIMPHONEBOOK + 1];
253  GSM_Bitmap *CallerLogos[GSM_BACKUP_MAX_CALLER + 1];
257  GSM_SMSC *SMSC[GSM_BACKUP_MAX_SMSC + 1];
261  GSM_WAPBookmark *WAPBookmark[GSM_BACKUP_MAX_WAPBOOKMARK + 1];
265  GSM_MultiWAPSettings *WAPSettings[GSM_BACKUP_MAX_WAPSETTINGS + 1];
269  GSM_MultiWAPSettings *MMSSettings[GSM_BACKUP_MAX_MMSSETTINGS + 1];
273  GSM_SyncMLSettings *SyncMLSettings[GSM_BACKUP_MAX_SYNCMLSETTINGS + 1];
277  GSM_ChatSettings *ChatSettings[GSM_BACKUP_MAX_CHATSETTINGS + 1];
281  GSM_Ringtone *Ringtone[GSM_BACKUP_MAX_RINGTONES + 1];
289  GSM_Profile *Profiles[GSM_BACKUP_MAX_PROFILES + 1];
293  GSM_FMStation *FMStation[GSM_BACKUP_MAX_FMSTATIONS + 1];
297  GSM_GPRSAccessPoint *GPRSPoint[GSM_BACKUP_MAX_GPRSPOINT + 1];
301  GSM_NoteEntry *Note[GSM_BACKUP_MAX_NOTE + 1];
305  GSM_Bitmap *StartupLogo;
309  GSM_Bitmap *OperatorLogo;
310 } GSM_Backup;
311 
317 typedef enum {
324  GSM_Backup_Auto = 0,
331  GSM_Backup_AutoUnicode = 1,
336  GSM_Backup_LMB,
340  GSM_Backup_VCalendar,
344  GSM_Backup_VCard,
349  GSM_Backup_LDIF,
353  GSM_Backup_ICS,
360  GSM_Backup_Gammu,
366  GSM_Backup_GammuUCS2,
370  GSM_Backup_VNote,
371 } GSM_BackupFormat;
372 
384 GSM_Error GSM_SaveBackupFile(char *FileName, GSM_Backup * Backup,
385  GSM_BackupFormat Format);
386 
397 GSM_BackupFormat GSM_GuessBackupFormat(const char *FileName,
398  const gboolean UseUnicode);
399 
412 GSM_Error GSM_ReadBackupFile(const char *FileName, GSM_Backup * backup,
413  GSM_BackupFormat Format);
414 
422 void GSM_ClearBackup(GSM_Backup * backup);
423 
431 void GSM_FreeBackup(GSM_Backup * backup);
432 
438 typedef struct {
439  gboolean UseUnicode;
440  gboolean IMEI;
441  gboolean Model;
442  gboolean DateTime;
443  gboolean ToDo;
444  gboolean PhonePhonebook;
445  gboolean SIMPhonebook;
446  gboolean Calendar;
447  gboolean CallerLogos;
448  gboolean SMSC;
449  gboolean WAPBookmark;
450  gboolean Profiles;
451  gboolean WAPSettings;
452  gboolean MMSSettings;
453  gboolean SyncMLSettings;
454  gboolean ChatSettings;
455  gboolean Ringtone;
456  gboolean StartupLogo;
457  gboolean OperatorLogo;
458  gboolean FMStation;
459  gboolean GPRSPoint;
460  gboolean Note;
461 } GSM_Backup_Info;
462 
471 void GSM_GetBackupFormatFeatures(GSM_BackupFormat Format,
472  GSM_Backup_Info * info);
473 
483 void GSM_GetBackupFileFeatures(GSM_BackupFormat Format, GSM_Backup_Info * info,
484  GSM_Backup * backup);
485 
486 #endif
487 
488 #ifdef __cplusplus
489 }
490 #endif
491 #endif
492 
493 /* Editor configuration
494  * vim: noexpandtab sw=8 ts=8 sts=8 tw=72:
495  */
#define GSM_MAX_VERSION_LENGTH
Definition: gammu-limits.h:39
GSM_Error
Definition: gammu-error.h:23
#define GSM_MAX_MODEL_LENGTH
Definition: gammu-limits.h:31
#define GSM_MAX_IMEI_LENGTH
Definition: gammu-limits.h:53
int gboolean
Definition: gammu-types.h:23
#define GSM_MAXCALENDARTODONOTES
Definition: gammu-limits.h:84