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_TASK_H_
20 #define _JS_CALENDAR_TASK_H_
22 #include <JavaScriptCore/JavaScript.h>
23 #include "CalendarEvent.h"
24 #include <CommonsJavaScript/PrivateObject.h>
29 #define TIZEN_INTERFACE_CALENDAR_TASK "CalendarTask"
31 #define TIZEN_CALENDAR_TASK_ID "id"
32 #define TIZEN_CALENDAR_TASK_LAST_MODIFICATION_DATE "lastModificationDate"
34 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<CalendarEventPtr,
35 WrtDeviceApis::CommonsJavaScript::NoOwnership> CalendarTaskPrivObject;
41 static const JSClassDefinition* getClassInfo();
43 static const JSClassRef getClassRef();
45 static CalendarEventPtr getPrivateObject(JSObjectRef object);
47 static void setPrivateObject(const CalendarEventPtr &event,
49 const JSObjectRef object);
51 static bool validate(JSContextRef ctx,
52 const JSObjectRef object,
53 JSValueRef* exception);
55 static JSObjectRef createJSCalendarTask(JSContextRef context, CalendarEventPtr task);
59 * This member variable contains the values which has to be passed when
60 * the this class is embedded into JS Engine.
62 static JSClassDefinition m_classInfo;
65 * This structure describes a statically declared function property.
67 static JSStaticFunction m_function[];
70 * This member variable contains the initialization values for the
71 * properties of this class. The values are given according to the
72 * data structure JSPropertySpec.
74 static JSStaticValue m_property[];
76 static JSClassRef m_jsClassRef;
79 * The calendar object to be used for asynchronous platform function invocation.
81 static ICalendarPtr m_calendar;
84 * The callback invoked when an object is first created.
86 static void initialize(JSContextRef context,
90 * The callback invoked when an object is finalized.
92 static void finalize(JSObjectRef object);
95 * Constructor for the CalendarTask interface.
97 static JSObjectRef constructor(JSContextRef context,
98 JSObjectRef constructor,
100 const JSValueRef arguments[],
101 JSValueRef* exception);
104 * Getters and setters for properties
106 static JSValueRef getPropertyId(JSContextRef context,
108 JSStringRef propertyName,
109 JSValueRef* exception);
115 #endif /* _JS_CALENDAR_TASK_H_ */