1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
|
//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/**
* @file FSclCalendarbook.h
* @brief This is the header file for the %Calendarbook class.
*
* This header file contains the declarations of the %Calendarbook class.
*/
#ifndef _FSCL_CALENDARBOOK_H_
#define _FSCL_CALENDARBOOK_H_
#include <FBaseObject.h>
#include <FBaseDataType.h>
#include <FSclTypes.h>
#include <FSclCalEvent.h>
#include <FSclCalTodo.h>
#include <FSclIRecordEventListener.h>
#include <FSclIRecordListener.h>
namespace Tizen { namespace Base
{
class String;
class DateTime;
namespace Collection
{
class IList;
}
}}
namespace Tizen { namespace Locales
{
class TimeZone;
}}
namespace Tizen { namespace Social
{
class ICalendarbookEventListener;
class Calendar;
class CalEventInstance;
class CalendarbookFilter;
/**
* @class Calendarbook
* @brief This class manages calendar data such as events, to-dos, and calendars.
*
* @since 2.0
*
* @final This class is not intended for extension.
*
* The %Calendarbook class manages calendar data such as events, to-dos, and calendars.
* The calendar book is a centralized database that is used by multiple applications to store events and to-do information.
* A calendar book represents the methods to read, add, remove, and update the events, to-do lists, and calendars stored in the device.
* The users must be notified of changes in the calendar book as multiple applications can share, change, or remove the data.
*
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/social/calendarbook_namespace.htm">Calendar book</a>.
*
* The following example demonstrates how to use the %Calendarbook class to add calendarbook event.
* @code
#include <FSocial.h>
#include <FLocales.h>
using namespace Tizen::Social;
using namespace Tizen::Base;
using namespace Tizen::Locales;
void
MyCalendarbook::AddEventExample(void)
{
result r = E_SUCCESS;
DateTime startWallTime;
DateTime endWallTime;
DateTime startUtcTime;
DateTime endUtcTime;
// Suppose a user set 2012/7/17 12:00:00 ~ 2012/7/17 14:00:00 in wall time for start/end time
startWallTime.SetValue(2012, 7, 17, 12, 0, 0);
endWallTime.SetValue(2012, 7, 17, 14, 0, 0);
// Gets the system time zone
LocaleManager localeManager;
localeManager.Construct();
TimeZone timeZone = localeManager.GetSystemTimeZone();
// Converts the wall time to UTC time before set start and end time of the event
startUtcTime = timeZone.WallTimeToUtcTime(startWallTime);
endUtcTime = timeZone.WallTimeToUtcTime(endWallTime);
// Creates a CalEvent instance
CalEvent newEvent;
newEvent.SetSubject(L"Daily event");
newEvent.SetStartAndEndTime(startUtcTime, endUtcTime);
Recurrence dailyRecurrence;
dailyRecurrence.SetFrequency(FREQ_DAILY);
dailyRecurrence.SetCounts(10);
newEvent.SetRecurrence(&dailyRecurrence);
// Creates a Calendarbook instance
Calendarbook* pCalendarbook = new Calendarbook();
r = pCalendarbook->Construct();
if (IsFailed(r))
{
AppLogException("initializing the calendar book has failed");
delete pCalendarbook;
return;
}
// Adds the event
r = pCalendarbook->AddEvent(newEvent);
if (IsFailed(r))
{
AppLogException("AddEvent() has failed");
delete pCalendarbook;
return;
}
delete pCalendarbook;
}
* @endcode
*
* The following example demonstrates how to use the %Calendarbook class to update calendarbook event.
* @code
#include <FSocial.h>
#include <FLocales.h>
using namespace Tizen::Social;
using namespace Tizen::Base;
using namespace Tizen::Locales;
void
MyCalendarbook::UpdateEventExample(void)
{
result r = E_SUCCESS;
// This specificEventId should have been set as already added event record ID.
RecordId specificEventId = 0;
DateTime changedStartWallTime;
DateTime changedEndWallTime;
DateTime changedStartUtcTime;
DateTime changedEndUtcTime;
// Suppose a user set 2012/7/18 12:00:00 ~ 2012/7/18 14:00:00 in wall time for start/end time.
changedStartWallTime.SetValue(2012, 7, 18, 12, 0, 0);
changedEndWallTime.SetValue(2012, 7, 18, 14, 0, 0);
// Gets the system time zone.
LocaleManager localeManager;
localeManager.Construct();
TimeZone timeZone = localeManager.GetSystemTimeZone();
// Converts the wall time to UTC time before set start and end time of the event.
changedStartUtcTime = timeZone.WallTimeToUtcTime(changedStartWallTime);
changedEndUtcTime = timeZone.WallTimeToUtcTime(changedEndWallTime);
// Creates Calendarbook instance.
Calendarbook* pCalendarbook = new Calendarbook();
r = pCalendarbook->Construct();
if (IsFailed(r))
{
AppLogException("initializing the calendar book has failed");
delete pCalendarbook;
return;
}
// Retrieves CalEvent instance.
CalEvent* pEvent = pCalendarbook->GetEventN(specificEventId);
if (pEvent == null)
{
AppLogException("Getting the event has failed");
delete pCalendarbook;
return;
}
Recurrence recurrence(*pEvent->GetRecurrence());
pEvent->SetRecurrence(null);
pEvent->SetStartAndEndTime(changedStartUtcTime, changedEndUtcTime);
pEvent->SetRecurrence(&recurrence);
// Updates the event.
r = pCalendarbook->UpdateEvent(*pEvent);
if (IsFailed(r))
{
AppLogException("UpdateEvent() has failed");
delete pEvent;
delete pCalendarbook;
return;
}
delete pEvent;
delete pCalendarbook;
}
* @endcode
*
* The following example demonstrates how to use the %Calendarbook class to retrieve event instance list.
* @code
#include <FSocial.h>
#include <FLocales.h>
using namespace Tizen::Social;
using namespace Tizen::Base;
using namespace Tizen::Locales;
using namespace Tizen::Base::Collection;
void
MyCalendarbook::RetrieveEventInstanceExample(void)
{
result r = E_SUCCESS;
DateTime startRange;
DateTime endRange;
IList* pEventInstanceList = null;
DateTime startRangeWallTime;
DateTime endRangeWallTime;
DateTime startRangeUtcTime;
DateTime endRangeUtcTime;
// Suppose a user set 2012/7/1 00:00:00 ~ 2012/7/31 23:59:59 in wall time for start/end time.
startRangeWallTime.SetValue(2012, 7, 1, 0, 0, 0);
endRangeWallTime.SetValue(2012, 7, 31, 23, 59, 59);
// Gets the system time zone.
LocaleManager localeManager;
localeManager.Construct();
TimeZone timeZone = localeManager.GetSystemTimeZone();
// Converts the wall time to UTC time before set start and end time of the event.
startRangeUtcTime = timeZone.WallTimeToUtcTime(startRangeWallTime);
endRangeUtcTime = timeZone.WallTimeToUtcTime(endRangeWallTime);
// Creates Calendarbook instance.
Calendarbook* pCalendarbook = new Calendarbook();
r = pCalendarbook->Construct();
if (IsFailed(r))
{
AppLogException("initializing the calendar book has failed");
delete pCalendarbook;
return;
}
// Gets the event instances.
CalendarbookFilter filter(CB_FI_TYPE_NON_ALL_DAY_EVENT_INSTANCE);
filter.AppendDateTime(FI_CONJ_OP_NONE, EVENT_INST_FI_PR_END_TIME, FI_CMP_OP_GREATER_THAN, startRangeUtcTime);
filter.AppendDateTime(FI_CONJ_OP_AND, EVENT_INST_FI_PR_START_TIME, FI_CMP_OP_LESS_THAN, endRangeUtcTime);
pEventInstanceList = pCalendarbook->SearchN(filter, EVENT_INST_FI_PR_START_TIME, SORT_ORDER_ASCENDING);
if (pEventInstanceList == null)
{
AppLogException("SearchN() is failed");
delete pCalendarbook;
return;
}
IEnumerator* pEnum = pEventInstanceList->GetEnumeratorN();
while (pEnum->MoveNext() == E_SUCCESS)
{
CalEventInstance* pEventInstance = static_cast<CalEventInstance*>(pEnum->GetCurrent());
// Reads the properties of pEventInstance.
// ...
}
delete pEnum;
// Removes the first event instance of the list.
CalEventInstance* pExcludingEventInstance = static_cast<CalEventInstance*>(pEventInstanceList->GetAt(0));
r = pCalendarbook->RemoveEventInstance(*pExcludingEventInstance);
if (IsFailed(r))
{
AppLogException("RemoveEventInstance() has failed");
pEventInstanceList->RemoveAll(true);
delete pEventInstanceList;
delete pCalendarbook;
return;
}
pEventInstanceList->RemoveAll(true);
delete pEventInstanceList;
delete pCalendarbook;
}
* @endcode
*/
class _OSP_EXPORT_ Calendarbook
: public Tizen::Base::Object
{
public:
/**
* The object is not fully constructed after this constructor is called. @n
* For full construction, the Construct() method must be called right after calling this constructor.
*
* @since 2.0
*/
Calendarbook(void);
/**
* This destructor overrides Tizen::Base::Object::~Object().
*
* @since 2.0
*/
virtual ~Calendarbook(void);
/**
* @if OSPDEPREC
* Initializes this instance of %Calendarbook with the specified event listener.
*
* @brief <i> [Deprecated] </i>
* @deprecated This method is deprecated. Instead of using this method, it is recommended to use Construct(ICalendarbookEventListener*).
* @since 2.0
*
* @return An error code
* @param[in] pListener The event listener to register, @n
* else @c null if an event listener need not be registered
* @exception E_SUCCESS The method is successful.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @endif
*/
result Construct(IRecordEventListener* pListener);
/**
* Initializes this instance of %Calendarbook.
*
* @since 2.0
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result Construct(void);
/**
* Initializes this instance of %Calendarbook with the specified event listener.
*
* @since 2.0
*
* @return An error code
* @param[in] listener The event listener to register
* @exception E_SUCCESS The method is successful.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result Construct(ICalendarbookEventListener& listener);
/**
* Adds an event of the default calendar to the calendar book. @n
* After adding the event successfully, the event has a valid record ID.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in,out] event The event to add
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c event is invalid.
* @exception E_STORAGE_FULL The storage is insufficient.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result AddEvent(CalEvent& event);
/**
* Adds an event of the specific calendar to the calendar book. @n
* After adding the event successfully, the event has a valid record ID.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in,out] event The event to add
* @param[in] calendarId The calendar ID
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The specified @c event is invalid.
* - The specified @c calendarId is invalid.
* - The specified calendar does not support a to-do item.
* @exception E_OBJ_NOT_FOUND The specified calendar is not found.
* @exception E_STORAGE_FULL The storage is insufficient.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result AddEvent(CalEvent& event, RecordId calendarId);
/**
* Adds a to-do of the default calendar to the calendar book. @n
* After adding the to-do item successfully, the item has a valid record ID.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in,out] todo The to-do to add
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c todo is invalid.
* @exception E_STORAGE_FULL The storage is insufficient.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result AddTodo(CalTodo& todo);
/**
* Adds a to-do of the specific calendar to the calendar book. @n
* After adding the to-do item successfully, the item has a valid record ID.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in,out] todo The to-do to add
* @param[in] calendarId The calendar ID
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The specified @c todo is invalid.
* - The specified @c calendarId is invalid.
* - The specified calendar does not support an event item.
* @exception E_OBJ_NOT_FOUND The specified calendar is not found.
* @exception E_STORAGE_FULL The storage is insufficient.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result AddTodo(CalTodo& todo, RecordId calendarId);
/**
* Removes the specified calendar event from this calendar book. @n
* After removing the event successfully, the event has #INVALID_RECORD_ID.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in] event The calendar event to remove
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified recordId is #INVALID_RECORD_ID.
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_INVALID_OPERATION This method cannot be used for the recurrence exception of the recurring event. @n
* RemoveEventInstance() should be used instead of this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result RemoveEvent(CalEvent& event);
/**
* Removes the specified calendar event from this calendar book.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in] eventId The calendar event ID to remove
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c eventId is #INVALID_RECORD_ID.
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_INVALID_OPERATION This method cannot be used for the recurrence exception of the recurring event. @n
* RemoveEventInstance() should be used instead of this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result RemoveEvent(RecordId eventId);
/**
* Removes the specified CalTodo instance from the calendar book. @n
* After removing the to-do item successfully, the item has #INVALID_RECORD_ID.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in] todo The CalTodo ID to remove
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified recordId is #INVALID_RECORD_ID.
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result RemoveTodo(CalTodo& todo);
/**
* Removes the specified CalTodo instance from the calendar book.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in] todoId The CalTodo ID to remove
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified input parameter is invalid.
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result RemoveTodo(RecordId todoId);
/**
* Updates the specified calendar event to the internal data storage.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in] event The CalEvent instance to update
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The specified recordId is #INVALID_RECORD_ID.
* - The specified @c event is not #RECORD_TYPE_EVENT.
* - The specified @c event is not an entry type instance.
* - The date of the event is invalid. @n
* The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime().
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_INVALID_OPERATION This method cannot be used for the recurrence exception of the recurring event. @n
* UpdateEventInstance() should be used instead of this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result UpdateEvent(const CalEvent& event);
/**
* Updates the specified CalTodo instance on the internal data storage.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in] todo The CalTodo instance to update
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The specified recordId is #INVALID_RECORD_ID.
* - The date of the to-do item is invalid. @n
* The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime().
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result UpdateTodo(const CalTodo& todo);
/**
* Gets the specified event ID that is matched with the RecordId.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The matched event
* @param[in] eventId The event ID to find
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c eventId is invalid.
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
CalEvent* GetEventN(RecordId eventId) const;
/**
* Gets the specified to-do after matching it with the specified record ID.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The matched to-do
* @param[in] todoId The ID of the to-do to find
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c todoId is invalid.
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*
*/
CalTodo* GetTodoN(RecordId todoId) const;
/**
* Gets all the to-do items in the specified time range. @n
* To-do items, whose due date is within the retrieving range, is retrieved.
*
* @if OSPCOMPAT
* @brief <i> [Compatibility] </i>
* @endif
* @since 2.0
* @if OSPCOMPAT
* @compatibility This method has compatibility issues with OSP compatible applications. @n
* For more information, see @ref CompCalendarbookGetTodosNPage "here".
* @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The list of all the matched CalTodo instances, @n
* else an empty list if there is no matched to-do item @n
* The items are sorted by due date.
* @param[in] start The start of the time range. @n Any value with a unit that is less than a second is ignored.
* @param[in] end The end of the time range. @n Any value with a unit that is less than a second is ignored.
* @param[in] pageNo The page number of the result list @n
* It starts from @c 1.
* @param[in] countPerPage The desired maximum count of the result items per page
* @param[in] status The to-do status @n
* If a specific status is set, the to-dos that have the specified status are returned. @n
* The default status value is #TODO_STATUS_ALL, which means all the statuses are returned.
* @param[in] priority The to-do priority @n
* If a specific priority is set, the to-dos that have the specified priority are returned. @n
* The default priority value is #TODO_PRIORITY_ALL that means all the priorities are returned.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The specified @c pageNo or @c countPerPage is less than @c 1.
* - The start time is later than the end date.
* - The start or end time is out of the valid range. @n
* The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime().
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
Tizen::Base::Collection::IList* GetTodosN(const Tizen::Base::DateTime& start, const Tizen::Base::DateTime& end, int pageNo, int countPerPage, unsigned long status = TODO_STATUS_ALL,
unsigned long priority = TODO_PRIORITY_ALL) const;
/**
* @if OSPCOMPAT
* @page CompCalendarbookGetTodosNPage Compatibility for GetTodosN()
* @section CompCalendarbookGetTodosNPageIssueSection Issues
* Implementing this method in OSP compatible applications has the following issues: @n
* -# If the start date of a to-do is not in the time range of the start/end parameters, @n
* the to-do is not retrieved even though the due date is in the time range.
*
* @section CompCalendarbookGetTodosNPageSolutionSection Resolutions
* This issue has been resolved in Tizen. @n
* -# The to-do is retrieved if the due date is in the range of the start/end parameters.
* @endif
*/
/**
* Gets the total number of to-do items in the specified time range. @n
* To-do items, whose due date is within the retrieving range, is counted.
*
* @if OSPCOMPAT
* @brief <i> [Compatibility] </i>
* @endif
* @since 2.0
* @if OSPCOMPAT
* @compatibility This method has compatibility issues with OSP compatible applications. @n
* For more information, see @ref CompCalendarbookGetTodoCountPage "here".
* @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The total number of to-dos, @n
* else @c -1 if an exception occurs
* @param[in] start The start of the time range. @n Any value with a unit that is less than a second is ignored.
* @param[in] end The end of the time range. @n Any value with a unit that is less than a second is ignored.
* @param[in] status The to-do status @n
* If a specific status is set, the to-dos that have the specified status are returned. @n
* The default status value is #TODO_STATUS_ALL, which means all the statuses are returned.
* @param[in] priority The to-do priority @n
* If a specific priority is set, the to-dos that have the specified priority are returned. @n
* The default priority value is #TODO_PRIORITY_ALL that means all the priorities are returned.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The start time is later than the end date.
* - The start or end time is out of the valid range. @n
* The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime().
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
int GetTodoCount(const Tizen::Base::DateTime& start, const Tizen::Base::DateTime& end, unsigned long status = TODO_STATUS_ALL, unsigned long priority = TODO_PRIORITY_ALL) const;
/**
* @if OSPCOMPAT
* @page CompCalendarbookGetTodoCountPage Compatibility for GetTodoCount()
* @section CompCalendarbookGetTodoCountPageIssueSection Issues
* Implementing this method in OSP compatible applications has the following issues: @n
* -# If the start date of a to-do is not in the time range of the start/end parameters, @n
* the to-do is not counted even though the due date is in the time range.
*
* @section CompCalendarbookGetTodoCountPageSolutionSection Resolutions
* This issue has been resolved in Tizen. @n
* -# The to-do is counted if the due date is in the range of the start/end parameters.
* @endif
*/
/**
* @if OSPDEPREC
* Gets the CalEvent instances that are within the specified time range. @n
* The all day events are retrieved by their start and end dates in the local time zone, while all other events are retrieved by their
* start and end times in Coordinated Universal Time (UTC).
*
* @brief <i> [Deprecated] </i>
* @deprecated This method is deprecated. Instead of using this method, it is recommended to use GetInstancesOfAllDayEventsN() or GetInstancesOfNonAllDayEventsN().
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The list that contains all of the matched CalEvent instances, @n
* else an empty list if there are no matched instances, or @c null if an exception occurs @n
* The results are listed in the following order: all day events, and other events. @n
* The results with the same property of all day event are ordered by their start time.
* @param[in] start The start of the time range. @n Any value with a unit that is less than a second is ignored.
* @param[in] end The end of the time range. @n Any value with a unit that is less than a second is ignored.
* @param[in] timeZone The time zone of the specified start and end times
* @param[in] pageNo The page number of the result list @n
* It starts from @c 1.
* @param[in] countPerPage The desired maximum count of the result items per page
* @param[in] category The event category @n
* If a specific category is set, the events that have the specified category are returned. @n
* The default category value is #EVENT_CATEGORY_ALL, which means all the categories are returned.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The specified @c pageNo or @c countPerPage is less than @c 1.
* - The specified @c category is invalid.
* - The start time is later than the end date.
* - The start or end time is out of the valid range. @n
* The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime().
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @endif
*/
Tizen::Base::Collection::IList* GetEventInstancesN(const Tizen::Base::DateTime& start, const Tizen::Base::DateTime& end,
const Tizen::Locales::TimeZone& timeZone, int pageNo, int countPerPage,
unsigned long category = EVENT_CATEGORY_ALL) const;
/**
* @if OSPDEPREC
* Gets the CalEvent instances that are within the specified time range. @n
* The all day events are retrieved by their start and end dates in the local time zone, while all other events are retrieved by their
* start and end times in Coordinated Universal Time (UTC).
*
* Although GetEventInstancesN() retrieves the data synchronously, this method returns data asynchronously using
* RecordListener::OnEventInstancesReceivedN(). @n
* It is highly recommended to use the asynchronous method because getting the event instances may take a long time.
*
* @brief <i> [Deprecated] </i>
* @deprecated This method is deprecated. Instead of using this method, it is recommended to use GetInstancesOfAllDayEventsN() or GetInstancesOfNonAllDayEventsN().
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return An error code
* @param[in] start The start of the time range. @n Any value with a unit that is less than a second is ignored.
* @param[in] end The end of the time range. @n Any value with a unit that is less than a second is ignored.
* @param[in] timeZone The time zone of the specified start and end times
* @param[in] pageNo The page number of the result list @n
* It starts from @c 1.
* @param[in] countPerPage The desired maximum count of the result items per page
* @param[in] category The event category @n
* If a specific category is set, the events that have the specified @c category are returned. @n
* The default category value is #EVENT_CATEGORY_ALL, which means all the categories are returned.
* @param[out] reqId The ID of the request
* @param[in] listener The listener for receiving the responses of the request
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The specified @c pageNo or @c countPerPage is less than @c 1.
* - The specified @c category is invalid.
* - The start time is later than the end date.
* - The start or end time is out of the valid range. @n
* The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime().
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks IRecordListener::OnRecordsReceivedN(), Calendarbook::GetEventInstancesN()
* @endif
*/
result GetEventInstances(const Tizen::Base::DateTime& start, const Tizen::Base::DateTime& end,
const Tizen::Locales::TimeZone& timeZone, int pageNo, int countPerPage, unsigned long category,
RequestId& reqId,
const IRecordListener& listener) const;
/**
* Gets all the events.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The list that contains all the CalEvent instances, @n
* else an empty list if there are no events, or @c null if an exception occurs @n
* The results are listed in the order of their event ID.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks
* - The specific error code can be accessed using the GetLastResult() method.
* - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is
* @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer
* <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
*/
Tizen::Base::Collection::IList* GetAllEventsN(void) const;
/**
* Gets all the to-dos.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The list that contains all the CalTodo instances, @n
* else an empty list if there are no to-dos, or @c null if an exception occurs @n
* The results are listed in the order of their to-do ID.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks
* - The specific error code can be accessed using the GetLastResult() method.
* - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is
* @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer
* <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
*/
Tizen::Base::Collection::IList* GetAllTodosN(void) const;
/**
* Gets all the calendars.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The list that contains all the Calendar instances, @n
* else an empty list if there are no calendars, or @c null if an exception occurs @n
* The results are listed in the order of their calendar ID.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks
* - The specific error code can be accessed using the GetLastResult() method.
* - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is
* @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer
* <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
*/
Tizen::Base::Collection::IList* GetAllCalendarsN(void) const;
/**
* Gets information of all the changed events since the version.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The list that contains the CalEventChangeInfo instances, @n
* else an empty list if there are no events, or @c null if an exception occurs @n
* The results are listed in the order of their version.
* @param[in] version The version
* @param[out] latestVersion The latest change version among the changed events
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c version is invalid.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks
* - The specific error code can be accessed using the GetLastResult() method.
* - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is
* @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer
* <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
*/
Tizen::Base::Collection::IList* GetChangedEventsAfterN(int version, int& latestVersion) const;
/**
* Gets information of all the changed to-dos since the version.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return A list containing the CalTodoChangeInfo instances, @n
* else an empty list if there are no to-dos, or @c null if an exception occurs @n
* The results are listed in the order of their version.
* @param[in] version The version
* @param[out] latestVersion The latest change version among the changed to-dos
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c version is invalid.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks
* - The specific error code can be accessed using the GetLastResult() method.
* - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is
* @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer
* <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
*/
Tizen::Base::Collection::IList* GetChangedTodosAfterN(int version, int& latestVersion) const;
/**
* Adds a calendar. @n
* After adding the calendar to the database successfully, the calendar has a valid calendar ID.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in,out] calendar The calendar to add
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The calendar's recordId is not #INVALID_RECORD_ID.
* @exception E_STORAGE_FULL The storage is insufficient.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result AddCalendar(Calendar& calendar);
/**
* Adds a calendar that is associated with the specified account. @n
* After adding the calendar to the database successfully, the calendar has a valid calendar ID.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in,out] calendar The calendar to add
* @param[in] accountId The account Id
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The calendar's recordId is not #INVALID_RECORD_ID.
* - The specified @c accountId is invalid.
* @exception E_OBJ_NOT_FOUND The specified account is not found.
* @exception E_STORAGE_FULL The storage is insufficient.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result AddCalendar(Calendar& calendar, AccountId accountId);
/**
* Removes the specified calendar.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in] calendarId The calendar ID to remove
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The specified @c calendarId is invalid.
* - The calendar represents default calendar.
* @exception E_OBJ_NOT_FOUND The specified calendar is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result RemoveCalendar(RecordId calendarId);
/**
* Updates the specified calendar.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in] calendar The Calendar instance to update
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The calendar's recordId is #INVALID_RECORD_ID.
* - The calendar represents default calendar.
* @exception E_OBJ_NOT_FOUND The specified calendar is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
result UpdateCalendar(const Calendar& calendar);
/**
* Gets the calendar with the specified calendar ID.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The matched calendar, @n
* else @c null if an exception occurs
* @param[in] calendarId The calendar ID
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c calendarId is invalid.
* @exception E_OBJ_NOT_FOUND The specified calendar is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
Calendar* GetCalendarN(RecordId calendarId) const;
/**
* Removes an instance of the recurring event. @n
* If the event instance has been removed successfully, its start date is added as an exception date to the recurrence of its original event.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in] eventInstance The event instance to remove @n
* The @c eventInstance must be an instance of the recurring event.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The instance is invalid.
* @exception E_OBJ_NOT_FOUND The original event of the specified @c eventInstance is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The instance's start time is added to the recurrence of original event as exception date.
*/
result RemoveEventInstance(const CalEventInstance& eventInstance);
/**
* Update the specified recurring event instance(@ref CalEventInstance). This method can be used for defining exception of the recurring event. @n
* In order to update an event instance, you should use copy of its original event(@ref CalEventInstance::GetOriginalEventId()). @n
* You can modify the properties of copy of the original event and use it as the second parameter of this method. @n
* (The start/end time of the original event should be set with the start/end time of the event instance.) @n
* This method adds the modified copy of the original event as a new event. Therefore the new event ID will be assigned to it through event's record ID @n
* and its existing event ID inside the modified copy of the original event will become the base event ID of the new event. @n
* However this method only updates the properties of the event, does not add a new event that is already added.
*
* @since 2.1
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.write
*
* @return An error code
* @param[in] eventInstance The event instance to update @n
* The @c eventInstance must be an instance of the recurring event.
* @param[in,out] event The modified copy of the original event @n
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method.
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The instance is invalid.
* - The specified @c event is not referring to the original event.
* @exception E_OBJ_NOT_FOUND The original event of the specified @c eventInstance is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*
* @code
void UpdateRecurringEventInstance(const CalEventInstance& eventInstance)
{
CalEvent* pEvent = pCalendarbook->GetEventN(eventInstance.GetOriginalEventId());
if (pEvent == null)
{
AppLogException("GetEventN() has failed");
return;
}
// Sets the start time and end time
pEvent->SetRecurrence(null);
pEvent->SetStartAndEndTime(eventInstance.GetStartTime(), eventInstance.GetEndTime());
// Modifies the properties
pEvent->SetLocation(L"Meeting room on 11th floor");
// Updates the instance
result r = pCalendarbook->UpdateEventInstance(eventInstance, *pEvent);
if (IsFailed(r))
{
AppLogException("UpdateEventInstance() has failed");
delete pEvent;
return;
}
delete pEvent;
}
* @endcode
*/
result UpdateEventInstance(const CalEventInstance& eventInstance, CalEvent& event);
/**
* Gets the latest version of calendarbook.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The latest version
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
int GetLatestVersion(void) const;
/**
* Searches items of the calendarbook with the filter. @n
* The filter specifies the item type and condition for searching.
* The searched results are ordered by the @c propertySortedBy and @c sortOrder.
* If the @c offset is M and the @c maxCount are N, then the first M items are omitted from the result set returned by the searching operation and the next N items are returned.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The list of searched results (the list of CalEvent, CalTodo, Calendar, or CalEventInstance), @n
* else an empty list if there is no searched result, or @c null if an exception occurs
* @param[in] filter The filter that specifies the search condition @n If the filter is empty, all items that are specified by the type of this filter are searched.
* @param[in] propertySortedBy The property for sorting @n The searched results are ordered by the values of this property.
* @param[in] sortOrder The order for sorting
* @param[in] offset The offset of the searched results @n If this value is @c 0, it is ignored.
* @param[in] maxCount The maximum count of the searched results @n If this value is @c 0, it is ignored.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The specified @c offset or @c maxCount is less than 0.
* - The specified @c propertySortedBy is not an element of the enumerator that corresponds to the type of the specified @c filter.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks
* - The specific error code can be accessed using the GetLastResult() method.
* - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is
* @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer
* <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
* @see EventFilterProperty
* @see TodoFilterProperty
* @see CalendarFilterProperty
* @see EventInstanceFilterProperty
*/
Tizen::Base::Collection::IList* SearchN(const CalendarbookFilter& filter, unsigned long propertySortedBy = 0, Tizen::Base::SortOrder sortOrder = Tizen::Base::SORT_ORDER_NONE,
int offset = 0, int maxCount = 0) const;
/**
* Gets the matched item count of the search results with the filter. @n
* The filter specifies the item type and condition for searching.
*
* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/calendar.read
*
* @return The count of the searched results
* @param[in] filter The filter that specifies the search condition @n If the filter is empty, all items that are specified by the type of this filter will be searched.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
int GetMatchedItemCount(const CalendarbookFilter& filter) const;
/**
* Parses the events from specific vCalendar file. @n
* The %ParseEventsFromVcalendarN() method supports to parse for vCalendar version 1.0 and 2.0 (iCalendar).
*
* @since 2.0
*
* @return The list that contains the CalEvent instances, @n
* else an empty list if there are no events, or @c null if an exception occurs
* @param[in] vCalFilePath The path of the vCalendar file
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c vCalFilePath is invalid.
* @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission.
* @exception E_FILE_NOT_FOUND The specified vCalendar file is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks
* - The specific error code can be accessed using the GetLastResult() method.
* - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is
* @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer
* <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
*/
static Tizen::Base::Collection::IList* ParseEventsFromVcalendarN(const Tizen::Base::String& vCalFilePath);
/**
* Parses the to-dos from specific vCalendar file. @n
* The %ParseTodosFromVcalendarN() method supports to parse for vCalendar version 1.0 and 2.0 (iCalendar).
*
* @since 2.0
*
* @return The list that contains the CalTodo instances, @n
* else an empty list if there are no to-dos, or @c null if an exception occurs
* @param[in] vCalFilePath The path of the vCalendar file
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c vCalFilePath is invalid.
* @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission.
* @exception E_FILE_NOT_FOUND The specified vCalendar file is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks
* - The specific error code can be accessed using the GetLastResult() method.
* - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is
* @c E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer
* <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
*/
static Tizen::Base::Collection::IList* ParseTodosFromVcalendarN(const Tizen::Base::String& vCalFilePath);
/**
* Exports the events to vCalendar 2.0 (iCalendar) file.
*
* @since 2.0
*
* @return An error code
* @param[in] eventList The event list to export @n The list should contain CalEvent instances.
* @param[in] vCalFilePath The vCalendar file path
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The specified @c eventList is invalid.
* - The specified @c vCalFilePath is invalid.
* @exception E_ILLEGAL_ACCESS The access of the specified @c vCalFilePath is denied due to insufficient permission.
* @exception E_FILE_ALREADY_EXIST The vCalendar file already exists.
* @exception E_STORAGE_FULL The disk space is full.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
static result ExportEventsToVcalendar(const Tizen::Base::Collection::IList& eventList, const Tizen::Base::String& vCalFilePath);
/**
* Exports the to-dos to vCalendar 2.0 (iCalendar) file.
*
* @since 2.0
*
* @return An error code
* @param[in] todoList The to-do list to export @n The list should contain CalTodo instances.
* @param[in] vCalFilePath The vCalendar file path
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG Either of the following conditions has occurred:
* - The specified @c todoList is invalid.
* - The specified @c vCalFilePath is invalid.
* @exception E_ILLEGAL_ACCESS The access of the specified @c vCalFilePath is denied due to insufficient permission.
* @exception E_FILE_ALREADY_EXIST The vCalendar file already exists.
* @exception E_STORAGE_FULL The disk space is full.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
*/
static result ExportTodosToVcalendar(const Tizen::Base::Collection::IList& todoList, const Tizen::Base::String& vCalFilePath);
/**
* Gets the maximum allowable date and time in the calendarbook (that is, "December 31 2100 23:59:59").
*
* @since 2.0
*
* @return An instance of Tizen::Base::DateTime
*/
static Tizen::Base::DateTime GetMaxDateTime(void);
/**
* Gets the minimum allowable date and time in the calendarbook (that is, "January 1 1900 00:00:00").
*
* @since 2.0
*
* @return An instance of Tizen::Base::DateTime
*/
static Tizen::Base::DateTime GetMinDateTime(void);
private:
/**
* The implementation of this copy constructor is intentionally blank and declared as private @n
* to prohibit copying of objects.
*
* @since 2.0
*/
Calendarbook(const Calendarbook& rhs);
/**
* The implementation of this copy assignment operator is intentionally blank and declared as private @n
* to prohibit copying of objects.
*
* @since 2.0
*/
Calendarbook& operator =(const Calendarbook& rhs);
private:
friend class _CalendarbookImpl;
class _CalendarbookImpl* __pCalendarbookImpl;
}; // Calendarbook
}} // Tizen::Social
#endif // _FSCL_CALENDARBOOK_H_
|