1 #ifndef __gsm_calendar_h
2 #define __gsm_calendar_h
4 #include "../gsmcomon.h"
6 /* ---------------------------- calendar ----------------------------------- */
8 #define GSM_CALENDAR_ENTRIES 16
9 #define MAX_CALENDAR_TEXT_LENGTH 256 /* In 6310 max. 256 chars */
12 * Define enums for Calendar Note types.
28 * Birthday or Anniversary or Special Occasion
32 * Memo or Miscellaneous
44 * Training - Athletism
48 * Training - Ball Games
64 * Training - Extreme Sports
80 * Training - Horse Race
100 * Training - Street Games
104 * Training - Swimming
116 * Training - Winter Games
124 * Alarm repeating each day.
127 } GSM_CalendarNoteType
;
130 * One value of calendar event.
134 * Date and time of event start.
136 CAL_START_DATETIME
= 1,
138 * Date and time of event end.
142 * Alarm date and time.
146 * Date and time of silent alarm.
148 CAL_SILENT_ALARM_DATETIME
,
166 * Whether this entry is private.
170 * Related contact id.
174 * Repeat each x'th day of week.
176 CAL_REPEAT_DAYOFWEEK
,
178 * Repeat each x'th day of month.
182 * Repeat x'th week of month.
184 CAL_REPEAT_WEEKOFMONTH
,
190 * Repeating frequency.
192 CAL_REPEAT_FREQUENCY
,
196 CAL_REPEAT_STARTDATE
,
204 * One value of calendar event.
210 GSM_CalendarType EntryType
;
212 * Text of value, if applicable.
214 unsigned char Text
[(MAX_CALENDAR_TEXT_LENGTH
+ 1)*2];
216 * Date and time of value, if applicable.
220 * Number of value, if applicable.
223 } GSM_SubCalendarEntry
;
226 * Calendar note values.
230 * Type of calendar note.
232 GSM_CalendarNoteType Type
;
234 * Location in memory.
244 GSM_SubCalendarEntry Entries
[GSM_CALENDAR_ENTRIES
];
247 void GSM_CalendarFindDefaultTextTimeAlarmPhoneRecurrance(GSM_CalendarEntry
*entry
, int *Text
, int *Time
, int *Alarm
, int *Phone
, int *Recurrance
, int *EndTime
, int *Location
);
252 SonyEricsson_VCalendar
253 } GSM_VCalendarVersion
;
255 GSM_Error
GSM_EncodeVCALENDAR(char *Buffer
, int *Length
, GSM_CalendarEntry
*note
, bool header
, GSM_VCalendarVersion Version
);
257 bool IsCalendarNoteFromThePast(GSM_CalendarEntry
*note
);
261 * Monday = 1, Tuesday = 2,...
265 * 0 = no delete, 1 = after day,...
268 } GSM_CalendarSettings
;
271 * Structure used for returning calendar status.
275 * Number of used positions.
278 } GSM_CalendarStatus
;
281 /* ------------------------------ to-do ------------------------------------ */
283 #define GSM_TODO_ENTRIES 7
284 #define MAX_TODO_TEXT_LENGTH 50 /* Alcatel BE5 50 chars */
287 * Types of to do values. In parenthesis is member of @ref GSM_SubToDoEntry,
288 * where value is stored.
294 TODO_END_DATETIME
= 1,
296 * Whether is completed. (Number)
300 * When should alarm be fired (Date).
304 * When should silent alarm be fired (Date).
306 TODO_SILENT_ALARM_DATETIME
,
308 * Text of to do (Text).
312 * Whether entry is private (Number).
316 * Category of entry (Number).
320 * Related contact ID (Number).
324 * Number to call (Text).
333 GSM_Priority_High
= 1,
339 * Value of to do entry.
345 GSM_ToDoType EntryType
;
347 * Text of value, if appropriate, see @ref GSM_ToDoType.
349 unsigned char Text
[(MAX_TODO_TEXT_LENGTH
+ 1)*2];
351 * Date of value, if appropriate, see @ref GSM_ToDoType.
355 * Number of value, if appropriate, see @ref GSM_ToDoType.
367 GSM_ToDo_Priority Priority
;
369 * Location in memory.
377 * Values of current entry.
379 GSM_SubToDoEntry Entries
[GSM_TODO_ENTRIES
];
382 void GSM_ToDoFindDefaultTextTimeAlarmCompleted(GSM_ToDoEntry
*entry
, int *Text
, int *Alarm
, int *Completed
, int *EndTime
, int *Phone
);
389 GSM_Error
GSM_EncodeVTODO(char *Buffer
, int *Length
, GSM_ToDoEntry
*note
, bool header
, GSM_VToDoVersion Version
);
392 * Status of to do entries.
396 * Number of used positions.
401 /* --------------------------- note ---------------------------------------- */
408 GSM_Error
GSM_EncodeVNTFile(unsigned char *Buffer
, int *Length
, GSM_NoteEntry
*Note
);
410 /* --------------------------- alarm --------------------------------------- */
417 * Location where it is stored.
421 * Date and time of alarm.
423 GSM_DateTime DateTime
;
425 * Whether it repeats each day.
429 * Text that is shown on display.
431 char Text
[(MAX_CALENDAR_TEXT_LENGTH
+ 1) * 2];
434 /* --------------------------- calendar & todo ----------------------------- */
436 GSM_Error
GSM_DecodeVCALENDAR_VTODO(unsigned char *Buffer
, int *Pos
, GSM_CalendarEntry
*Calendar
, GSM_ToDoEntry
*ToDo
, GSM_VCalendarVersion CalVer
, GSM_VToDoVersion ToDoVer
);
440 /* How should editor hadle tabs in this file? Add editor commands here.
441 * vim: noexpandtab sw=8 ts=8 sts=8: