upload tizen1.0 source
[profile/ivi/wrt-plugins-tizen.git] / src / platform / API / Calendar / CalendarEvent.h
index c5f2ccf..ea1cd2f 100755 (executable)
 #include <ctime>
 #include <string>
 #include <vector>
-#include <dpl/optional.h>
 #include <dpl/shared_ptr.h>
 
-#include "CalendarItemGeo.h"
 #include "EventAttendee.h"
 #include "EventRecurrenceRule.h"
 
@@ -32,6 +30,11 @@ namespace TizenApis {
 namespace Api {
 namespace Calendar {
 
+#define UNDEFINED_CALENDAR_ID 0
+#define UNDEFINED_ITEM_ID 0
+#define UNDEFINED_GEO 0
+#define UNDEFINED_ID "0"
+
 typedef std::vector<std::string> CategoryList;
 typedef DPL::SharedPtr<CategoryList> CategoryListPtr;
 
@@ -42,9 +45,6 @@ typedef DPL::SharedPtr<AttributeList> AttributeListPtr;
 class CalendarEvent
 {
   public:
-
-    static const int UNDEFINED_CALENDAR_ID = -1;
-
     typedef enum
     {
         TENTATIVE_STATUS,
@@ -53,7 +53,6 @@ class CalendarEvent
         NEEDS_ACTION_STATUS,
         IN_PROCESS_STATUS,
         COMPLETED_STATUS,
-        INVALID_STATUS = 10000,
         UNDEFINED_STATUS
     } EventStatus;
 
@@ -62,7 +61,6 @@ class CalendarEvent
         NO_ALARM,
         SILENT_ALARM,
         SOUND_ALARM,
-        INVALID_ALARM_TYPE = 10000,
         UNDEFINED_ALARM_TYPE
     } EventAlarmType;
 
@@ -71,7 +69,6 @@ class CalendarEvent
         PUBLIC_VISIBILITY,
         PRIVATE_VISIBILITY,
         CONFIDENTIAL_VISIBILITY,
-        INVALID_VISIBILITY = 10000,
         UNDEFINED_VISIBILITY
     } EventVisibility;
 
@@ -81,7 +78,6 @@ class CalendarEvent
         BUSY_UNAVAILABLE_FB,
         FREE_FB,
         BUSY_TENTATIVE_FB,
-        INVALID_AVAILABILITY = 10000,
         UNDEFINED_AVAILABILITY
     } EventAvailability;
 
@@ -90,7 +86,6 @@ class CalendarEvent
         LOW_PRIORITY,
         MEDIUM_PRIORITY,
         HIGH_PRIORITY,
-        INVALID_PRIORITY = 10000,
         UNDEFINED_PRIORITY
     } TaskPriority;
 
@@ -98,7 +93,6 @@ class CalendarEvent
     {
         ICALENDAR_20,
         VCALENDAR_10,
-        INVALID_FORMAT = 10000,
         UNDEFINED_FORMAT
     } VObjectFormat;
 
@@ -106,6 +100,7 @@ class CalendarEvent
     {
         EVENT_TYPE = 0,
         TASK_TYPE,
+        UNDEFINED_TYPE
     } CalendarType;
 
 
@@ -118,6 +113,9 @@ class CalendarEvent
     void resetId();
     bool getIdIsSet() const;
 
+    int getParentId() const;
+    void setParentId(int value);
+
     int getCalendarId() const;
     void setCalendarId(int value);
 
@@ -187,8 +185,11 @@ class CalendarEvent
     void setAttributesOfInterest(AttributeListPtr value);
     AttributeListPtr getAttributesOfInterest() const;
 
-    void setGeolocation(CalendarItemGeoPtr value);
-    CalendarItemGeoPtr getGeolocation() const;
+    double getLatitude() const;
+    void setLatitude(double value);
+
+    double getLongitude() const;
+    void setLongitude(double value);
 
     void setTimeZone(std::string value);
     std::string getTimeZone() const;
@@ -209,7 +210,8 @@ class CalendarEvent
     void setCalendarType(CalendarType type);
 
   protected:
-    DPL::Optional<int> m_id;
+    int m_id;
+    int m_parentId; // the parent id if it's detached.
     int m_calendarId;
     std::string m_description;
     std::string m_subject;
@@ -227,12 +229,13 @@ class CalendarEvent
     std::time_t m_lastModifiedDate;
     EventVisibility m_visibility;
     EventAvailability m_availability;
-    std::string m_uid;
+    std::string m_uid; // uid is same with id.
     std::time_t m_recurrenceId;
     EventAttendeeListPtr m_attendees;
     bool m_isDetached;
     AttributeListPtr m_attributesOfInterest;
-    CalendarItemGeoPtr m_geolocation;
+    double m_latitude;
+    double m_longitude;
     std::string m_timeZone;
     TaskPriority m_priority;
     std::time_t m_createdDate;