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 * @file JSSimpleCoordinates.h
19 * @author Kisub Song (kisubs.song@samsung.com)
21 * @brief Declaration of the JSSimpleCoordinates class
24 #ifndef _TIZEN_TIZEN_JS_SIMPLE_COORDINATES_H_
25 #define _TIZEN_TIZEN_JS_SIMPLE_COORDINATES_H_
27 #include <JavaScriptCore/JavaScript.h>
28 #include <dpl/shared_ptr.h>
29 #include <CommonsJavaScript/PrivateObject.h>
30 #include <Commons/IEvent.h>
31 #include <API/Filter/SimpleCoordinates.h>
37 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<TizenApis::Api::Tizen::SimpleCoordinatesPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSSimpleCoordinatesPriv;
39 class JSSimpleCoordinates {
42 * This initializes this JS class in the JS Engine.
44 static JSClassRef getClassRef();
46 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
48 static TizenApis::Api::Tizen::SimpleCoordinatesPtr getSimpleCoordinates(JSContextRef context, JSValueRef value);
52 * The callback invoked when an object is first created.
54 static void Initialize(JSContextRef context, JSObjectRef object);
57 * The callback invoked when an object is finalized.
59 static void Finalize(JSObjectRef object);
62 * This structure contains properties and callbacks that define a type of object.
64 static JSClassDefinition m_classInfo;
67 * This structure describes a statically declared function property.
69 static JSStaticFunction m_functions[];
72 * This member variable contains the initialization values for the static properties of this class.
73 * The values are given according to the data structure JSPropertySpec
75 static JSStaticValue m_property[];
77 static JSClassRef m_classRef;
79 static JSObjectRef createJSObject(JSContextRef context, TizenApis::Api::Tizen::SimpleCoordinatesPtr privateData);
81 static TizenApis::Api::Tizen::SimpleCoordinatesPtr getPrivData(JSObjectRef object);
83 static JSObjectRef constructor(JSContextRef context,
84 JSObjectRef constructor,
86 const JSValueRef arguments[],
87 JSValueRef* exception);
89 static JSValueRef getLatitude(JSContextRef context,
91 JSStringRef propertyName,
92 JSValueRef* exception);
94 static bool setLatitude(JSContextRef context,
96 JSStringRef propertyName,
98 JSValueRef* exception);
100 static JSValueRef getLongitude(JSContextRef context,
102 JSStringRef propertyName,
103 JSValueRef* exception);
105 static bool setLongitude(JSContextRef context,
107 JSStringRef propertyName,
109 JSValueRef* exception);
116 #endif // _TIZEN_TIZEN_JS_SIMPLE_COORDINATES_H_