2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef _JS_CALENDAR_ITEM_PROPERTIES_H_
19 #define _JS_CALENDAR_ITEM_PROPERTIES_H_
21 #include <JavaScriptCore/JavaScript.h>
22 #include <API/Calendar/CalendarEvent.h>
23 #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"
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"
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"
55 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<TizenApis::Api::Calendar::CalendarEventPtr,
56 WrtDeviceApis::CommonsJavaScript::NoOwnership> CalendarItemPropertiesPrivObject;
58 class JSCalendarItemProperties
62 static const JSClassDefinition* getClassInfo();
64 static const JSClassRef getClassRef();
66 static TizenApis::Api::Calendar::CalendarEventPtr getPrivateObject(JSObjectRef object);
68 static void setPrivateObject(const TizenApis::Api::Calendar::CalendarEventPtr &event,
70 const JSObjectRef object);
72 static bool validate(JSContextRef ctx,
73 const JSObjectRef object,
74 JSValueRef* exception);
78 * This member variable contains the values which has to be passed when
79 * the this class is embedded into JS Engine.
81 static JSClassDefinition m_classInfo;
84 * This structure describes a statically declared function property.
86 static JSStaticFunction m_function[];
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.
93 static JSStaticValue m_property[];
95 static JSClassRef m_jsClassRef;
98 * The callback invoked when an object is first created.
100 static void initialize(JSContextRef context,
104 * The callback invoked when an object is finalized.
106 static void finalize(JSObjectRef object);
109 * Getters and setters for properties
111 static JSValueRef getPropertyDescription(JSContextRef context,
113 JSStringRef propertyName,
114 JSValueRef* exception);
115 static bool setPropertyDescription(JSContextRef context,
117 JSStringRef propertyName,
119 JSValueRef* exception);
120 static JSValueRef getPropertySummary(JSContextRef context,
122 JSStringRef propertyName,
123 JSValueRef* exception);
124 static bool setPropertySummary(JSContextRef context,
126 JSStringRef propertyName,
128 JSValueRef* exception);
129 static JSValueRef getPropertyStartTime(JSContextRef context,
131 JSStringRef propertyName,
132 JSValueRef* exception);
133 static bool setPropertyStartTime(JSContextRef context,
135 JSStringRef propertyName,
137 JSValueRef* exception);
138 static JSValueRef getPropertyLocation(JSContextRef context,
140 JSStringRef propertyName,
141 JSValueRef* exception);
142 static bool setPropertyLocation(JSContextRef context,
144 JSStringRef propertyName,
146 JSValueRef* exception);
147 static JSValueRef getPropertyGeolocation(JSContextRef context,
149 JSStringRef propertyName,
150 JSValueRef* exception);
151 static bool setPropertyGeolocation(JSContextRef context,
153 JSStringRef propertyName,
155 JSValueRef* exception);
156 static JSValueRef getPropertyOrganizer(JSContextRef context,
158 JSStringRef propertyName,
159 JSValueRef* exception);
160 static bool setPropertyOrganizer(JSContextRef context,
162 JSStringRef propertyName,
164 JSValueRef* exception);
165 static JSValueRef getPropertyVisibility(JSContextRef context,
167 JSStringRef propertyName,
168 JSValueRef* exception);
169 static bool setPropertyVisibility(JSContextRef context,
171 JSStringRef propertyName,
173 JSValueRef* exception);
174 static JSValueRef getPropertyStatus(JSContextRef context,
176 JSStringRef propertyName,
177 JSValueRef* exception);
178 static bool setPropertyStatus(JSContextRef context,
180 JSStringRef propertyName,
182 JSValueRef* exception);
183 static JSValueRef getPropertyAlarms(JSContextRef context,
185 JSStringRef propertyName,
186 JSValueRef* exception);
187 static bool setPropertyAlarms(JSContextRef context,
189 JSStringRef propertyName,
191 JSValueRef* exception);
192 static JSValueRef getPropertyCategories(JSContextRef context,
194 JSStringRef propertyName,
195 JSValueRef* exception);
196 static bool setPropertyCategories(JSContextRef context,
198 JSStringRef propertyName,
200 JSValueRef* exception);
201 static JSValueRef getPropertyIsAllDay(JSContextRef context,
203 JSStringRef propertyName,
204 JSValueRef* exception);
205 static bool setPropertyIsAllDay(JSContextRef context,
207 JSStringRef propertyName,
209 JSValueRef* exception);
210 static JSValueRef getPropertyDuration(JSContextRef context,
212 JSStringRef propertyName,
213 JSValueRef* exception);
214 static bool setPropertyDuration(JSContextRef context,
216 JSStringRef propertyName,
218 JSValueRef* exception);
219 static JSValueRef getPropertyAttendees(JSContextRef context,
221 JSStringRef propertyName,
222 JSValueRef* exception);
223 static bool setPropertyAttendees(JSContextRef context,
225 JSStringRef propertyName,
227 JSValueRef* exception);
228 static JSValueRef getPropertyAvailability(JSContextRef context,
230 JSStringRef propertyName,
231 JSValueRef* exception);
232 static bool setPropertyAvailability(JSContextRef context,
234 JSStringRef propertyName,
236 JSValueRef* exception);
237 static JSValueRef getPropertyRecurrenceRule(JSContextRef context,
239 JSStringRef propertyName,
240 JSValueRef* exception);
241 static bool setPropertyRecurrenceRule(JSContextRef context,
243 JSStringRef propertyName,
245 JSValueRef* exception);
246 static JSValueRef getPropertyDueDate(JSContextRef context,
248 JSStringRef propertyName,
249 JSValueRef* exception);
250 static bool setPropertyDueDate(JSContextRef context,
252 JSStringRef propertyName,
254 JSValueRef* exception);
255 static JSValueRef getPropertyCompletedDate(JSContextRef context,
257 JSStringRef propertyName,
258 JSValueRef* exception);
259 static bool setPropertyCompletedDate(JSContextRef context,
261 JSStringRef propertyName,
263 JSValueRef* exception);
264 static JSValueRef getPropertyProgress(JSContextRef context,
266 JSStringRef propertyName,
267 JSValueRef* exception);
268 static bool setPropertyProgress(JSContextRef context,
270 JSStringRef propertyName,
272 JSValueRef* exception);
273 static JSValueRef getPropertyPriority(JSContextRef context,
275 JSStringRef propertyName,
276 JSValueRef* exception);
277 static bool setPropertyPriority(JSContextRef context,
279 JSStringRef propertyName,
281 JSValueRef* exception);
282 static JSValueRef getPropertyEndDate(JSContextRef context,
284 JSStringRef propertyName,
285 JSValueRef* exception);
286 static bool setPropertyEndDate(JSContextRef context,
288 JSStringRef propertyName,
290 JSValueRef* exception);