1 /**
2  * \file gammu-calendar.h
3  * \author Michal Čihař
4  *
5  * Calendar data and functions.
6  */
7 #ifndef __gammu_calendar_h
8 #define __gammu_calendar_h
9 
10 /**
11  * \defgroup Calendar Calendar
12  * Calendar events manipulations.
13  */
14 
15 #ifdef	__cplusplus
16 extern "C" {
17 #endif
18 
19 #include <gammu-datetime.h>
20 #include <gammu-limits.h>
21 #include <gammu-debug.h>
22 
23 /**
24  * \defgroup Note Note
25  * Notes manipulations.
26  */
27 
28 /**
29  * \defgroup Todo Todo
30  * Todo entries manipulations.
31  */
32 
33 /**
34  * Calendar settings structure.
35  *
36  * \ingroup Calendar
37  */
38 typedef struct {
39 	/**
40 	 * Monday = 1, Tuesday = 2,...
41 	 */
42 	int StartDay;
43 	/**
44 	 * 0 = no delete, 1 = after day,...
45 	 */
46 	int AutoDelete;
47 } GSM_CalendarSettings;
48 
49 /**
50  * Status of to do entries.
51  *
52  * \ingroup Todo
53  */
54 typedef struct {
55 	/**
56 	 * Number of free positions.
57 	 */
58 	int Free;
59 	/**
60 	 * Number of used positions.
61 	 */
62 	int Used;
63 } GSM_ToDoStatus;
64 
65 /**
66  * Structure used for returning calendar status.
67  *
68  * \ingroup Calendar
69  */
70 typedef struct {
71 	/**
72 	 * Number of free positions.
73 	 */
74 	int Free;
75 	/**
76 	 * Number of used positions.
77 	 */
78 	int Used;
79 } GSM_CalendarStatus;
80 
81 /**
82  * Enum defines types of calendar notes
83  *
84  * \ingroup Calendar
85  */
86 typedef enum {
87 	/**
88 	 * Reminder or Date
89 	 */
90 	GSM_CAL_REMINDER = 1,
91 	/**
92 	 * Call
93 	 */
94 	GSM_CAL_CALL,
95 	/**
96 	 * Meeting
97 	 */
98 	GSM_CAL_MEETING,
99 	/**
100 	 * Birthday or Anniversary or Special Occasion
101 	 */
102 	GSM_CAL_BIRTHDAY,
103 	/**
104 	 * Memo or Miscellaneous
105 	 */
106 	GSM_CAL_MEMO,
107 	/**
108 	 * Travel
109 	 */
110 	GSM_CAL_TRAVEL,
111 	/**
112 	 * Vacation
113 	 */
114 	GSM_CAL_VACATION,
115 	/**
116 	 * Training - Athletism
117 	 */
118 	GSM_CAL_T_ATHL,
119 	/**
120 	 * Training - Ball Games
121 	 */
122 	GSM_CAL_T_BALL,
123 	/**
124 	 * Training - Cycling
125 	 */
126 	GSM_CAL_T_CYCL,
127 	/**
128 	 * Training - Budo
129 	 */
130 	GSM_CAL_T_BUDO,
131 	/**
132 	 * Training - Dance
133 	 */
134 	GSM_CAL_T_DANC,
135 	/**
136 	 * Training - Extreme Sports
137 	 */
138 	GSM_CAL_T_EXTR,
139 	/**
140 	 * Training - Football
141 	 */
142 	GSM_CAL_T_FOOT,
143 	/**
144 	 * Training - Golf
145 	 */
146 	GSM_CAL_T_GOLF,
147 	/**
148 	 * Training - Gym
149 	 */
150 	GSM_CAL_T_GYM,
151 	/**
152 	 * Training - Horse Race
153 	 */
154 	GSM_CAL_T_HORS,
155 	/**
156 	 * Training - Hockey
157 	 */
158 	GSM_CAL_T_HOCK,
159 	/**
160 	 * Training - Races
161 	 */
162 	GSM_CAL_T_RACE,
163 	/**
164 	 * Training - Rugby
165 	 */
166 	GSM_CAL_T_RUGB,
167 	/**
168 	 * Training - Sailing
169 	 */
170 	GSM_CAL_T_SAIL,
171 	/**
172 	 * Training - Street Games
173 	 */
174 	GSM_CAL_T_STRE,
175 	/**
176 	 * Training - Swimming
177 	 */
178 	GSM_CAL_T_SWIM,
179 	/**
180 	 * Training - Tennis
181 	 */
182 	GSM_CAL_T_TENN,
183 	/**
184 	 * Training - Travels
185 	 */
186 	GSM_CAL_T_TRAV,
187 	/**
188 	 * Training - Winter Games
189 	 */
190 	GSM_CAL_T_WINT,
191 	/**
192 	 * Alarm
193 	 */
194 	GSM_CAL_ALARM,
195 	/**
196 	 * Alarm repeating each day.
197 	 */
198 	GSM_CAL_DAILY_ALARM,
199 	/**
200 	 * Shopping
201 	 */
202 	GSM_CAL_SHOPPING,
203 } GSM_CalendarNoteType;
204 
205 /**
206  * One value of calendar event.
207  *
208  * \ingroup Calendar
209  */
210 typedef enum {
211 	/**
212 	 * Date and time of event start.
213 	 */
214 	CAL_START_DATETIME = 1,
215 	/**
216 	 * Date and time of event end.
217 	 */
218 	CAL_END_DATETIME,
219 	/**
220 	 * Alarm date and time.
221 	 */
222 	CAL_TONE_ALARM_DATETIME,
223 	/**
224 	 * Date and time of silent alarm.
225 	 */
226 	CAL_SILENT_ALARM_DATETIME,
227 	/**
228 	 * Text.
229 	 */
230 	CAL_TEXT,
231 	/**
232 	 * Detailed description.
233 	 */
234 	CAL_DESCRIPTION,
235 	/**
236 	 * Location.
237 	 */
238 	CAL_LOCATION,
239 	/**
240 	 * Phone number.
241 	 */
242 	CAL_PHONE,
243 	/**
244 	 * Whether this entry is private.
245 	 */
246 	CAL_PRIVATE,
247 	/**
248 	 * Related contact id.
249 	 */
250 	CAL_CONTACTID,		/* 10 */
251 	/**
252 	 * Repeat each x'th day of week.
253 	 */
254 	CAL_REPEAT_DAYOFWEEK,
255 	/**
256 	 * Repeat each x'th day of month.
257 	 */
258 	CAL_REPEAT_DAY,
259 	/**
260 	 * Repeat each x'th day of year.
261 	 */
262 	CAL_REPEAT_DAYOFYEAR,
263 	/**
264 	 * Repeat x'th week of month.
265 	 */
266 	CAL_REPEAT_WEEKOFMONTH,
267 	/**
268 	 * Repeat x'th month.
269 	 */
270 	CAL_REPEAT_MONTH,
271 	/**
272 	 * Repeating frequency.
273 	 */
274 	CAL_REPEAT_FREQUENCY,
275 	/**
276 	 * Repeating start.
277 	 */
278 	CAL_REPEAT_STARTDATE,
279 	/**
280 	 * Repeating end.
281 	 */
282 	CAL_REPEAT_STOPDATE,
283 	/**
284 	 * Number of repetitions.
285 	 */
286 	CAL_REPEAT_COUNT,
287 	/**
288 	 * IrMC LUID which can be used for synchronisation.
289 	 */
290 	CAL_LUID,		/* 20 */
291 	/**
292 	 * Date and time of last modification.
293 	 */
294 	CAL_LAST_MODIFIED,
295 } GSM_CalendarType;
296 
297 /**
298  * One value of calendar event.
299  *
300  * \ingroup Calendar
301  */
302 typedef struct {
303 	/**
304 	 * Type of value.
305 	 */
306 	GSM_CalendarType EntryType;
307 	/**
308 	 * Date and time of value, if applicable.
309 	 */
310 	GSM_DateTime Date;
311 	/**
312 	 * Number of value, if applicable.
313 	 */
314 	int Number;
315 	/**
316 	 * During adding SubEntry Gammu can return here info, if it was done OK
317 	 */
318 	GSM_Error AddError;
319 	/**
320 	 * Text of value, if applicable.
321 	 */
322 	unsigned char Text[(GSM_MAX_CALENDAR_TEXT_LENGTH + 1) * 2];
323 } GSM_SubCalendarEntry;
324 
325 /**
326  * Calendar note values.
327  *
328  * \ingroup Calendar
329  */
330 typedef struct {
331 	/**
332 	 * Type of calendar note.
333 	 */
334 	GSM_CalendarNoteType Type;
335 	/**
336 	 * Location in memory.
337 	 */
338 	int Location;
339 	/**
340 	 * Number of entries.
341 	 */
342 	int EntriesNum;
343 	/**
344 	 * Values of entries.
345 	 */
346 	GSM_SubCalendarEntry Entries[GSM_CALENDAR_ENTRIES];
347 } GSM_CalendarEntry;
348 
349 /**
350  * Finds inxedes of default entries.
351  *
352  * \ingroup Calendar
353  */
354 void GSM_CalendarFindDefaultTextTimeAlarmPhone(GSM_CalendarEntry * entry,
355 					       int *Text, int *Time, int *Alarm,
356 					       int *Phone, int *EndTime,
357 					       int *Location);
358 
359 /**
360  * Types of to do values. In parenthesis is member of @ref GSM_SubToDoEntry,
361  * where value is stored.
362  *
363  * \ingroup Todo
364  */
365 typedef enum {
366 	/**
367 	 * Due date (Date).
368 	 */
369 	TODO_END_DATETIME = 1,
370 	/**
371 	 * Whether is completed (Number).
372 	 */
373 	TODO_COMPLETED,
374 	/**
375 	 * When should alarm be fired (Date).
376 	 */
377 	TODO_ALARM_DATETIME,
378 	/**
379 	 * When should silent alarm be fired (Date).
380 	 */
381 	TODO_SILENT_ALARM_DATETIME,
382 	/**
383 	 * Text of to do (Text).
384 	 */
385 	TODO_TEXT,
386 	/**
387 	 * Description of to do (Text).
388 	 */
389 	TODO_DESCRIPTION,
390 	/**
391 	 * Location of to do (Text).
392 	 */
393 	TODO_LOCATION,
394 	/**
395 	 * Whether entry is private (Number).
396 	 */
397 	TODO_PRIVATE,
398 	/**
399 	 * Category of entry (Number).
400 	 */
401 	TODO_CATEGORY,
402 	/**
403 	 * Related contact ID (Number).
404 	 */
405 	TODO_CONTACTID,
406 	/**
407 	 * Number to call (Text).
408 	 */
409 	TODO_PHONE,
410 	/**
411 	 * IrMC LUID which can be used for synchronisation (Text).
412 	 */
413 	TODO_LUID,
414 	/**
415 	 * Date and time of last modification (Date).
416 	 */
417 	TODO_LAST_MODIFIED,
418 	/**
419 	 * Start date (Date).
420 	 */
421 	TODO_START_DATETIME,
422 	/**
423 	 * Completed date (Date).
424 	 */
425 	TODO_COMPLETED_DATETIME,
426 } GSM_ToDoType;
427 
428 /**
429  * Priority of to do.
430  *
431  * \ingroup Todo
432  */
433 typedef enum {
434 	GSM_Priority_None = 0,
435 	GSM_Priority_High,
436 	GSM_Priority_Medium,
437 	GSM_Priority_Low,
438 	GSM_Priority_INVALID
439 } GSM_ToDo_Priority;
440 
441 /**
442  * Value of to do entry.
443  *
444  * \ingroup Todo
445  */
446 typedef struct {
447 	/**
448 	 * Type of entry.
449 	 */
450 	GSM_ToDoType EntryType;
451 	/**
452 	 * Date of value, if appropriate, see @ref GSM_ToDoType.
453 	 */
454 	GSM_DateTime Date;
455 	/**
456 	 * Number of value, if appropriate, see @ref GSM_ToDoType.
457 	 */
458 	unsigned int Number;
459 	/**
460 	 * Text of value, if appropriate, see @ref GSM_ToDoType.
461 	 */
462 	unsigned char Text[(GSM_MAX_TODO_TEXT_LENGTH + 1) * 2];
463 } GSM_SubToDoEntry;
464 
465 /**
466  * To do entry.
467  *
468  * \ingroup Todo
469  */
470 typedef struct {
471 	/**
472 	 * Type of todo note.
473 	 */
474 	GSM_CalendarNoteType Type;
475 	/**
476 	 * Priority of entry.
477 	 */
478 	GSM_ToDo_Priority Priority;
479 	/**
480 	 * Location in memory.
481 	 */
482 	int Location;
483 	/**
484 	 * Number of entries.
485 	 */
486 	int EntriesNum;
487 	/**
488 	 * Values of current entry.
489 	 */
490 	GSM_SubToDoEntry Entries[GSM_TODO_ENTRIES];
491 } GSM_ToDoEntry;
492 
493 /**
494  * Note entry.
495  *
496  * \ingroup Note
497  */
498 typedef struct {
499 	/**
500 	 * Location in memory.
501 	 */
502 	int Location;
503 	/**
504 	 * Text of note.
505 	 */
506 	char Text[(GSM_MAX_NOTE_TEXT_LENGTH + 1) * 2];
507 } GSM_NoteEntry;
508 
509 /**
510  * Alarm values.
511  *
512  * \ingroup Calendar
513  */
514 typedef struct {
515 	/**
516 	 * Location where it is stored.
517 	 */
518 	int Location;
519 	/**
520 	 * Date and time of alarm.
521 	 */
522 	GSM_DateTime DateTime;
523 	/**
524 	 * Whether it repeats each day.
525 	 */
526 	gboolean Repeating;
527 	/**
528 	 * Text that is shown on display.
529 	 */
530 	unsigned char Text[(GSM_MAX_CALENDAR_TEXT_LENGTH + 1) * 2];
531 } GSM_Alarm;
532 
533 /**
534  * Format of vTodo.
535  *
536  * \ingroup Todo
537  */
538 typedef enum {
539 	/**
540 	 * Format compatible with Nokia - limited subsed of standard.
541 	 */
542 	Nokia_VToDo = 1,
543 	/**
544 	 * Format compatible with SonyEricsson - complete standard.
545 	 */
546 	SonyEricsson_VToDo,
547 	/**
548 	 * Format compatible with Mozilla - iCalendar based.
549 	 */
550 	Mozilla_VToDo,
551 } GSM_VToDoVersion;
552 
553 /**
554  * Format of vCalendar export.
555  *
556  * \ingroup Calendar
557  */
558 typedef enum {
559 	/**
560 	 * vCalendar specially hacked for Nokia .
561 	 */
562 	Nokia_VCalendar = 1,
563 	/**
564 	 * vCalendar specially hacked for Siemens.
565 	 */
566 	Siemens_VCalendar,
567 	/**
568 	 * Standard vCalendar (which works for Sony-Ericsson phones)
569 	 */
570 	SonyEricsson_VCalendar,
571 	/**
572 	 * iCalendar as compatible with Mozilla.
573 	 */
574 	Mozilla_iCalendar,
575 } GSM_VCalendarVersion;
576 
577 /**
578  * Encodes vTodo to buffer.
579  *
580  * \param Buffer Storage for data.
581  * \param[in] buff_len Size of output buffer.
582  * \param Length Pointer to current position in data (will be incremented).
583  * \param note Note to encode.
584  * \param header Whether to include vCalendar header.
585  * \param Version Format of vTodo to create.
586  *
587  * \return Error code.
588  *
589  * \ingroup Todo
590  */
591 GSM_Error GSM_EncodeVTODO(char *Buffer, const size_t buff_len, size_t * Length,
592 			  const GSM_ToDoEntry * note, const gboolean header,
593 			  const GSM_VToDoVersion Version);
594 
595 /**
596  * Encodes vCalendar to buffer.
597  *
598  * \param Buffer Storage for data.
599  * \param[in] buff_len Size of output buffer.
600  * \param Length Pointer to current position in data (will be incremented).
601  * \param note Note to encode.
602  * \param header Whether to include vCalendar header.
603  * \param Version Format of vCalendar to create.
604  *
605  * \return Error code.
606  *
607  * \ingroup Calendar
608  */
609 GSM_Error GSM_EncodeVCALENDAR(char *Buffer, const size_t buff_len,
610 			      size_t * Length, GSM_CalendarEntry * note,
611 			      const gboolean header,
612 			      const GSM_VCalendarVersion Version);
613 
614 /**
615  * Decodes vNote from buffer.
616  *
617  * \param Buffer Buffer to decode.
618  * \param Pos Current position in buffer (will be updated).
619  * \param Note Storage for note entry.
620  *
621  * \return Error code.
622  *
623  * \ingroup Note
624  */
625 GSM_Error GSM_DecodeVNOTE(char *Buffer, size_t * Pos, GSM_NoteEntry * Note);
626 
627 /**
628  * Encodes vNote to buffer.
629  *
630  * \param Buffer Storage for data.
631  * \param[in] buff_len Size of output buffer.
632  * \param Length Pointer to current position in data (will be incremented).
633  * \param Note Note to encode.
634  *
635  * \return Error code.
636  *
637  * \ingroup Note
638  */
639 GSM_Error GSM_EncodeVNTFile(char *Buffer, const size_t buff_len,
640 			    size_t * Length, GSM_NoteEntry * Note);
641 
642 /**
643  * Decodes vCalendar and vTodo buffer.
644  *
645  * \param di Pointer to debugging description.
646  * \param Buffer Buffer to decode.
647  * \param Pos Current position in buffer (will be updated).
648  * \param Calendar Storage for calendar entry.
649  * \param ToDo Storage for todo entry.
650  * \param CalVer Format of vCalendar.
651  * \param ToDoVer Format of vTodo.
652  *
653  * \return Error code
654  *
655  * \ingroup Calendar
656  */
657 GSM_Error GSM_DecodeVCALENDAR_VTODO(GSM_Debug_Info * di, char *Buffer,
658 				    size_t * Pos, GSM_CalendarEntry * Calendar,
659 				    GSM_ToDoEntry * ToDo,
660 				    GSM_VCalendarVersion CalVer,
661 				    GSM_VToDoVersion ToDoVer);
662 
663 /**
664  * Detects whether calendar note is in past.
665  *
666  * \param note Note to check.
667  *
668  * \return Whether entry is in past.
669  *
670  * \ingroup Calendar
671  */
672 gboolean GSM_IsCalendarNoteFromThePast(GSM_CalendarEntry * note);
673 
674 /**
675  * Reads alarm set in phone.
676  *
677  * \param s State machine pointer.
678  * \param Alarm Storage for alarm.
679  *
680  * \return Error code
681  *
682  * \ingroup Calendar
683  */
684 GSM_Error GSM_GetAlarm(GSM_StateMachine * s, GSM_Alarm * Alarm);
685 
686 /**
687  * Sets alarm in phone.
688  *
689  * \param s State machine pointer.
690  * \param Alarm Alarm to set.
691  *
692  * \return Error code
693  *
694  * \ingroup Calendar
695  */
696 GSM_Error GSM_SetAlarm(GSM_StateMachine * s, GSM_Alarm * Alarm);
697 
698 /**
699  * Gets status of ToDos (count of used entries).
700  *
701  * \param s State machine pointer.
702  * \param status Storage for todo status.
703  *
704  * \return Error code
705  *
706  * \ingroup Todo
707  */
708 GSM_Error GSM_GetToDoStatus(GSM_StateMachine * s, GSM_ToDoStatus * status);
709 
710 /**
711  * Reads ToDo from phone.
712  *
713  * \param s State machine pointer.
714  * \param ToDo Storage for note.
715  *
716  * \return Error code
717  *
718  * \ingroup Todo
719  */
720 GSM_Error GSM_GetToDo(GSM_StateMachine * s, GSM_ToDoEntry * ToDo);
721 
722 /**
723  * Reads ToDo from phone.
724  *
725  * \param s State machine pointer.
726  * \param ToDo Storage for note, if start is FALSE, should contain
727  * data from previous read (at least position).
728  * \param start Whether we're doing initial read or continue in reading.
729  *
730  * \return Error code
731  *
732  * \ingroup Todo
733  */
734 GSM_Error GSM_GetNextToDo(GSM_StateMachine * s, GSM_ToDoEntry * ToDo,
735 			  gboolean start);
736 /**
737  * Sets ToDo in phone.
738  *
739  * \param s State machine pointer.
740  * \param ToDo ToDo to set, should contain valid location.
741  *
742  * \return Error code
743  *
744  * \ingroup Todo
745  */
746 GSM_Error GSM_SetToDo(GSM_StateMachine * s, GSM_ToDoEntry * ToDo);
747 
748 /**
749  * Adds ToDo in phone.
750  *
751  * \param s State machine pointer.
752  * \param ToDo ToDo to add.
753  *
754  * \return Error code
755  *
756  * \ingroup Todo
757  */
758 GSM_Error GSM_AddToDo(GSM_StateMachine * s, GSM_ToDoEntry * ToDo);
759 
760 /**
761  * Deletes ToDo entry in phone.
762  *
763  * \param s State machine pointer.
764  * \param ToDo ToDo to delete, only location is actually used.
765  *
766  * \return Error code
767  *
768  * \ingroup Todo
769  */
770 GSM_Error GSM_DeleteToDo(GSM_StateMachine * s, GSM_ToDoEntry * ToDo);
771 
772 /**
773  * Deletes all todo entries in phone.
774  *
775  * \param s State machine pointer.
776  *
777  * \return Error code
778  *
779  * \ingroup Todo
780  */
781 GSM_Error GSM_DeleteAllToDo(GSM_StateMachine * s);
782 
783 /**
784  * Retrieves calendar status (number of used entries).
785  *
786  * \param s State machine pointer.
787  * \param Status Storage for status.
788  *
789  * \return Error code
790  *
791  * \ingroup Calendar
792  */
793 GSM_Error GSM_GetCalendarStatus(GSM_StateMachine * s,
794 				GSM_CalendarStatus * Status);
795 /**
796  * Retrieves calendar entry.
797  *
798  * \param s State machine pointer.
799  * \param Note Storage for note.
800  *
801  * \return Error code
802  *
803  * \ingroup Calendar
804  */
805 GSM_Error GSM_GetCalendar(GSM_StateMachine * s, GSM_CalendarEntry * Note);
806 
807 /**
808  * Retrieves calendar entry. This is useful for continuous reading of all
809  * calendar entries.
810  *
811  * \param s State machine pointer.
812  * \param Note Storage for note, if start is FALSE, should contain
813  * data from previous read (at least position).
814  * \param start Whether we're doing initial read or continue in reading.
815  *
816  * \return Error code
817  *
818  * \ingroup Calendar
819  */
820 GSM_Error GSM_GetNextCalendar(GSM_StateMachine * s, GSM_CalendarEntry * Note,
821 			      gboolean start);
822 /**
823  * Sets calendar entry
824  *
825  * \param s State machine pointer.
826  * \param Note New note values, needs to contain valid position.
827  *
828  * \return Error code
829  *
830  * \ingroup Calendar
831  */
832 GSM_Error GSM_SetCalendar(GSM_StateMachine * s, GSM_CalendarEntry * Note);
833 
834 /**
835  * Adds calendar entry.
836  *
837  * \param s State machine pointer.
838  * \param Note Note to add.
839  *
840  * \return Error code
841  *
842  * \ingroup Calendar
843  */
844 GSM_Error GSM_AddCalendar(GSM_StateMachine * s, GSM_CalendarEntry * Note);
845 
846 /**
847  * Deletes calendar entry.
848  *
849  * \param s State machine pointer.
850  * \param Note Note to delete, must contain position.
851  *
852  * \return Error code
853  *
854  * \ingroup Calendar
855  */
856 GSM_Error GSM_DeleteCalendar(GSM_StateMachine * s, GSM_CalendarEntry * Note);
857 
858 /**
859  * Deletes all calendar entries.
860  *
861  * \param s State machine pointer.
862  *
863  * \return Error code
864  *
865  * \ingroup Calendar
866  */
867 GSM_Error GSM_DeleteAllCalendar(GSM_StateMachine * s);
868 
869 /**
870  * Reads calendar settings.
871  *
872  * \param s State machine pointer.
873  * \param settings Storage for settings.
874  *
875  * \return Error code
876  *
877  * \ingroup Calendar
878  */
879 GSM_Error GSM_GetCalendarSettings(GSM_StateMachine * s,
880 				  GSM_CalendarSettings * settings);
881 /**
882  * Sets calendar settings.
883  *
884  * \param s State machine pointer.
885  * \param settings New calendar settings.
886  *
887  * \return Error code
888  *
889  * \ingroup Calendar
890  */
891 GSM_Error GSM_SetCalendarSettings(GSM_StateMachine * s,
892 				  GSM_CalendarSettings * settings);
893 /**
894  * Retrieves notes status (number of used entries).
895  *
896  * \param s State machine pointer.
897  * \param status Storage for status.
898  *
899  * \return Error code
900  *
901  * \ingroup Note
902  */
903 GSM_Error GSM_GetNotesStatus(GSM_StateMachine * s, GSM_ToDoStatus * status);
904 
905 /**
906  * Retrieves notes entry.
907  *
908  * \param s State machine pointer.
909  * \param Note Storage for note.
910  *
911  * \return Error code
912  *
913  * \ingroup Note
914  */
915 GSM_Error GSM_GetNote(GSM_StateMachine * s, GSM_NoteEntry * Note);
916 
917 /**
918  * Retrieves note entry. This is useful for continuous reading of all
919  * notes entries.
920  *
921  * \param s State machine pointer.
922  * \param Note Storage for note, if start is FALSE, should contain
923  * data from previous read (at least position).
924  * \param start Whether we're doing initial read or continue in reading.
925  *
926  * \return Error code
927  *
928  * \ingroup Note
929  */
930 GSM_Error GSM_GetNextNote(GSM_StateMachine * s, GSM_NoteEntry * Note,
931 			  gboolean start);
932 /**
933  * Sets note entry
934  *
935  * \param s State machine pointer.
936  * \param Note New note values, needs to contain valid position.
937  *
938  * \return Error code
939  *
940  * \ingroup Note
941  */
942 GSM_Error GSM_SetNote(GSM_StateMachine * s, GSM_NoteEntry * Note);
943 
944 /**
945  * Adds note entry.
946  *
947  * \param s State machine pointer.
948  * \param Note Note to add.
949  *
950  * \return Error code
951  *
952  * \ingroup Note
953  */
954 GSM_Error GSM_AddNote(GSM_StateMachine * s, GSM_NoteEntry * Note);
955 
956 /**
957  * Deletes note entry.
958  *
959  * \param s State machine pointer.
960  * \param Note Note to delete, must contain position.
961  *
962  * \return Error code
963  *
964  * \ingroup Note
965  */
966 GSM_Error GSM_DeleteNote(GSM_StateMachine * s, GSM_NoteEntry * Note);
967 
968 /**
969  * Deletes all notes entries.
970  *
971  * \param s State machine pointer.
972  *
973  * \return Error code
974  *
975  * \ingroup Note
976  */
977 GSM_Error GSM_DeleteAllNotes(GSM_StateMachine * s);
978 
979 #ifdef	__cplusplus
980 }
981 #endif
982 #endif
983 
984 /* Editor configuration
985  * vim: noexpandtab sw=8 ts=8 sts=8 tw=72:
986  */
987