Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Tizen / JSAttributeRangeFilter.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  * @file        JSAttributeRangeFilter.h
19  * @author      Kisub Song (kisubs.song@samsung.com)
20  * @version     0.1
21  * @brief       Declaration of the JSAttributeRangeFilter class
22  */
23
24 #ifndef _TIZEN_TIZEN_JS_ATTRIBUTE_RANGE_FILTER_H_
25 #define _TIZEN_TIZEN_JS_ATTRIBUTE_RANGE_FILTER_H_
26
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/AttributeRangeFilter.h>
32
33 namespace TizenApis {
34 namespace Tizen1_0 {
35 namespace Tizen {
36
37 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<TizenApis::Api::Tizen::AttributeRangeFilterPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSAttributeRangeFilterPriv;
38
39 class JSAttributeRangeFilter {
40 public:
41         /*
42         * This initializes this JS class in the JS Engine.
43         */
44         static JSClassRef getClassRef();
45
46         static bool isObjectOfClass(JSContextRef context, JSValueRef value);
47
48         static TizenApis::Api::Tizen::AttributeRangeFilterPtr getAttributeRangeFilter(JSContextRef context, JSValueRef value);
49
50 private:
51    /**
52         * The callback invoked when an object is first created.
53         */
54         static void Initialize(JSContextRef context, JSObjectRef object);
55
56    /**
57         * The callback invoked when an object is finalized.
58         */
59         static void Finalize(JSObjectRef object);
60
61    /**
62         * This structure contains properties and callbacks that define a type of object.
63         */
64         static JSClassDefinition m_classInfo;
65
66    /**
67         * This structure describes a statically declared function property.
68         */
69         static JSStaticFunction m_functions[];
70
71         /**
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
74          */
75         static JSStaticValue m_property[];
76
77         static JSClassRef m_classRef;
78
79         static JSObjectRef createJSObject(JSContextRef context,
80                         TizenApis::Api::Tizen::AttributeRangeFilterPtr privateData);
81
82         static TizenApis::Api::Tizen::AttributeRangeFilterPtr getPrivData(JSObjectRef object);
83
84         static JSObjectRef constructor(JSContextRef context,
85                         JSObjectRef constructor,
86                         size_t argumentCount,
87                         const JSValueRef arguments[],
88                         JSValueRef* exception);
89
90         static JSValueRef getAttributeName(JSContextRef context,
91                         JSObjectRef object,
92                         JSStringRef propertyName,
93                         JSValueRef* exception);
94
95         static bool setAttributeName(JSContextRef context,
96                         JSObjectRef object,
97                         JSStringRef propertyName,
98                         JSValueRef value,
99                         JSValueRef* exception);
100
101         static JSValueRef getInitialValue(JSContextRef context,
102                         JSObjectRef object,
103                         JSStringRef propertyName,
104                         JSValueRef* exception);
105
106         static bool setInitialValue(JSContextRef context,
107                         JSObjectRef object,
108                         JSStringRef propertyName,
109                         JSValueRef value,
110                         JSValueRef* exception);
111
112         static JSValueRef getEndValue(JSContextRef context,
113                         JSObjectRef object,
114                         JSStringRef propertyName,
115                         JSValueRef* exception);
116
117         static bool setEndValue(JSContextRef context,
118                         JSObjectRef object,
119                         JSStringRef propertyName,
120                         JSValueRef value,
121                         JSValueRef* exception);
122 };
123
124 } // Tizen
125 } // Tizen1_0
126 } // TizenApis
127
128 #endif // _TIZEN_TIZEN_JS_ATTRIBUTE_RANGE_FILTER_H_