Tizen 2.1 base
[framework/osp/social.git] / inc / FSclCalEvent.h
1 // 
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd. 
4 // 
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file        FSclCalEvent.h
19  * @brief       This is the header file for the %CalEvent class.
20  *
21  * This header file contains the declarations of the %CalEvent class.
22  */
23 #ifndef _FSCL_CAL_EVENT_H_
24 #define _FSCL_CAL_EVENT_H_
25
26 #include <FBaseDataType.h>
27 #include <FBaseColIList.h>
28 #include <FBaseString.h>
29 #include <FBaseByteBuffer.h>
30 #include <FBaseDateTime.h>
31 #include <FLclCalendar.h>
32 #include <FSclTypes.h>
33 #include <FSclRecord.h>
34 #include <FSclRecurrence.h>
35 #include <FSclReminder.h>
36 #include <FSclAttendee.h>
37
38 namespace Tizen { namespace Locales
39 {
40 class TimeZone;
41 }}
42
43 namespace Tizen { namespace Social
44 {
45
46 /**
47  *      @class  CalEvent
48  *      @brief  This class provides methods to manage the information of a calendar book event.
49  *
50  * @since       2.0
51  *
52  *      @final  This class is not intended for extension.
53  *
54  *      The %CalEvent class describes an occasion planned in a particular situation. @n
55  *      An event is a subset of vEvent. A %CalEvent instance includes the category, subject, description, start time, end time, location, and sensitivity.
56  *      %CalEvent also includes the recurring and reminder data. For more information, see the Recurrence, and Reminder classes.
57  *
58  *      For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/social/calevent.htm">Calendar Events</a>.
59  *
60  *      The following example demonstrates how to use the %CalEvent class.
61
62  *      @code
63  *
64         #include <FSocial.h>
65         #include <FLocales.h>
66
67         using namespace Tizen::Base;
68         using namespace Tizen::Social;
69         using namespace Tizen::Locales;
70
71         void
72         CreateCalEventWithTimeZone(void)
73         {
74                 DateTime startWallTime;
75                 DateTime endWallTime;
76                 DateTime startUtcTime;
77                 DateTime endUtcTime;
78
79                 // Suppose a user set 2010/2/17 12:00:00 ~ 2010/2/17 14:00:00 in wall time for start/end time
80                 startWallTime.SetValue(2010, 2, 17, 12, 0, 0);
81                 endWallTime.SetValue(2010, 2, 17, 14, 0, 0);
82
83                 // Gets the system time zone
84                 LocaleManager localeManager;
85                 localeManager.Construct();
86
87                 TimeZone timeZone = localeManager.GetSystemTimeZone();
88
89                 // Converts the wall time to UTC time before set start and end time of the event
90                 startUtcTime = timeZone.WallTimeToUtcTime(startWallTime);
91                 endUtcTime = timeZone.WallTimeToUtcTime(endWallTime);
92
93                 // Creates an event
94                 CalEvent event;
95
96                 // Sets the values
97                 event.SetTimeZone(timeZone);
98                 event.SetStartAndEndTime(startUtcTime, endUtcTime);
99         }
100  *
101  * @endcode
102  *
103  */
104 class _OSP_EXPORT_ CalEvent
105         : public Record
106 {
107
108 public:
109         /**
110          * This is the default constructor for this class.
111          *
112          * @since       2.0
113          */
114         CalEvent(void);
115
116         /**
117          * Copying of objects using this copy constructor is allowed.
118          *
119          * @since       2.0
120          *
121          * @param[in]   rhs             An instance of %CalEvent
122          */
123         CalEvent(const CalEvent& rhs);
124
125         /**
126          * This destructor overrides Tizen::Social::Record::~Record().
127          *
128          * @since       2.0
129          */
130         virtual ~CalEvent(void);
131
132         /**
133          * Compares the input Tizen::Base::Object with the calling %CalEvent instance.
134          *
135          * @since       2.0
136          *
137          * @return              @c true if the input object equals the calling %CalEvent instance, @n
138                                         else @c false
139          * @param[in]   rhs     The object instance to compare with the calling object
140          * @see                 GetHashCode()
141          */
142         virtual bool Equals(const Tizen::Base::Object& rhs) const;
143
144         /**
145          * Gets the hash value of the current instance.
146          *
147          * @since       2.0
148          *
149          * @return              The hash value of the current instance
150          */
151         virtual int GetHashCode(void) const;
152
153         /**
154          * @if OSPDEPREC
155          * Checks whether this instance is a %CalEvent instance. @n
156          * A one-time calendar event has only one instance and a recurring calendar event has more than one instance. @n
157          * Each instance of %CalEvent has its own recurrence ID.
158          *
159          * @brief <i> [Deprecated] </i>
160          * @deprecated  This method is deprecated because %CalEvent class is not used for event instance any more. @n
161          * Instead of using the %CalEvent class, it is recommended to use the CalEventInstance class for event instance.
162          * @since       2.0
163          *
164          * @return              @c true if this instance is a %CalEvent instance, @n
165          *                              else @c false
166          * @endif
167          */
168         bool IsInstance(void) const;
169
170         /**
171          * @if OSPDEPREC
172          * Checks whether the calendar event has a recurring pattern.
173          *
174          * @brief <i> [Deprecated] </i>
175          * @deprecated  This method is deprecated because %CalEvent class is not used for event instance any more. @n
176          * Instead of using the %CalEvent class, it is recommended to use the CalEventInstance class for event instance.
177          * @since       2.0
178          *
179          * @return              @c true if the calendar event has a recurring pattern, @n
180          *                              else @c false
181          * @endif
182          */
183         bool IsRecurring(void) const;
184
185         /**
186          * @if OSPDEPREC
187          * Gets the original calendar event ID. @n
188          * The %CalEvent instance has an original @c CalEventId, that is a record ID of its entry.
189          *
190          * @brief <i> [Deprecated] </i>
191          * @deprecated  This method is deprecated because %CalEvent class is not used for event instance any more. @n
192          * Instead of using the %CalEvent class, it is recommended to use the CalEventInstance class for event instance.
193          * @since       2.0
194          *
195          * @return      The original calendar event ID, @n
196          *                      else #INVALID_RECORD_ID if the record ID is invalid
197          * @endif
198          */
199         RecordId GetOriginalCalEventId(void) const;
200
201         /**
202          * Checks whether the calendar event is an all day event.
203          *
204          * @since       2.0
205          *
206          * @return              @c true if calendar event is an all day event, @n
207          *                              else @c false
208          */
209         bool IsAllDayEvent(void) const;
210
211         /**
212          * Sets the calendar event as an all day event.
213          *
214          * @since       2.0
215          *
216          * @param[in]   isAllDayEvent   Set to @c true to make the calendar event an all day event, @n
217          *                                                              else @c false
218          */
219         void SetAllDayEvent(bool isAllDayEvent);
220
221         /**
222          * @if OSPDEPREC
223          * Gets the globally unique ID. @n
224          * UID: globally Unique Identifier (vCalendar 1.0)
225          *
226          * @brief <i> [Deprecated] </i>
227          * @deprecated  This method is deprecated because string value can’t be handled. @n
228          * Instead of using this method, it is recommended to use GetUid().
229          * @since       2.0
230          *
231          * @return              The globally unique ID
232          * @exception   E_SUCCESS                               The method is successful.
233          * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
234          * @remarks             The specific error code can be accessed using the GetLastResult() method.
235          * @endif
236          */
237         Tizen::Base::ByteBuffer* GetUIDN(void) const;
238
239         /**
240          * @if OSPDEPREC
241          * Sets the globally unique ID. @n
242          * UID: globally Unique Identifier (vCalendar 1.0)
243          *
244          * @brief <i> [Deprecated] </i>
245          * @deprecated  This method is deprecated because string value can’t be handled. @n
246          * Instead of using this method, it is recommended to use SetUid().
247          * @since       2.0
248          *
249          * @return              An error code
250          * @param[in]   pUid                                    The globally unique ID
251          * @exception   E_SUCCESS                               The method is successful.
252          * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
253          * @endif
254          */
255         result SetUID(const Tizen::Base::ByteBuffer* pUid);
256
257         /**
258          * Gets the globally unique ID. @n
259          * UID: globally Unique Identifier (vCalendar 1.0)
260          *
261          * @since       2.0
262          *
263          * @return              The globally unique ID
264          */
265         Tizen::Base::String GetUid(void) const;
266
267         /**
268          * Sets the globally unique ID. @n
269          * UID: globally Unique Identifier (vCalendar 1.0)
270          *
271          * @since       2.0
272          *
273          * @param[in]   uid                                     The globally unique ID
274          */
275         void SetUid(const Tizen::Base::String& uid);
276
277         /**
278          * Gets the calendar event status. @n
279          * The default status is #EVENT_STATUS_NONE.
280          *
281          * @since       2.0
282          *
283          * @return              The calendar event status
284          * @see                 EventStatus
285          */
286         EventStatus GetStatus(void) const;
287
288         /**
289          * Sets the calendar event status.
290          *
291          * @since       2.0
292          *
293          * @param[in]   status          The status
294          * @see                 EventStatus
295          */
296         void SetStatus(EventStatus status);
297
298         /**
299          * Gets the busy status. @n
300          * The default busy status is #BUSY_STATUS_BUSY.
301          *
302          * @since       2.0
303          *
304          * @return              The busy status
305          * @see                 BusyStatus
306          */
307         BusyStatus GetBusyStatus(void) const;
308
309         /**
310          * Sets the busy status.
311          *
312          * @since       2.0
313          *
314          * @param[in]   busyStatus              The busy status
315          * @see                 BusyStatus
316          */
317         void SetBusyStatus(BusyStatus busyStatus);
318
319         /**
320          * Gets the priority level of the calendar event. @n
321          * The default priority level is #EVENT_PRIORITY_LOW.
322          *
323          * @since       2.0
324          *
325          * @return              The priority level
326          *
327          */
328         EventPriority GetPriority(void) const;
329
330         /**
331          * Sets the priority level of the calendar event.
332          *
333          * @since       2.0
334          *
335          * @param[in]   priority        The priority level to set
336          *
337          */
338         void SetPriority(EventPriority priority);
339
340         /**
341          * Adds an attendee.
342          *
343          * @since       2.0
344          *
345          * @return              An error code
346          * @param[in]   attendee                        The attendee to add @n
347          *                                                                      The specified @c attendee must have an email address.
348          * @exception   E_SUCCESS                       The method is successful.
349          * @exception   E_OBJ_ALREADY_EXIST     An attendee with the same email address already exists.
350          * @remarks             The attendee values may be lost if an anniversary event including the attendee is modified in the base application.
351          */
352         result AddAttendee(const Attendee& attendee);
353
354         /**
355          * Removes an attendee.
356          *
357          * @since       2.0
358          *
359          * @return              An error code
360          * @param[in]   attendee                        The attendee to remove @n
361          *                                                                      The specified @c attendee must have an email address.
362          * @exception   E_SUCCESS                       The method is successful.
363          * @exception   E_OBJ_NOT_FOUND         An attendee that has the same email address is not found.
364          */
365         result RemoveAttendee(const Attendee& attendee);
366
367         /**
368          * Gets a list of all the attendees.
369          *
370          * @since       2.0
371          *
372          * @return              A list of the attendees
373          * @remarks             The specific error code can be accessed using the GetLastResult() method.
374          * @see                 Attendee
375          */
376         Tizen::Base::Collection::IList* GetAllAttendeesN(void) const;
377
378         /**
379          * Gets the time zone.
380          *
381          * @since       2.0
382          *
383          * @return              The time zone
384          * @see                 Tizen::Locales::TimeZone
385          */
386         Tizen::Locales::TimeZone GetTimeZone(void) const;
387
388         /**
389          * Sets the time zone. @n
390          * Recurrence is calculated based on the time zone, thus the time zone must be set before setting a recurrence.
391          * If the time zone is not set, it will be considered as Greenwich Mean Time (GMT) 0.
392          *
393          * @since       2.0
394          *
395          * @return              An error code
396          * @param[in]   timeZone                        The time zone to set
397          * @exception   E_SUCCESS                       The method is successful.
398          * @exception   E_FAILURE                       The method has failed.
399          * @remarks             As anniversaries and all day events are not affected by a time zone, it is recommended not to set the time zone.
400          * @see                 Tizen::Locales::TimeZone
401          */
402         result SetTimeZone(const Tizen::Locales::TimeZone& timeZone);
403
404         /**
405          * @if OSPDEPREC
406          * Gets the recurrence ID. @n
407          * This method works only for the %CalEvent instances.
408          *
409          * @brief <i> [Deprecated] </i>
410          * @deprecated  This method is deprecated because %CalEvent class is not used for event instance any more. @n
411          * Instead of using the %CalEvent class, it is recommended to use the CalEventInstance class for event instance.
412          * @since       2.0
413          *
414          * @return              The recurrence ID
415          * @exception   E_SUCCESS                               The method is successful.
416          * @exception   E_INVALID_STATE                 The instance is a %CalEvent instance that does not have a recurrence ID.
417          * @remarks             The specific error code can be accessed using the GetLastResult() method.
418          * @endif
419          */
420         RecurrenceId GetRecurrenceId(void) const;
421
422         /**
423          * Gets the subject of the calendar event.
424          *
425          * @since       2.0
426          *
427          * @return              The subject, @n
428          *                              else @c null if there is no subject value
429          */
430         Tizen::Base::String GetSubject(void) const;
431
432         /**
433          * Gets the description of the calendar event.
434          *
435          * @since       2.0
436          *
437          * @return              The description
438          */
439         Tizen::Base::String GetDescription(void) const;
440
441         /**
442          * Gets the start date and time of the calendar event.
443          *
444          * @since       2.0
445          *
446          * @return              An instance of Tizen::Base::DateTime representing the start date and time
447          */
448         Tizen::Base::DateTime GetStartTime(void) const;
449
450         /**
451          * Gets the end date and time of the calendar event.
452          *
453          * @since       2.0
454          *
455          * @return              An instance of Tizen::Base::DateTime representing the end date and time
456          */
457         Tizen::Base::DateTime GetEndTime(void) const;
458
459         /**
460          * Gets the location of the calendar event.
461          *
462          * @since       2.0
463          *
464          * @return              The location
465          */
466         Tizen::Base::String GetLocation(void) const;
467
468         /**
469          * @if OSPDEPREC
470          * Gets the category of the calendar event.
471          *
472          * @brief <i> [Deprecated] </i>
473          * @deprecated  This method is deprecated because the category of event is not used any more.
474          * @since       2.0
475          *
476          * @return              The category of the calendar event
477          * @endif
478          */
479         EventCategory GetCategory(void) const;
480
481         /**
482          * Gets the sensitivity of the calendar event. @n
483          * The default value is #SENSITIVITY_PUBLIC.
484          *
485          * @since       2.0
486          *
487          * @return              The sensitivity of the calendar event
488          */
489         RecordSensitivity GetSensitivity(void) const;
490
491
492         /**
493          * @if OSPDEPREC
494          * Gets the reminder for the calendar event.
495          *
496          * @brief <i> [Deprecated] </i>
497          * @deprecated          This method is deprecated. Instead of using this method, it is recommended to use GetAllReminders().
498          * @since       2.0
499          *
500          * @return              A pointer to an instance of Reminder, @n
501          *                              else @c null if the reminder is not set
502          * @endif
503          */
504         const Reminder* GetReminder(void) const;
505
506         /**
507          * Gets the recurrence of the calendar event.
508          *
509          * @since       2.0
510          *
511          * @return              A pointer to an instance of Recurrence, @n
512          *                              else @c null if the event is not a recurring event
513          */
514         const Recurrence* GetRecurrence(void) const;
515
516         /**
517          * Gets the last updated date and time of the calendar event.
518          *
519          * @since       2.0
520          *
521          * @return              The last updated date and time
522          */
523         Tizen::Base::DateTime GetLastRevisedTime(void) const;
524
525         /**
526          * Sets the subject of the calendar event.
527          *
528          * @if OSPCOMPAT
529          * @brief <i> [Compatibility] </i>
530          * @endif
531          * @since       2.0
532          * @if OSPCOMPAT
533          * @compatibility       This method has compatibility issues with OSP compatible applications. @n
534          *                                      For more information, see @ref CompCalEventSetSubjectPage "here".
535          * @endif
536          *
537          * @return              An error code
538          * @param[in]   subject                         The subject of the calendar event
539          * @exception   E_SUCCESS                       The method is successful.
540          */
541         result SetSubject(const Tizen::Base::String& subject);
542
543         /**
544          * @if OSPCOMPAT
545          * @page        CompCalEventSetSubjectPage Compatibility for SetSubject()
546          * @section     CompCalEventSetSubjectPageIssueSection Issues
547          *          Implementing this method in OSP compatible applications has the following issues:   @n
548          *                      -# If the length of the subject to be set is greater than 100 characters, E_INVALID_ARG is returned.
549          *
550          * @section     CompCalEventSetSubjectPageSolutionSection Resolutions
551          *                      This issue has been resolved in Tizen.  @n
552          *                      -# There is no limit for the length of the subject.
553          * @endif
554          */
555
556         /**
557          * Sets the description of the current calendar event.
558          *
559          * @if OSPCOMPAT
560          * @brief <i> [Compatibility] </i>
561          * @endif
562          * @since       2.0
563          * @if OSPCOMPAT
564          * @compatibility       This method has compatibility issues with OSP compatible applications. @n
565          *                                      For more information, see @ref CompCalEventSetDescriptionPage "here".
566          * @endif
567          *
568          * @return              An error code
569          * @param[in]   description                     The description of the event
570          * @exception   E_SUCCESS                       The method is successful.
571          */
572         result SetDescription(const Tizen::Base::String& description);
573
574         /**
575          * @if OSPCOMPAT
576          * @page        CompCalEventSetDescriptionPage Compatibility for SetDescription()
577          * @section     CompCalEventSetDescriptionPageIssueSection Issues
578          *          Implementing this method in OSP compatible applications has the following issues:   @n
579          *                      -# If the length of the description to be set is greater than 1000 characters, E_INVALID_ARG is returned.
580          *
581          * @section     CompCalEventSetDescriptionPageSolutionSection Resolutions
582          *                      This issue has been resolved in Tizen.  @n
583          *                      -# There is no limit for the length of the description.
584          * @endif
585          */
586
587         /**
588          * Sets the start and end date and time of the calendar event. @n
589          * If the start date and time is not fixed, the default date and time are set. @n
590          * The default start date and time is the current date and time. @n
591          * The start date and time must be earlier than or equal to the end date and time. @n
592          * If the recurrence date is already set, this method returns an exception.
593          *
594          * @since       2.0
595          *
596          * @return              An error code
597          * @param[in]   startDateTime                           The start date and time
598          * @param[in]   endDateTime                                     The end date and time
599          * @exception   E_SUCCESS                       The method is successful.
600          * @exception   E_INVALID_ARG                   Either of the following conditions has occurred: @n
601          *                                                                              - The specified @c endDateTime value is earlier than the specified @c startDateTime value.
602          *                                                                              - The @c startDateTime or @c endDateTime is not in a valid range. @n
603          *                                                                              The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime().
604          * @exception   E_INVALID_CONDITION     The recurrence date is already set.
605          * @remarks             The start and end time of all day events created from the base applications is the local time of the location where
606          *                              they are added.
607          *                              All the other events are Coordinated Universal Time (UTC).
608          *                              In order to integrate it with the base applications, set the start and end time properly according to the above guidelines.
609          *                              If the seconds value of the start time is set, the alarm will not be fired.
610          *                              There is no automatic time conversion based on the time zone property of the calendar event.
611          */
612         result SetStartAndEndTime(const Tizen::Base::DateTime& startDateTime, const Tizen::Base::DateTime& endDateTime);
613
614         /**
615          * Sets the location of the current calendar event.
616          *
617          * @if OSPCOMPAT
618          * @brief <i> [Compatibility] </i>
619          * @endif
620          * @since       2.0
621          * @if OSPCOMPAT
622          * @compatibility       This method has compatibility issues with OSP compatible applications. @n
623          *                                      For more information, see @ref CompCalEventSetLocationPage "here".
624          * @endif
625          *
626          * @return              An error code
627          * @param[in]   location                        The location of the event
628          * @exception   E_SUCCESS                       The method is successful.
629          */
630         result SetLocation(const Tizen::Base::String& location);
631
632         /**
633          * @if OSPCOMPAT
634          * @page        CompCalEventSetLocationPage Compatibility for SetLocation()
635          * @section     CompCalEventSetLocationPageIssueSection Issues
636          *          Implementing this method in OSP compatible applications has the following issues:   @n
637          *                      -# If the length of the location to be set is greater than 100 characters, E_INVALID_ARG is returned.
638          *
639          * @section     CompCalEventSetLocationPageSolutionSection Resolutions
640          *                      This issue has been resolved in Tizen.  @n
641          *                      -# There is no limit for the length of the location.
642          * @endif
643          */
644
645         /**
646          * @if OSPDEPREC
647          * @{
648          * Sets the category of the calendar event. @n
649          * If the category is not set, the default category (#EVENT_CATEGORY_APPOINTMENT) is set.
650          *
651          * @if OSPCOMPAT
652          * @brief <i> [Deprecated] [Compatibility] </i>
653          * @endif
654          * @deprecated  This method is deprecated because the category of event is not used any more.
655          * @since       2.0
656          * @if OSPCOMPAT
657          * @compatibility       This method has compatibility issues with OSP compatible applications. @n
658          *                                      For more information, see @ref CompCalEventSetCategoryPage "here".
659          * @endif
660          *
661          * @param[in]   category                        The category of the event
662          * @remarks             The start and end time of the anniversary and all day events created from the base applications, is the local time of the location where
663          *                              they are added.
664          *                              All the other events are Coordinated Universal Time (UTC).
665          *                              In order to integrate it with the base applications, set the start and end time properly according to the above guidelines.
666          * @}
667          * @endif
668          */
669         void SetCategory(EventCategory category);
670
671         /**
672          * @if OSPCOMPAT
673          * @page                CompCalEventSetCategoryPage             Compatibility for SetCategory()
674          * @section             CompCalEventSetCategoryPageIssueSection Issues
675          *                              Implementing this method in OSP compatible applications has the following issues:   @n
676          *
677          *      -# When the anniversary category is set to the event, it's handled as all day event even though the all day event property is not set.
678          *
679          * @section             CompCalEventSetCategoryPageSolutionSection Resolutions
680          *
681          * This issue has been resolved in Tizen.  @n
682          *  -# The category property is deprecated and it's not used any more.
683          *  In Tizen, the all day event property will be set simultaneously when the anniversary category is set to the event.
684          *  If an application tries to change the all day event property of the anniversary event to @c false, it will not be changed.
685          * @endif
686          */
687
688         /**
689          * Sets the sensitivity of the calendar event.
690          *
691          * @since       2.0
692          *
693          * @param[in]   sensitivity             The sensitivity of the calendar event
694          */
695         void SetSensitivity(RecordSensitivity sensitivity);
696
697         /**
698          * Sets the coordinates.
699          *
700          * @since       2.0
701          *
702          * @return              An error code
703          * @param[in]   latitude                The latitude in the range @n The valid range is [-90.0, 90.0].
704          * @param[in]   longitude               The longitude in the range @n The valid range is [-180.0, 180.0].
705          * @exception   E_SUCCESS               The method is successful.
706          * @exception   E_INVALID_ARG           The @c latitude or @c longitude is out of the valid range.
707          */
708         result SetCoordinates(double latitude, double longitude);
709
710         /**
711          * Gets the coordinates.
712          *
713          * @since       2.0
714          *
715          * @return              An error code
716          * @param[out]  latitude                The latitude
717          * @param[out]  longitude               The longitude
718          */
719         void GetCoordinates(double& latitude, double& longitude) const;
720
721         /**
722          * @if OSPDEPREC
723          * Sets the reminder of the calendar event.
724          *
725          * @brief <i> [Deprecated] </i>
726          * @deprecated          This method is deprecated. Instead of using this method, it is recommended to use AddReminder() and RemoveReminderAt().
727          * @since       2.0
728          *
729          * @return              An error code
730          * @param[in]   pReminder                               The reminder to set, @n
731          *                                                                              else @c null to remove the previous reminder
732          * @exception   E_SUCCESS                               The method is successful.
733          * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
734          * @endif
735          */
736         result SetReminder(const Reminder* pReminder);
737
738         /**
739          * Sets the recurrence of the calendar event. @n
740          * The recurrence rule date must be equal to the start date of the event. @n
741          * If the event start date is different than the recurrence rule date, the event start date is set to match the recurrence rule date. @n
742          * For example, if an event start date is 17/02/2010, that is Wednesday and the recurrence rule date is Thursday of every week,
743          * the event start date changes to 18/02/2010, after this method is called. @n
744          * Note that the start/end date and the time zone must be set before setting a recurrence.
745          *
746          * @if OSPCOMPAT
747          * @brief <i> [Compatibility] </i>
748          * @endif
749          * @since       2.0
750          * @if OSPCOMPAT
751          * @compatibility This method has compatibility issues with OSP compatible applications. @n
752          *                For more information, see @ref CompCalEventSetRecurrencePage "here".
753          * @endif
754          *
755          * @return              An error code
756          * @param[in]   pRecurrence                             The recurrence to set, @n
757          *                                                                              else @c null to remove the previous recurrence
758          * @exception   E_SUCCESS                               The method is successful.
759          * @exception   E_INVALID_STATE                 The current event is a %CalEvent instance that has a recurrence ID.
760          * @exception   E_INVALID_CONDITION             Either of the following conditions has occurred: @n
761          *                                                                              - The recurrence rule date is earlier than the start date and time of the event. @n
762          *                                                                              - The recurrence rule is invalid. @n
763          *                                                                              - The duration of the event is too long. @n
764          *                                                                              It must be shorter than the (interval x frequency) days set for the recurrence rule.
765          * @exception   E_INVALID_ARG                   Either of the following conditions has occurred: @n
766          *                                                                              - When the frequency is #FREQ_WEEKLY, DayOfWeek is not set. @n
767          *                                                                              - When the frequency is #FREQ_MONTHLY, neither DayOfMonth nor DayOfWeek and WeekOfMonth are not set. @n
768          *                                                                              - When the frequency is #FREQ_YEARLY, neither DayOfMonth and MonthOfYear nor DayOfWeek,
769          *                                                                              WeekOfMonth and MonthOfYear are not set. @n
770          *                                                                              - When the frequency is #FREQ_YEARLY and MonthOfYear is 2, DayOfMonth is greater than 29 ( > 29 ). @n
771          *                                                                              - When the frequency is #FREQ_YEARLY and MonthOfYear is 4 or 6 or 9 or 11,
772          *                                                                              DayOfMonth is greater than 30 ( > 30 ).
773          * @exception   E_SYSTEM                                A system error has occurred.
774          * @remarks             If the until property of the recurrence is set with too distant future from the event's start date, @n
775          *                              too many recurring events are generated. It is the same when the value of recurrence count is big. @n
776          *                              The system limits the count of the recurring events that are generated by recurrence rule of an event. @n
777          *                              In this case, some recurring events that exceed the system limitation cannot be retrieved.
778          *
779          * The following example demonstrates how to use the %SetRecurrence() method.
780          * @code
781                 MyClass::SetEventRecurrence(void)
782                 {
783                         result r = E_SUCCESS;
784                         Recurrence* pRecurrence = new Recurrence();
785
786                         pRecurrence->SetFrequency(FREQ_WEEKLY);
787                         pRecurrence->SetDayOfWeek(CAL_MONDAY);
788
789                         r = __pCalEvent->SetRecurrence(pRecurrence);
790
791                         delete pRecurrence;
792                 }
793          * @endcode
794          */
795         result SetRecurrence(const Recurrence* pRecurrence);
796
797         /**
798          * @if OSPCOMPAT
799          * @page        CompCalEventSetRecurrencePage Compatibility for SetRecurrence()
800          * @section     CompCalEventSetRecurrencePageIssueSection Issues
801          *           Implementing this method in OSP compatible applications has the following issues:   @n
802          *                      - If the category is anniversary and the frequency of recurrence is not yearly, E_TYPE_MISMATCH exception is occurred. @n
803          *                      Yearly frequency is only accepted for anniversary category.
804          *
805          * @section     CompCalEventSetRecurrencePageSolutionSection Resolutions
806          *                      This issue has been resolved in Tizen.  @n
807          *                      -# All recurrence frequency will be accepted because the category of event is not used any more.
808          * @endif
809          */
810
811         /**
812          * Adds a reminder.
813          *
814          * @since       2.0
815          *
816          * @return              An error code
817          * @param[in]   reminder                        The reminder to add
818          * @exception   E_SUCCESS                       The method is successful.
819          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
820          */
821         result AddReminder(const Reminder& reminder);
822
823         /**
824          * Removes a reminder at the index.
825          *
826          * @since       2.0
827          *
828          * @return              An error code
829          * @param[in]   index                           The index of reminder to remove
830          * @exception   E_SUCCESS                       The method is successful.
831          * @exception   E_OUT_OF_RANGE          The index is either equal to or greater than the number of reminders or less than @c 0.
832          */
833         result RemoveReminderAt(int index);
834
835         /**
836          * Gets a list of all the reminders.
837          *
838          * @since       2.0
839          *
840          * @return              A list containing the Reminder instances, @n
841          *                              else an empty list if there are no reminders
842          */
843         const Tizen::Base::Collection::IList& GetAllReminders(void) const;
844
845         /**
846          * Gets the ID of the calendar to which this event belongs.
847          *
848          * @since       2.0
849          *
850          * @return              The calendar Id
851          */
852         RecordId GetCalendarId(void) const;
853
854         /**
855          * Copying of objects using this copy assignment operator is allowed.
856          *
857          * @since       2.0
858          *
859          * @param[in]   rhs             An instance of %CalEvent
860          */
861         CalEvent& operator =(const CalEvent& rhs);
862
863 private:
864         friend class _CalEventImpl;
865         class _CalEventImpl* __pCalEventImpl;
866 };      // CalEvent
867
868 }}      // Tizen::Social
869
870 #endif // _FSCL_CAL_EVENT_H_