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.
19 * @file JSAbstractFilterArray.h
20 * @author Kisub Song (kisubs.song@samsung.com)
25 #ifndef _TIZEN_TIZEN_JS_ABSTRACT_FILTER_ARRAY_H_
26 #define _TIZEN_TIZEN_JS_ABSTRACT_FILTER_ARRAY_H_
28 #include <JavaScriptCore/JavaScript.h>
29 #include <CommonsJavaScript/PrivateObject.h>
32 namespace DeviceAPI {
\rnamespace Tizen {
34 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT< DeviceAPI::Tizen::FilterArrayPtr >::Type JSAbstractFilterArrayPriv;
36 class JSAbstractFilterArray
40 static const JSClassDefinition* getClassInfo();
42 static JSClassRef getClassRef();
44 static JSObjectRef createArray(JSContextRef context,
45 const DeviceAPI::Tizen::FilterArrayPtr &filterArray);
47 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
49 static DeviceAPI::Tizen::FilterArrayPtr getAbstractFilterArray(JSContextRef context, JSValueRef value);
54 * The callback invoked when an object is first created.
56 static void initialize(JSContextRef context,
60 * The callback invoked when an object is finalized.
62 static void finalize(JSObjectRef object);
64 static JSValueRef getLength(JSContextRef context,
66 JSStringRef propertyName,
67 JSValueRef* exception);
69 static bool hasProperty(JSContextRef context,
71 JSStringRef propertyName);
73 static JSValueRef getProperty(JSContextRef context,
75 JSStringRef propertyName,
76 JSValueRef* exception);
78 static bool setProperty(JSContextRef context,
80 JSStringRef propertyName,
82 JSValueRef* exception);
84 static void getPropertyNames(JSContextRef context,
86 JSPropertyNameAccumulatorRef propertyNames);
88 static JSValueRef concat(JSContextRef context,
90 JSObjectRef thisObject,
92 const JSValueRef arguments[],
93 JSValueRef* exception);
94 static JSValueRef join(JSContextRef context,
96 JSObjectRef thisObject,
98 const JSValueRef arguments[],
99 JSValueRef* exception);
100 static JSValueRef pop(JSContextRef context,
101 JSObjectRef function,
102 JSObjectRef thisObject,
103 size_t argumentCount,
104 const JSValueRef arguments[],
105 JSValueRef* exception);
106 static JSValueRef push(JSContextRef context,
107 JSObjectRef function,
108 JSObjectRef thisObject,
109 size_t argumentCount,
110 const JSValueRef arguments[],
111 JSValueRef* exception);
112 static JSValueRef reverse(JSContextRef context,
113 JSObjectRef function,
114 JSObjectRef thisObject,
115 size_t argumentCount,
116 const JSValueRef arguments[],
117 JSValueRef* exception);
118 static JSValueRef shift(JSContextRef context,
119 JSObjectRef function,
120 JSObjectRef thisObject,
121 size_t argumentCount,
122 const JSValueRef arguments[],
123 JSValueRef* exception);
124 static JSValueRef slice(JSContextRef context,
125 JSObjectRef function,
126 JSObjectRef thisObject,
127 size_t argumentCount,
128 const JSValueRef arguments[],
129 JSValueRef* exception);
130 static JSValueRef sort(JSContextRef context,
131 JSObjectRef function,
132 JSObjectRef thisObject,
133 size_t argumentCount,
134 const JSValueRef arguments[],
135 JSValueRef* exception);
136 static JSValueRef splice(JSContextRef context,
137 JSObjectRef function,
138 JSObjectRef thisObject,
139 size_t argumentCount,
140 const JSValueRef arguments[],
141 JSValueRef* exception);
142 static JSValueRef toString(JSContextRef context,
143 JSObjectRef function,
144 JSObjectRef thisObject,
145 size_t argumentCount,
146 const JSValueRef arguments[],
147 JSValueRef* exception);
148 static JSValueRef unshift(JSContextRef context,
149 JSObjectRef function,
150 JSObjectRef thisObject,
151 size_t argumentCount,
152 const JSValueRef arguments[],
153 JSValueRef* exception);
154 static JSValueRef valueOf(JSContextRef context,
155 JSObjectRef function,
156 JSObjectRef thisObject,
157 size_t argumentCount,
158 const JSValueRef arguments[],
159 JSValueRef* exception);
160 static JSValueRef constructor(JSContextRef context,
161 JSObjectRef function,
162 JSObjectRef thisObject,
163 size_t argumentCount,
164 const JSValueRef arguments[],
165 JSValueRef* exception);
167 static bool checkValue(const std::string &value);
169 static JSClassRef m_jsClassRef;
171 * This structure describes a statically declared function property.
173 static JSStaticFunction m_function[];
176 * This structure contains properties and callbacks that define a type of object.
178 static JSClassDefinition m_classInfo;
181 * This member variable contains the initialization values for the static properties of this class.
182 * The values are given according to the data structure JSPropertySpec
184 static JSStaticValue m_property[];
191 #endif // _TIZEN_TIZEN_JS_ABSTRACT_FILTER_ARRAY_H_