Update change log and spec for wrt-plugins-tizen_0.4.13
[framework/web/wrt-plugins-tizen.git] / src / Calendar / JSCalendarItemProperties.h
1 //
2 // Tizen Web Device API
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
19 #ifndef _JS_CALENDAR_ITEM_PROPERTIES_H_
20 #define _JS_CALENDAR_ITEM_PROPERTIES_H_
21
22 #include <JavaScriptCore/JavaScript.h>
23 #include "CalendarEvent.h"
24 #include <CommonsJavaScript/PrivateObject.h>
25
26 namespace DeviceAPI {
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 #define TIZEN_CALENDAR_ITEM_CALENDAR_ID "calendarId"
45 #define TIZEN_CALENDAR_EVENT_LAST_MODIFICATION_DATE "lastModificationDate"
46
47 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<CalendarEventPtr, 
48         WrtDeviceApis::CommonsJavaScript::NoOwnership> CalendarItemPropertiesPrivObject;
49
50 class JSCalendarItemProperties
51 {
52   public:
53
54     static const JSClassDefinition* getClassInfo();
55
56     static const JSClassRef getClassRef();
57
58     static CalendarEventPtr getPrivateObject(JSObjectRef object);
59
60     static void setPrivateObject(const CalendarEventPtr &event,
61             JSContextRef ctx,
62             const JSObjectRef object);
63
64         static JSObjectRef createJSCalendarItemProperties(JSContextRef context, CalendarEventPtr geo);
65
66   private:
67     /**
68      * This member variable contains the values which has to be passed when
69      * the this class is embedded into JS Engine.
70      */
71     static JSClassDefinition m_classInfo;
72
73     /**
74      * This structure describes a statically declared function property.
75      */
76     static JSStaticFunction m_function[];
77
78     /**
79      * This member variable contains the initialization values for the
80      * properties of this class. The values are given according to the
81      * data structure JSPropertySpec.
82      */
83     static JSStaticValue m_property[];
84
85     static JSClassRef m_jsClassRef;
86
87     /**
88      * The callback invoked when an object is first created.
89      */
90     static void initialize(JSContextRef context,
91             JSObjectRef object);
92
93     /**
94      * The callback invoked when an object is finalized.
95      */
96     static void finalize(JSObjectRef object);
97
98     /**
99      * Export a string from item
100      */
101     static JSValueRef convertToString(JSContextRef context,
102             JSObjectRef object,
103             JSObjectRef thisObject,
104             size_t argumentCount,
105             const JSValueRef arguments[],
106             JSValueRef* exception);
107
108     /**
109      * Copy item object contents except id
110      */
111     static JSValueRef clone(JSContextRef context,
112             JSObjectRef object,
113             JSObjectRef thisObject,
114             size_t argumentCount,
115             const JSValueRef arguments[],
116             JSValueRef* exception);
117
118     /**
119      * Getters and setters for properties
120      */
121     static JSValueRef getPropertyDescription(JSContextRef context,
122             JSObjectRef object,
123             JSStringRef propertyName,
124             JSValueRef* exception);
125     static bool setPropertyDescription(JSContextRef context,
126             JSObjectRef object,
127             JSStringRef propertyName,
128             JSValueRef value,
129             JSValueRef* exception);
130     static JSValueRef getPropertySummary(JSContextRef context,
131             JSObjectRef object,
132             JSStringRef propertyName,
133             JSValueRef* exception);
134     static bool setPropertySummary(JSContextRef context,
135             JSObjectRef object,
136             JSStringRef propertyName,
137             JSValueRef value,
138             JSValueRef* exception);
139     static JSValueRef getPropertyStartTime(JSContextRef context,
140             JSObjectRef object,
141             JSStringRef propertyName,
142             JSValueRef* exception);
143     static bool setPropertyStartTime(JSContextRef context,
144             JSObjectRef object,
145             JSStringRef propertyName,
146             JSValueRef value,
147             JSValueRef* exception);
148     static JSValueRef getPropertyLocation(JSContextRef context,
149             JSObjectRef object,
150             JSStringRef propertyName,
151             JSValueRef* exception);
152     static bool setPropertyLocation(JSContextRef context,
153             JSObjectRef object,
154             JSStringRef propertyName,
155             JSValueRef value,
156             JSValueRef* exception);
157     static JSValueRef getPropertyGeolocation(JSContextRef context,
158             JSObjectRef object,
159             JSStringRef propertyName,
160             JSValueRef* exception);
161     static bool setPropertyGeolocation(JSContextRef context,
162             JSObjectRef object,
163             JSStringRef propertyName,
164             JSValueRef value,
165             JSValueRef* exception);
166     static JSValueRef getPropertyOrganizer(JSContextRef context,
167             JSObjectRef object,
168             JSStringRef propertyName,
169             JSValueRef* exception);
170     static bool setPropertyOrganizer(JSContextRef context,
171             JSObjectRef object,
172             JSStringRef propertyName,
173             JSValueRef value,
174             JSValueRef* exception);
175     static JSValueRef getPropertyVisibility(JSContextRef context,
176             JSObjectRef object,
177             JSStringRef propertyName,
178             JSValueRef* exception);
179     static bool setPropertyVisibility(JSContextRef context,
180             JSObjectRef object,
181             JSStringRef propertyName,
182             JSValueRef value,
183             JSValueRef* exception);
184     static JSValueRef getPropertyStatus(JSContextRef context,
185             JSObjectRef object,
186             JSStringRef propertyName,
187             JSValueRef* exception);
188     static bool setPropertyStatus(JSContextRef context,
189             JSObjectRef object,
190             JSStringRef propertyName,
191             JSValueRef value,
192             JSValueRef* exception);
193     static JSValueRef getPropertyAlarms(JSContextRef context,
194             JSObjectRef object,
195             JSStringRef propertyName,
196             JSValueRef* exception);
197     static bool setPropertyAlarms(JSContextRef context,
198             JSObjectRef object,
199             JSStringRef propertyName,
200             JSValueRef value,
201             JSValueRef* exception);
202     static JSValueRef getPropertyCategories(JSContextRef context,
203             JSObjectRef object,
204             JSStringRef propertyName,
205             JSValueRef* exception);
206     static bool setPropertyCategories(JSContextRef context,
207             JSObjectRef object,
208             JSStringRef propertyName,
209             JSValueRef value,
210             JSValueRef* exception);
211     static JSValueRef getPropertyIsAllDay(JSContextRef context,
212             JSObjectRef object,
213             JSStringRef propertyName,
214             JSValueRef* exception);
215     static bool setPropertyIsAllDay(JSContextRef context,
216             JSObjectRef object,
217             JSStringRef propertyName,
218             JSValueRef value,
219             JSValueRef* exception);
220     static JSValueRef getPropertyDuration(JSContextRef context,
221             JSObjectRef object,
222             JSStringRef propertyName,
223             JSValueRef* exception);
224     static bool setPropertyDuration(JSContextRef context,
225             JSObjectRef object,
226             JSStringRef propertyName,
227             JSValueRef value,
228             JSValueRef* exception);
229     static JSValueRef getPropertyAttendees(JSContextRef context,
230             JSObjectRef object,
231             JSStringRef propertyName,
232             JSValueRef* exception);
233     static bool setPropertyAttendees(JSContextRef context,
234             JSObjectRef object,
235             JSStringRef propertyName,
236             JSValueRef value,
237             JSValueRef* exception);
238     static JSValueRef getPropertyAvailability(JSContextRef context,
239             JSObjectRef object,
240             JSStringRef propertyName,
241             JSValueRef* exception);
242     static bool setPropertyAvailability(JSContextRef context,
243             JSObjectRef object,
244             JSStringRef propertyName,
245             JSValueRef value,
246             JSValueRef* exception);
247     static JSValueRef getPropertyDueDate(JSContextRef context,
248             JSObjectRef object,
249             JSStringRef propertyName,
250             JSValueRef* exception);
251     static bool setPropertyDueDate(JSContextRef context,
252             JSObjectRef object,
253             JSStringRef propertyName,
254             JSValueRef value,
255             JSValueRef* exception);
256     static JSValueRef getPropertyCompletedDate(JSContextRef context,
257             JSObjectRef object,
258             JSStringRef propertyName,
259             JSValueRef* exception);
260     static bool setPropertyCompletedDate(JSContextRef context,
261             JSObjectRef object,
262             JSStringRef propertyName,
263             JSValueRef value,
264             JSValueRef* exception);
265     static JSValueRef getPropertyProgress(JSContextRef context,
266             JSObjectRef object,
267             JSStringRef propertyName,
268             JSValueRef* exception);
269     static bool setPropertyProgress(JSContextRef context,
270             JSObjectRef object,
271             JSStringRef propertyName,
272             JSValueRef value,
273             JSValueRef* exception);
274     static JSValueRef getPropertyPriority(JSContextRef context,
275             JSObjectRef object,
276             JSStringRef propertyName,
277             JSValueRef* exception);
278     static bool setPropertyPriority(JSContextRef context,
279             JSObjectRef object,
280             JSStringRef propertyName,
281             JSValueRef value,
282             JSValueRef* exception);
283     static JSValueRef getPropertyEndDate(JSContextRef context,
284             JSObjectRef object,
285             JSStringRef propertyName,
286             JSValueRef* exception);
287     static bool setPropertyEndDate(JSContextRef context,
288             JSObjectRef object,
289             JSStringRef propertyName,
290             JSValueRef value,
291             JSValueRef* exception);
292     static JSValueRef getPropertyLastModificationDate(JSContextRef context,
293             JSObjectRef object,
294             JSStringRef propertyName,
295             JSValueRef* exception);
296     static JSValueRef getPropertyCalendarId(JSContextRef context,
297             JSObjectRef object,
298             JSStringRef propertyName,
299             JSValueRef* exception);
300 };
301
302 }
303 }
304
305 #endif
306