2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef _JS_CALENDAR_ITEM_PROPERTIES_H_
20 #define _JS_CALENDAR_ITEM_PROPERTIES_H_
22 #include <JavaScriptCore/JavaScript.h>
23 #include "CalendarEvent.h"
24 #include <CommonsJavaScript/PrivateObject.h>
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"
47 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<CalendarEventPtr,
48 WrtDeviceApis::CommonsJavaScript::NoOwnership> CalendarItemPropertiesPrivObject;
50 class JSCalendarItemProperties
54 static const JSClassDefinition* getClassInfo();
56 static const JSClassRef getClassRef();
58 static CalendarEventPtr getPrivateObject(JSObjectRef object);
60 static void setPrivateObject(const CalendarEventPtr &event,
62 const JSObjectRef object);
64 static JSObjectRef createJSCalendarItemProperties(JSContextRef context, CalendarEventPtr geo);
68 * This member variable contains the values which has to be passed when
69 * the this class is embedded into JS Engine.
71 static JSClassDefinition m_classInfo;
74 * This structure describes a statically declared function property.
76 static JSStaticFunction m_function[];
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.
83 static JSStaticValue m_property[];
85 static JSClassRef m_jsClassRef;
88 * The callback invoked when an object is first created.
90 static void initialize(JSContextRef context,
94 * The callback invoked when an object is finalized.
96 static void finalize(JSObjectRef object);
99 * Export a string from item
101 static JSValueRef convertToString(JSContextRef context,
103 JSObjectRef thisObject,
104 size_t argumentCount,
105 const JSValueRef arguments[],
106 JSValueRef* exception);
109 * Copy item object contents except id
111 static JSValueRef clone(JSContextRef context,
113 JSObjectRef thisObject,
114 size_t argumentCount,
115 const JSValueRef arguments[],
116 JSValueRef* exception);
119 * Getters and setters for properties
121 static JSValueRef getPropertyDescription(JSContextRef context,
123 JSStringRef propertyName,
124 JSValueRef* exception);
125 static bool setPropertyDescription(JSContextRef context,
127 JSStringRef propertyName,
129 JSValueRef* exception);
130 static JSValueRef getPropertySummary(JSContextRef context,
132 JSStringRef propertyName,
133 JSValueRef* exception);
134 static bool setPropertySummary(JSContextRef context,
136 JSStringRef propertyName,
138 JSValueRef* exception);
139 static JSValueRef getPropertyStartTime(JSContextRef context,
141 JSStringRef propertyName,
142 JSValueRef* exception);
143 static bool setPropertyStartTime(JSContextRef context,
145 JSStringRef propertyName,
147 JSValueRef* exception);
148 static JSValueRef getPropertyLocation(JSContextRef context,
150 JSStringRef propertyName,
151 JSValueRef* exception);
152 static bool setPropertyLocation(JSContextRef context,
154 JSStringRef propertyName,
156 JSValueRef* exception);
157 static JSValueRef getPropertyGeolocation(JSContextRef context,
159 JSStringRef propertyName,
160 JSValueRef* exception);
161 static bool setPropertyGeolocation(JSContextRef context,
163 JSStringRef propertyName,
165 JSValueRef* exception);
166 static JSValueRef getPropertyOrganizer(JSContextRef context,
168 JSStringRef propertyName,
169 JSValueRef* exception);
170 static bool setPropertyOrganizer(JSContextRef context,
172 JSStringRef propertyName,
174 JSValueRef* exception);
175 static JSValueRef getPropertyVisibility(JSContextRef context,
177 JSStringRef propertyName,
178 JSValueRef* exception);
179 static bool setPropertyVisibility(JSContextRef context,
181 JSStringRef propertyName,
183 JSValueRef* exception);
184 static JSValueRef getPropertyStatus(JSContextRef context,
186 JSStringRef propertyName,
187 JSValueRef* exception);
188 static bool setPropertyStatus(JSContextRef context,
190 JSStringRef propertyName,
192 JSValueRef* exception);
193 static JSValueRef getPropertyAlarms(JSContextRef context,
195 JSStringRef propertyName,
196 JSValueRef* exception);
197 static bool setPropertyAlarms(JSContextRef context,
199 JSStringRef propertyName,
201 JSValueRef* exception);
202 static JSValueRef getPropertyCategories(JSContextRef context,
204 JSStringRef propertyName,
205 JSValueRef* exception);
206 static bool setPropertyCategories(JSContextRef context,
208 JSStringRef propertyName,
210 JSValueRef* exception);
211 static JSValueRef getPropertyIsAllDay(JSContextRef context,
213 JSStringRef propertyName,
214 JSValueRef* exception);
215 static bool setPropertyIsAllDay(JSContextRef context,
217 JSStringRef propertyName,
219 JSValueRef* exception);
220 static JSValueRef getPropertyDuration(JSContextRef context,
222 JSStringRef propertyName,
223 JSValueRef* exception);
224 static bool setPropertyDuration(JSContextRef context,
226 JSStringRef propertyName,
228 JSValueRef* exception);
229 static JSValueRef getPropertyAttendees(JSContextRef context,
231 JSStringRef propertyName,
232 JSValueRef* exception);
233 static bool setPropertyAttendees(JSContextRef context,
235 JSStringRef propertyName,
237 JSValueRef* exception);
238 static JSValueRef getPropertyAvailability(JSContextRef context,
240 JSStringRef propertyName,
241 JSValueRef* exception);
242 static bool setPropertyAvailability(JSContextRef context,
244 JSStringRef propertyName,
246 JSValueRef* exception);
247 static JSValueRef getPropertyDueDate(JSContextRef context,
249 JSStringRef propertyName,
250 JSValueRef* exception);
251 static bool setPropertyDueDate(JSContextRef context,
253 JSStringRef propertyName,
255 JSValueRef* exception);
256 static JSValueRef getPropertyCompletedDate(JSContextRef context,
258 JSStringRef propertyName,
259 JSValueRef* exception);
260 static bool setPropertyCompletedDate(JSContextRef context,
262 JSStringRef propertyName,
264 JSValueRef* exception);
265 static JSValueRef getPropertyProgress(JSContextRef context,
267 JSStringRef propertyName,
268 JSValueRef* exception);
269 static bool setPropertyProgress(JSContextRef context,
271 JSStringRef propertyName,
273 JSValueRef* exception);
274 static JSValueRef getPropertyPriority(JSContextRef context,
276 JSStringRef propertyName,
277 JSValueRef* exception);
278 static bool setPropertyPriority(JSContextRef context,
280 JSStringRef propertyName,
282 JSValueRef* exception);
283 static JSValueRef getPropertyEndDate(JSContextRef context,
285 JSStringRef propertyName,
286 JSValueRef* exception);
287 static bool setPropertyEndDate(JSContextRef context,
289 JSStringRef propertyName,
291 JSValueRef* exception);
292 static JSValueRef getPropertyLastModificationDate(JSContextRef context,
294 JSStringRef propertyName,
295 JSValueRef* exception);
296 static JSValueRef getPropertyCalendarId(JSContextRef context,
298 JSStringRef propertyName,
299 JSValueRef* exception);