aafe67f9fc403fa6361b080906d64505639b7c67
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Calendar / JSCalendarManager.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 #ifndef _JS_TIZEN_CALENDAR_MANAGER_H_
19 #define _JS_TIZEN_CALENDAR_MANAGER_H_
20
21 #include <JavaScriptCore/JavaScript.h>
22 #include <CommonsJavaScript/PrivateObject.h>
23 #include <API/Calendar/ICalendarManager.h>
24 #include <API/Calendar/ICalendar.h>
25
26 namespace TizenApis {
27 namespace Tizen1_0 {
28 namespace Calendar {
29
30 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<TizenApis::Api::Calendar::ICalendarManagerPtr,
31                                WrtDeviceApis::CommonsJavaScript::NoOwnership> CalendarManagerPrivObject;
32
33 #define TIZEN_CALENDAR_PROPERTY_VCALENDAR_20_FORMAT         "ICALENDAR_20"
34 #define TIZEN_CALENDAR_PROPERTY_VCALENDAR_10_FORMAT         "VCALENDAR_10"
35
36 #define TIZEN_CALENDAR_PROPERTY_TENTATIVE_STATUS        "TENTATIVE"
37 #define TIZEN_CALENDAR_PROPERTY_CONFIRMED_STATUS        "CONFIRMED"
38 #define TIZEN_CALENDAR_PROPERTY_CANCELLED_STATUS        "CANCELLED"
39 #define TIZEN_CALENDAR_PROPERTY_NEEDS_ACTION_STATUS     "NEEDS_ACTION"
40 #define TIZEN_CALENDAR_PROPERTY_IN_PROCESS_STATUS       "IN_PROCESS"
41 #define TIZEN_CALENDAR_PROPERTY_COMPLETED_STATUS        "COMPLETED"
42
43 #define TIZEN_CALENDAR_PROPERTY_HIGH_PRIORITY           "HIGH"
44 #define TIZEN_CALENDAR_PROPERTY_MEDIUM_PRIORITY         "MEDIUM"
45 #define TIZEN_CALENDAR_PROPERTY_LOW_PRIORITY            "LOW"
46
47 #define TIZEN_CALENDAR_PROPERTY_PUBLIC_VISIBILITY           "PUBLIC"
48 #define TIZEN_CALENDAR_PROPERTY_PRIVATE_VISIBILITY          "PRIVATE"
49 #define TIZEN_CALENDAR_PROPERTY_CONFIDENTIAL_VISIBILITY     "CONFIDENTIAL"
50
51 #define TIZEN_CALENDAR_PROPERTY_BUSY                    "BUSY"
52 #define TIZEN_CALENDAR_PROPERTY_BUSY_UNAVAILABLE_FB     "BUSY_UNAVAILABLE"
53 #define TIZEN_CALENDAR_PROPERTY_FREE                    "FREE"
54 #define TIZEN_CALENDAR_PROPERTY_BUSY_TENTATIVE          "BUSY_TENTATIVE"
55
56 #define TIZEN_CALENDAR_PROPERTY_REQ_PARTICIPANT_ROLE    "REQ_PARTICIPANT"
57 #define TIZEN_CALENDAR_PROPERTY_OPT_PARTICIPANT_ROLE    "OPT_PARTICIPANT"
58 #define TIZEN_CALENDAR_PROPERTY_NON_PARTICIPANT_ROLE    "NON_PARTICIPANT"
59 #define TIZEN_CALENDAR_PROPERTY_CHAIR_ROLE              "CHAIR"
60
61 #define TIZEN_CALENDAR_PROPERTY_PENDING_STATUS      "PENDING"
62 #define TIZEN_CALENDAR_PROPERTY_ACCEPTED_STATUS     "ACCEPTED"
63 #define TIZEN_CALENDAR_PROPERTY_DECLINED_STATUS     "DECLINED"
64 #define TIZEN_CALENDAR_PROPERTY_TENTATIVE_STATUS    "TENTATIVE"
65 #define TIZEN_CALENDAR_PROPERTY_DELEGATED_STATUS    "DELEGATED"
66 #define TIZEN_CALENDAR_PROPERTY_COMPLETED_STATUS    "COMPLETED"
67 #define TIZEN_CALENDAR_PROPERTY_IN_PROCESS_STATUS   "IN_PROCESS"
68
69 #define TIZEN_CALENDAR_PROPERTY_INDIVIDUAL_TYPE     "INDIVIDUAL"
70 #define TIZEN_CALENDAR_PROPERTY_GROUP_TYPE          "GROUP"
71 #define TIZEN_CALENDAR_PROPERTY_RESOURCE_TYPE       "RESOURCE"
72 #define TIZEN_CALENDAR_PROPERTY_ROOM_TYPE           "ROOM"
73 #define TIZEN_CALENDAR_PROPERTY_UNKNOWN_TYPE        "UNKNOWN"
74
75 //#define TIZEN_CALENDAR_PROPERTY_NO_RECURRENCE       "NO_RECURRENCE"
76 #define TIZEN_CALENDAR_PROPERTY_DAILY_RECURRENCE    "DAILY"
77 #define TIZEN_CALENDAR_PROPERTY_WEEKLY_RECURRENCE   "WEEKLY"
78 #define TIZEN_CALENDAR_PROPERTY_MONTHLY_RECURRENCE  "MONTHLY"
79 #define TIZEN_CALENDAR_PROPERTY_YEARLY_RECURRENCE   "YEARLY"
80
81 //#define TIZEN_CALENDAR_PROPERTY_NO_ALARM            "NO_ALARM"
82 #define TIZEN_CALENDAR_PROPERTY_SILENT_ALARM        "SILENT"
83 #define TIZEN_CALENDAR_PROPERTY_SOUND_ALARM         "SOUND"
84
85 #define TIZEN_CALENDAR_PROPERTY_TYPE_EVENT         "EVENT"
86 #define TIZEN_CALENDAR_PROPERTY_TYPE_TASK         "TASK"
87
88 class JSCalendarManager
89 {
90   public:
91     enum TizenAlarmType
92     {
93         NO_ALARM = 0,
94         SILENT_ALARM = 1,
95         SOUND_ALARM = 2,
96         INVALID_ALARM = 10000
97     };
98     
99     static const JSClassDefinition* getClassInfo();
100     static const JSClassRef getClassRef();
101
102   private:
103     /**
104      * This structure describes a statically declared function property.
105      */
106     static JSStaticFunction m_function[];
107
108     /**
109      * This member variable contains the initialization values for the
110      * properties of this class. The values are given according to
111      * the data structure JSPropertySpec
112      */
113     static JSStaticValue m_property[];
114
115     /**
116      * This structure contains properties and callbacks
117      * that define a type of object.
118      */
119     static JSClassDefinition m_classInfo;
120
121     static JSClassRef m_jsClassRef;
122
123     /**
124      * The callback invoked when an object is first created.
125      */
126     static void initialize(JSContextRef context,
127             JSObjectRef object);
128
129     /**
130      * The callback invoked when an object is finalized.
131      */
132     static void finalize(JSObjectRef object);
133
134     /**
135      * Get Calendars.
136      */
137     static JSValueRef getCalendars(JSContextRef context,
138             JSObjectRef object,
139             JSObjectRef thisObject,
140             size_t argumentCount,
141             const JSValueRef arguments[],
142             JSValueRef* exception);
143
144     /**
145      * Get a default calendar.
146      */
147     static JSValueRef getDefaultCalendar(JSContextRef context,
148             JSObjectRef object,
149             JSObjectRef thisObject,
150             size_t argumentCount,
151             const JSValueRef arguments[],
152             JSValueRef* exception);
153 };
154
155 }
156 }
157 }
158 #endif /* _JS_TIZEN_CALENDAR_MANAGER_H_ */