17b7334ae6f7d1d3b426cbeb2fed0f3322e33fb3
[framework/web/wrt-plugins-tizen.git] / src / Tizen / JSAttributeRangeFilter.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file        JSAttributeRangeFilter.h
20  * @author      Kisub Song (kisubs.song@samsung.com)
21  * @version     0.1
22  * @brief       Declaration of the JSAttributeRangeFilter class
23  */
24
25 #ifndef _TIZEN_TIZEN_JS_ATTRIBUTE_RANGE_FILTER_H_
26 #define _TIZEN_TIZEN_JS_ATTRIBUTE_RANGE_FILTER_H_
27
28 #include <JavaScriptCore/JavaScript.h>
29 #include <dpl/shared_ptr.h>
30 #include <CommonsJavaScript/PrivateObject.h>
31 #include <Commons/IEvent.h>
32 #include "AttributeRangeFilter.h"
33
34 namespace DeviceAPI {\rnamespace Tizen {
35
36 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<DeviceAPI::Tizen::AttributeRangeFilterPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSAttributeRangeFilterPriv;
37
38 class JSAttributeRangeFilter {
39 public:
40         /*
41         * This initializes this JS class in the JS Engine.
42         */
43         static JSClassRef getClassRef();
44
45         static bool isObjectOfClass(JSContextRef context, JSValueRef value);
46
47         static DeviceAPI::Tizen::AttributeRangeFilterPtr getAttributeRangeFilter(JSContextRef context, JSValueRef value);
48
49         static JSObjectRef createJSObject(JSContextRef context,
50                         DeviceAPI::Tizen::AttributeRangeFilterPtr privateData);
51
52 private:
53    /**
54         * The callback invoked when an object is first created.
55         */
56         static void Initialize(JSContextRef context, JSObjectRef object);
57
58    /**
59         * The callback invoked when an object is finalized.
60         */
61         static void Finalize(JSObjectRef object);
62
63    /**
64         * This structure contains properties and callbacks that define a type of object.
65         */
66         static JSClassDefinition m_classInfo;
67
68    /**
69         * This structure describes a statically declared function property.
70         */
71         static JSStaticFunction m_functions[];
72
73         /**
74          * This member variable contains the initialization values for the static properties of this class.
75          * The values are given according to the data structure JSPropertySpec
76          */
77         static JSStaticValue m_property[];
78
79         static JSClassRef m_classRef;
80
81         static DeviceAPI::Tizen::AttributeRangeFilterPtr getPrivData(JSObjectRef object);
82
83         static JSObjectRef constructor(JSContextRef context,
84                         JSObjectRef constructor,
85                         size_t argumentCount,
86                         const JSValueRef arguments[],
87                         JSValueRef* exception);
88
89         static JSValueRef getAttributeName(JSContextRef context,
90                         JSObjectRef object,
91                         JSStringRef propertyName,
92                         JSValueRef* exception);
93
94         static bool setAttributeName(JSContextRef context,
95                         JSObjectRef object,
96                         JSStringRef propertyName,
97                         JSValueRef value,
98                         JSValueRef* exception);
99
100         static JSValueRef getInitialValue(JSContextRef context,
101                         JSObjectRef object,
102                         JSStringRef propertyName,
103                         JSValueRef* exception);
104
105         static bool setInitialValue(JSContextRef context,
106                         JSObjectRef object,
107                         JSStringRef propertyName,
108                         JSValueRef value,
109                         JSValueRef* exception);
110
111         static JSValueRef getEndValue(JSContextRef context,
112                         JSObjectRef object,
113                         JSStringRef propertyName,
114                         JSValueRef* exception);
115
116         static bool setEndValue(JSContextRef context,
117                         JSObjectRef object,
118                         JSStringRef propertyName,
119                         JSValueRef value,
120                         JSValueRef* exception);
121 };
122
123 } // Tizen
124 } // DeviceAPI
125
126
127 #endif // _TIZEN_TIZEN_JS_ATTRIBUTE_RANGE_FILTER_H_