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_CALEMDAR_EVENT_ID_H_
19 #define _JS_CALEMDAR_EVENT_ID_H_
21 #include <JavaScriptCore/JavaScript.h>
22 #include <CommonsJavaScript/PrivateObject.h>
23 #include <API/Calendar/EventId.h>
29 #define TIZEN_INTERFACE_CALENDAR_EVENT_ID "CalendarEventId"
31 #define TIZEN_CALENDAR_EVENT_ID_UID "uid"
32 #define TIZEN_CALENDAR_EVENT_ID_RECURRENCEID "recurrenceId"
34 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<TizenApis::Api::Calendar::EventIdPtr,
35 WrtDeviceApis::CommonsJavaScript::NoOwnership> EventIdPrivateObject;
37 class JSCalendarEventId
41 static const JSClassDefinition* getClassInfo();
43 static JSClassRef getClassRef();
45 static JSObjectRef createJSCalendarEventId(JSContextRef context, TizenApis::Api::Calendar::EventIdPtr eventId);
47 static TizenApis::Api::Calendar::EventIdPtr getPrivateObject(JSObjectRef object);
49 static void setPrivateObject(const TizenApis::Api::Calendar::EventIdPtr &eventId,
51 const JSObjectRef object);
56 * The callback invoked when an object is first created.
58 static void initialize(JSContextRef context, JSObjectRef object);
61 * The callback invoked when an object is finalized.
63 static void finalize(JSObjectRef object);
66 * Constructor for the CalendarEventId interface.
68 static JSObjectRef constructor(JSContextRef context,
69 JSObjectRef constructor,
71 const JSValueRef arguments[],
72 JSValueRef* exception);
74 static JSValueRef getProperty(JSContextRef context,
76 JSStringRef propertyName,
77 JSValueRef* exception);
79 static bool setProperty(JSContextRef context,
81 JSStringRef propertyName,
83 JSValueRef* exception);
85 static JSClassRef m_jsClassRef;
88 * This structure describes a statically declared function property.
90 static JSStaticFunction m_function[];
93 * This structure contains properties and callbacks that define a type of object.
95 static JSClassDefinition m_classInfo;
98 * This member variable contains the initialization values for the static properties of this class.
99 * The values are given according to the data structure JSPropertySpec
101 static JSStaticValue m_property[];
108 #endif /* _JS_CALEMDAR_EVENT_ID_H_ */