Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Calendar / JSCalendarItemGeo.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17  
18 #ifndef _JS_CALENDAR_ITEM_GEO_H_
19 #define _JS_CALENDAR_ITEM_GEO_H_
20
21 #include <JavaScriptCore/JavaScript.h>
22 #include <CommonsJavaScript/PrivateObject.h>
23 #include <API/Calendar/CalendarItemGeo.h>
24
25 namespace TizenApis {
26 namespace Tizen1_0 {
27 namespace Calendar {
28
29 #define TIZEN_CALENDAR_ITEM_GEO_LATITUDE "latitude"
30 #define TIZEN_CALENDAR_ITEM_GEO_LONGITUDE "longitude"
31
32 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<TizenApis::Api::Calendar::CalendarItemGeoPtr,
33                                WrtDeviceApis::CommonsJavaScript::NoOwnership> CalendarItemGeoPrivateObject;
34
35 class JSCalendarItemGeo
36 {
37   public:
38
39     static const JSClassDefinition* getClassInfo();
40
41     static JSClassRef getClassRef();
42
43     static TizenApis::Api::Calendar::CalendarItemGeoPtr getPrivateObject(JSObjectRef object);
44
45         static JSObjectRef createJSCalendarItemGeo(JSContextRef context, TizenApis::Api::Calendar::CalendarItemGeoPtr geo);
46
47   private:
48
49     /**
50      * The callback invoked when an object is first created.
51      */
52     static void initialize(JSContextRef context, JSObjectRef object);
53
54     /**
55      * The callback invoked when an object is finalized.
56      */
57     static void finalize(JSObjectRef object);
58
59     static JSValueRef getProperty(JSContextRef context,
60             JSObjectRef object,
61             JSStringRef propertyName,
62             JSValueRef* exception);
63
64     static bool setProperty(JSContextRef context,
65             JSObjectRef object,
66             JSStringRef propertyName,
67             JSValueRef value,
68             JSValueRef* exception);
69
70     static JSClassRef m_jsClassRef;
71
72     /**
73      * This structure describes a statically declared function property.
74      */
75     static JSStaticFunction m_function[];
76
77     /**
78      * This structure contains properties and callbacks that define a type of object.
79      */
80     static JSClassDefinition m_classInfo;
81
82     /**
83      * This member variable contains the initialization values for the static properties of this class.
84      * The values are given according to the data structure JSPropertySpec
85      */
86     static JSStaticValue m_property[];
87 };
88
89 }
90 }
91 }
92
93 #endif /* _JS_CALENDAR_ITEM_GEO_H_ */