5eff3974a4505ef926fefa6957ed3fdb2fe73f87
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Calendar / JSCalendarItemProperties.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_CALENDAR_ITEM_PROPERTIES_H_
19 #define _JS_CALENDAR_ITEM_PROPERTIES_H_
20
21 #include <JavaScriptCore/JavaScript.h>
22 #include <API/Calendar/CalendarEvent.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24
25 namespace TizenApis {
26 namespace Tizen1_0 {
27 namespace Calendar {
28
29 // Common CalendarItemProperties
30 #define TIZEN_CALENDAR_ITEM_DESCRIPTION "description"
31 #define TIZEN_CALENDAR_ITEM_SUMMARY "summary"
32 #define TIZEN_CALENDAR_ITEM_IS_ALL_DAY "isAllDay"
33 #define TIZEN_CALENDAR_ITEM_START_DATE "startDate"
34 #define TIZEN_CALENDAR_ITEM_DURATION "duration"
35 #define TIZEN_CALENDAR_ITEM_LOCATION "location"
36 #define TIZEN_CALENDAR_ITEM_GEOLOCATION "geolocation"
37 #define TIZEN_CALENDAR_ITEM_ORGANIZER "organizer"
38 #define TIZEN_CALENDAR_ITEM_VISIBILITY "visibility"
39 #define TIZEN_CALENDAR_ITEM_STATUS "status"
40 #define TIZEN_CALENDAR_ITEM_PRIORITY  "priority"
41 #define TIZEN_CALENDAR_ITEM_ALARMS "alarms"
42 #define TIZEN_CALENDAR_ITEM_CATEGORIES "categories"
43 #define TIZEN_CALENDAR_ITEM_ATTENDEES "attendees"
44
45 // CalendarTaskProperties
46 #define TIZEN_CALENDAR_TASK_DUE_DATE  "dueDate"
47 #define TIZEN_CALENDAR_TASK_COMPLETED_DATE  "completedDate"
48 #define TIZEN_CALENDAR_TASK_PROGRESS "progress"
49
50 // CalendarEventProperties
51 #define TIZEN_CALENDAR_EVENT_END_DATE  "endDate"
52 #define TIZEN_CALENDAR_EVENT_AVAILABILITY "availability"
53 #define TIZEN_CALENDAR_EVENT_RECURRENCE_RULE "recurrenceRule"
54
55 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<TizenApis::Api::Calendar::CalendarEventPtr, 
56         WrtDeviceApis::CommonsJavaScript::NoOwnership> CalendarItemPropertiesPrivObject;
57
58 class JSCalendarItemProperties
59 {
60   public:
61
62     static const JSClassDefinition* getClassInfo();
63
64     static const JSClassRef getClassRef();
65
66     static TizenApis::Api::Calendar::CalendarEventPtr getPrivateObject(JSObjectRef object);
67
68     static void setPrivateObject(const TizenApis::Api::Calendar::CalendarEventPtr &event,
69             JSContextRef ctx,
70             const JSObjectRef object);
71
72     static bool validate(JSContextRef ctx,
73             const JSObjectRef object,
74             JSValueRef* exception);
75
76   private:
77     /**
78      * This member variable contains the values which has to be passed when
79      * the this class is embedded into JS Engine.
80      */
81     static JSClassDefinition m_classInfo;
82
83     /**
84      * This structure describes a statically declared function property.
85      */
86     static JSStaticFunction m_function[];
87
88     /**
89      * This member variable contains the initialization values for the
90      * properties of this class. The values are given according to the
91      * data structure JSPropertySpec.
92      */
93     static JSStaticValue m_property[];
94
95     static JSClassRef m_jsClassRef;
96
97     /**
98      * The callback invoked when an object is first created.
99      */
100     static void initialize(JSContextRef context,
101             JSObjectRef object);
102
103     /**
104      * The callback invoked when an object is finalized.
105      */
106     static void finalize(JSObjectRef object);
107
108     /**
109      * Getters and setters for properties
110      */
111     static JSValueRef getPropertyDescription(JSContextRef context,
112             JSObjectRef object,
113             JSStringRef propertyName,
114             JSValueRef* exception);
115     static bool setPropertyDescription(JSContextRef context,
116             JSObjectRef object,
117             JSStringRef propertyName,
118             JSValueRef value,
119             JSValueRef* exception);
120     static JSValueRef getPropertySummary(JSContextRef context,
121             JSObjectRef object,
122             JSStringRef propertyName,
123             JSValueRef* exception);
124     static bool setPropertySummary(JSContextRef context,
125             JSObjectRef object,
126             JSStringRef propertyName,
127             JSValueRef value,
128             JSValueRef* exception);
129     static JSValueRef getPropertyStartTime(JSContextRef context,
130             JSObjectRef object,
131             JSStringRef propertyName,
132             JSValueRef* exception);
133     static bool setPropertyStartTime(JSContextRef context,
134             JSObjectRef object,
135             JSStringRef propertyName,
136             JSValueRef value,
137             JSValueRef* exception);
138     static JSValueRef getPropertyLocation(JSContextRef context,
139             JSObjectRef object,
140             JSStringRef propertyName,
141             JSValueRef* exception);
142     static bool setPropertyLocation(JSContextRef context,
143             JSObjectRef object,
144             JSStringRef propertyName,
145             JSValueRef value,
146             JSValueRef* exception);
147     static JSValueRef getPropertyGeolocation(JSContextRef context,
148             JSObjectRef object,
149             JSStringRef propertyName,
150             JSValueRef* exception);
151     static bool setPropertyGeolocation(JSContextRef context,
152             JSObjectRef object,
153             JSStringRef propertyName,
154             JSValueRef value,
155             JSValueRef* exception);
156     static JSValueRef getPropertyOrganizer(JSContextRef context,
157             JSObjectRef object,
158             JSStringRef propertyName,
159             JSValueRef* exception);
160     static bool setPropertyOrganizer(JSContextRef context,
161             JSObjectRef object,
162             JSStringRef propertyName,
163             JSValueRef value,
164             JSValueRef* exception);
165     static JSValueRef getPropertyVisibility(JSContextRef context,
166             JSObjectRef object,
167             JSStringRef propertyName,
168             JSValueRef* exception);
169     static bool setPropertyVisibility(JSContextRef context,
170             JSObjectRef object,
171             JSStringRef propertyName,
172             JSValueRef value,
173             JSValueRef* exception);
174     static JSValueRef getPropertyStatus(JSContextRef context,
175             JSObjectRef object,
176             JSStringRef propertyName,
177             JSValueRef* exception);
178     static bool setPropertyStatus(JSContextRef context,
179             JSObjectRef object,
180             JSStringRef propertyName,
181             JSValueRef value,
182             JSValueRef* exception);
183     static JSValueRef getPropertyAlarms(JSContextRef context,
184             JSObjectRef object,
185             JSStringRef propertyName,
186             JSValueRef* exception);
187     static bool setPropertyAlarms(JSContextRef context,
188             JSObjectRef object,
189             JSStringRef propertyName,
190             JSValueRef value,
191             JSValueRef* exception);
192     static JSValueRef getPropertyCategories(JSContextRef context,
193             JSObjectRef object,
194             JSStringRef propertyName,
195             JSValueRef* exception);
196     static bool setPropertyCategories(JSContextRef context,
197             JSObjectRef object,
198             JSStringRef propertyName,
199             JSValueRef value,
200             JSValueRef* exception);
201     static JSValueRef getPropertyIsAllDay(JSContextRef context,
202             JSObjectRef object,
203             JSStringRef propertyName,
204             JSValueRef* exception);
205     static bool setPropertyIsAllDay(JSContextRef context,
206             JSObjectRef object,
207             JSStringRef propertyName,
208             JSValueRef value,
209             JSValueRef* exception);
210     static JSValueRef getPropertyDuration(JSContextRef context,
211             JSObjectRef object,
212             JSStringRef propertyName,
213             JSValueRef* exception);
214     static bool setPropertyDuration(JSContextRef context,
215             JSObjectRef object,
216             JSStringRef propertyName,
217             JSValueRef value,
218             JSValueRef* exception);
219     static JSValueRef getPropertyAttendees(JSContextRef context,
220             JSObjectRef object,
221             JSStringRef propertyName,
222             JSValueRef* exception);
223     static bool setPropertyAttendees(JSContextRef context,
224             JSObjectRef object,
225             JSStringRef propertyName,
226             JSValueRef value,
227             JSValueRef* exception);
228     static JSValueRef getPropertyAvailability(JSContextRef context,
229             JSObjectRef object,
230             JSStringRef propertyName,
231             JSValueRef* exception);
232     static bool setPropertyAvailability(JSContextRef context,
233             JSObjectRef object,
234             JSStringRef propertyName,
235             JSValueRef value,
236             JSValueRef* exception);
237     static JSValueRef getPropertyRecurrenceRule(JSContextRef context,
238             JSObjectRef object,
239             JSStringRef propertyName,
240             JSValueRef* exception);
241     static bool setPropertyRecurrenceRule(JSContextRef context,
242             JSObjectRef object,
243             JSStringRef propertyName,
244             JSValueRef value,
245             JSValueRef* exception);
246     static JSValueRef getPropertyDueDate(JSContextRef context,
247             JSObjectRef object,
248             JSStringRef propertyName,
249             JSValueRef* exception);
250     static bool setPropertyDueDate(JSContextRef context,
251             JSObjectRef object,
252             JSStringRef propertyName,
253             JSValueRef value,
254             JSValueRef* exception);
255     static JSValueRef getPropertyCompletedDate(JSContextRef context,
256             JSObjectRef object,
257             JSStringRef propertyName,
258             JSValueRef* exception);
259     static bool setPropertyCompletedDate(JSContextRef context,
260             JSObjectRef object,
261             JSStringRef propertyName,
262             JSValueRef value,
263             JSValueRef* exception);
264     static JSValueRef getPropertyProgress(JSContextRef context,
265             JSObjectRef object,
266             JSStringRef propertyName,
267             JSValueRef* exception);
268     static bool setPropertyProgress(JSContextRef context,
269             JSObjectRef object,
270             JSStringRef propertyName,
271             JSValueRef value,
272             JSValueRef* exception);
273     static JSValueRef getPropertyPriority(JSContextRef context,
274             JSObjectRef object,
275             JSStringRef propertyName,
276             JSValueRef* exception);
277     static bool setPropertyPriority(JSContextRef context,
278             JSObjectRef object,
279             JSStringRef propertyName,
280             JSValueRef value,
281             JSValueRef* exception);
282     static JSValueRef getPropertyEndDate(JSContextRef context,
283             JSObjectRef object,
284             JSStringRef propertyName,
285             JSValueRef* exception);
286     static bool setPropertyEndDate(JSContextRef context,
287             JSObjectRef object,
288             JSStringRef propertyName,
289             JSValueRef value,
290             JSValueRef* exception);
291 };
292
293 }
294 }
295 }
296
297 #endif
298