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