Imported gammu 0.90.7
[gammu.git] / common / service / sms / gsmmulti.h
blobfbcda4eeed7d8879d9df5cadd35618156839b3da
2 #ifndef __gsm_multisms_h
3 #define __gsm_multisms_h
5 #include "../../gsmcomon.h"
6 #include "../gsmlogo.h"
7 #include "../gsmcal.h"
8 #include "../gsmpbk.h"
9 #include "../gsmwap.h"
10 #include "../gsmring.h"
11 #include "gsmsms.h"
13 /* ---------------------- multi SMS --------------------------------------- */
15 /* Identifiers for Smart Messaging 3.0 multipart SMS */
17 #define SM30_ISOTEXT 0 /* ISO 8859-1 text */
18 #define SM30_UNICODETEXT 1
19 #define SM30_OTA 2
20 #define SM30_RINGTONE 3
21 #define SM30_PROFILENAME 4
22 #define SM30_SCREENSAVER 6
24 void GSM_SMSCounter(int MessageLength,
25 unsigned char *MessageBuffer,
26 GSM_UDH UDHType,
27 GSM_Coding_Type Coding,
28 int *SMSNum,
29 int *CharsLeft);
31 #define MAX_MULTI_SMS 10
33 /**
34 * Multiple SMS messages, used for Smart Messaging 3.0/EMS.
36 typedef struct {
37 /**
38 * Sender or recipient number.
40 unsigned char Number;
41 /**
42 * Array of SMSes.
44 GSM_SMSMessage SMS[MAX_MULTI_SMS];
45 } GSM_MultiSMSMessage;
47 GSM_Error GSM_AddSMS_Text_UDH(GSM_MultiSMSMessage *SMS,
48 GSM_Coding_Type Coding,
49 char *Buffer,
50 int BufferLen,
51 bool UDH,
52 int *UsedText,
53 int *CopiedText,
54 int *CopiedSMSText);
56 void GSM_MakeMultiPartSMS(GSM_MultiSMSMessage *SMS,
57 unsigned char *MessageBuffer,
58 int MessageLength,
59 GSM_UDH UDHType,
60 GSM_Coding_Type Coding,
61 int Class,
62 unsigned char RejectDuplicates);
64 void GSM_Find_Free_Used_SMS2(GSM_Coding_Type Coding,GSM_SMSMessage SMS, int *UsedText, int *FreeText, int *FreeBytes);
66 unsigned char GSM_MakeSMSIDFromTime();
68 /**
69 * ID during packing SMS for Smart Messaging 3.0, EMS and other
71 typedef enum {
72 /**
73 * 1 text SMS.
75 SMS_Text = 1,
76 /**
77 * Contacenated SMS, when longer than 1 SMS.
79 SMS_ConcatenatedTextLong,
80 /**
81 * Contacenated SMS, auto Default/Unicode coding.
83 SMS_ConcatenatedAutoTextLong,
84 SMS_ConcatenatedTextLong16bit,
85 SMS_ConcatenatedAutoTextLong16bit,
86 /**
87 * Nokia profile = Name, Ringtone, ScreenSaver
89 SMS_NokiaProfileLong,
90 /**
91 * Nokia Picture Image + (text)
93 SMS_NokiaPictureImageLong,
94 /**
95 * Nokia screen saver + (text)
97 SMS_NokiaScreenSaverLong,
98 /**
99 * Nokia ringtone - old SM2.0 format, 1 SMS
101 SMS_NokiaRingtone,
103 * Nokia ringtone contacenated, when very long
105 SMS_NokiaRingtoneLong,
107 * Nokia 72x14 operator logo, 1 SMS
109 SMS_NokiaOperatorLogo,
111 * Nokia 72x14 op logo or 78x21 in 2 SMS
113 SMS_NokiaOperatorLogoLong,
115 * Nokia 72x14 caller logo, 1 SMS
117 SMS_NokiaCallerLogo,
119 * Nokia WAP bookmark in 1 or 2 SMS
121 SMS_NokiaWAPBookmarkLong,
123 * Nokia WAP settings in 2 SMS
125 SMS_NokiaWAPSettingsLong,
127 * Nokia MMS settings in 2 SMS
129 SMS_NokiaMMSSettingsLong,
131 * Nokia VCARD 1.0 - only name and default number
133 SMS_NokiaVCARD10Long,
135 * Nokia VCARD 2.1 - all numbers + text
137 SMS_NokiaVCARD21Long,
139 * Nokia VCALENDAR 1.0 - can be in few sms
141 SMS_NokiaVCALENDAR10Long,
142 SMS_NokiaVTODOLong,
143 SMS_VCARD10Long,
144 SMS_VCARD21Long,
145 SMS_DisableVoice,
146 SMS_DisableFax,
147 SMS_DisableEmail,
148 SMS_EnableVoice,
149 SMS_EnableFax,
150 SMS_EnableEmail,
151 SMS_VoidSMS,
153 * IMelody 1.0
155 SMS_EMSSound10,
157 * IMelody 1.2
159 SMS_EMSSound12,
161 * IMelody without header - SonyEricsson extension
163 SMS_EMSSonyEricssonSound,
165 * IMelody 1.0 with UPI.
167 SMS_EMSSound10Long,
168 /***
169 * IMelody 1.2 with UPI.
171 SMS_EMSSound12Long,
173 * IMelody without header with UPI.
175 SMS_EMSSonyEricssonSoundLong,
176 SMS_EMSPredefinedSound,
177 SMS_EMSPredefinedAnimation,
178 SMS_EMSAnimation,
180 * Fixed bitmap of size 16x16 or 32x32.
182 SMS_EMSFixedBitmap,
183 SMS_EMSVariableBitmap,
184 SMS_EMSVariableBitmapLong,
185 SMS_MMSIndicatorLong
186 } EncodeMultiPartSMSID;
188 typedef struct {
189 EncodeMultiPartSMSID ID;
191 int Number;
192 GSM_Ringtone *Ringtone;
193 GSM_MultiBitmap *Bitmap;
194 GSM_WAPBookmark *Bookmark;
195 GSM_WAPSettings *Settings;
196 GSM_MMSIndicator *MMSIndicator;
197 GSM_MemoryEntry *Phonebook;
198 GSM_CalendarEntry *Calendar;
199 GSM_ToDoEntry *ToDo;
200 bool Protected;
202 unsigned char *Buffer;
203 bool Left;
204 bool Right;
205 bool Center;
206 bool Large;
207 bool Small;
208 bool Bold;
209 bool Italic;
210 bool Underlined;
211 bool Strikethrough;
213 /* Return values */
214 int RingtoneNotes;
215 } EncodeMultiPartSMSEntry;
217 typedef struct {
218 /* Input values */
219 EncodeMultiPartSMSEntry Entries[MAX_MULTI_SMS];
220 int EntriesNum;
221 bool UnicodeCoding;
222 int Class;
223 unsigned char ReplaceMessage;
225 bool Unknown;
226 } GSM_EncodeMultiPartSMSInfo;
228 GSM_Error GSM_EncodeMultiPartSMS (GSM_EncodeMultiPartSMSInfo *Info, GSM_MultiSMSMessage *SMS);
229 bool GSM_DecodeMultiPartSMS (GSM_EncodeMultiPartSMSInfo *Info, GSM_MultiSMSMessage *SMS, bool ems);
230 void GSM_ClearMultiPartSMSInfo (GSM_EncodeMultiPartSMSInfo *Info);
232 GSM_Error GSM_LinkSMS(GSM_MultiSMSMessage *INPUT[200], GSM_MultiSMSMessage *OUTPUT[200], bool ems);
234 #endif
236 /* How should editor hadle tabs in this file? Add editor commands here.
237 * vim: noexpandtab sw=8 ts=8 sts=8: