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.
20 * @author Kisub Song (kisubs.song@samsung.com)
22 * @brief Declaration of the JSSortMode class
25 #ifndef _TIZEN_TIZEN_JS_SORT_MODE_H_
26 #define _TIZEN_TIZEN_JS_SORT_MODE_H_
28 #include <JavaScriptCore/JavaScript.h>
29 #include <dpl/shared_ptr.h>
30 #include <CommonsJavaScript/PrivateObject.h>
31 #include <Commons/IEvent.h>
34 namespace DeviceAPI {
\rnamespace Tizen {
36 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<DeviceAPI::Tizen::SortModePtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSSortModePriv;
41 * This initializes this JS class in the JS Engine.
43 static JSClassRef getClassRef();
45 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
47 static DeviceAPI::Tizen::SortModePtr getSortMode(JSContextRef context, JSValueRef value);
49 static JSObjectRef createJSObject(JSContextRef context, DeviceAPI::Tizen::SortModePtr privateData);
53 * The callback invoked when an object is first created.
55 static void Initialize(JSContextRef context, JSObjectRef object);
58 * The callback invoked when an object is finalized.
60 static void Finalize(JSObjectRef object);
63 * This structure contains properties and callbacks that define a type of object.
65 static JSClassDefinition m_classInfo;
68 * This structure describes a statically declared function property.
70 static JSStaticFunction m_functions[];
73 * This member variable contains the initialization values for the static properties of this class.
74 * The values are given according to the data structure JSPropertySpec
76 static JSStaticValue m_property[];
78 static JSClassRef m_classRef;
80 static DeviceAPI::Tizen::SortModePtr getPrivData(JSObjectRef object);
82 static JSObjectRef constructor(JSContextRef context,
83 JSObjectRef constructor,
85 const JSValueRef arguments[],
86 JSValueRef* exception);
88 static JSValueRef getAttributeName(JSContextRef context,
90 JSStringRef propertyName,
91 JSValueRef* exception);
93 static bool setAttributeName(JSContextRef context,
95 JSStringRef propertyName,
97 JSValueRef* exception);
99 static JSValueRef getOrder(JSContextRef context,
101 JSStringRef propertyName,
102 JSValueRef* exception);
104 static bool setOrder(JSContextRef context,
106 JSStringRef propertyName,
108 JSValueRef* exception);
115 #endif // _TIZEN_TIZEN_JS_SORT_MODE_H_