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.
19 * @file JSFeatureArray.h
20 * @author Jihwa Park (jh7979.park@samsung.com)
25 #ifndef _JS_FEATURE_ARRAY_H_
26 #define _JS_FEATURE_ARRAY_H_
30 #include <JavaScriptCore/JavaScript.h>
31 #include <CommonsJavaScript/PrivateObject.h>
32 #include <API/Account/EventAccount.h>
35 using namespace TizenApis::Api::Account;
36 using namespace WrtDeviceApis::Commons;
37 using namespace WrtDeviceApis::CommonsJavaScript;
42 typedef PrivateObjectT<FeatureListPtr>::Type
43 JSFeatureArrayPrivate;
49 static const JSClassDefinition* getClassInfo();
51 static JSClassRef getClassRef();
53 static JSObjectRef createArray(JSContextRef context,
54 const FeatureListPtr &categories);
56 static FeatureListPtr getFeatures(JSContextRef context,
62 * The callback invoked when an object is first created.
64 static void initialize(JSContextRef context,
68 * The callback invoked when an object is finalized.
70 static void finalize(JSObjectRef object);
72 static JSValueRef getLength(JSContextRef context,
74 JSStringRef propertyName,
75 JSValueRef* exception);
77 static bool hasProperty(JSContextRef context,
79 JSStringRef propertyName);
81 static JSValueRef getProperty(JSContextRef context,
83 JSStringRef propertyName,
84 JSValueRef* exception);
86 static bool setProperty(JSContextRef context,
88 JSStringRef propertyName,
90 JSValueRef* exception);
92 static JSValueRef concat(JSContextRef context,
94 JSObjectRef thisObject,
96 const JSValueRef arguments[],
97 JSValueRef* exception);
98 static JSValueRef join(JSContextRef context,
100 JSObjectRef thisObject,
101 size_t argumentCount,
102 const JSValueRef arguments[],
103 JSValueRef* exception);
104 static JSValueRef pop(JSContextRef context,
105 JSObjectRef function,
106 JSObjectRef thisObject,
107 size_t argumentCount,
108 const JSValueRef arguments[],
109 JSValueRef* exception);
110 static JSValueRef push(JSContextRef context,
111 JSObjectRef function,
112 JSObjectRef thisObject,
113 size_t argumentCount,
114 const JSValueRef arguments[],
115 JSValueRef* exception);
116 static JSValueRef reverse(JSContextRef context,
117 JSObjectRef function,
118 JSObjectRef thisObject,
119 size_t argumentCount,
120 const JSValueRef arguments[],
121 JSValueRef* exception);
122 static JSValueRef shift(JSContextRef context,
123 JSObjectRef function,
124 JSObjectRef thisObject,
125 size_t argumentCount,
126 const JSValueRef arguments[],
127 JSValueRef* exception);
128 static JSValueRef slice(JSContextRef context,
129 JSObjectRef function,
130 JSObjectRef thisObject,
131 size_t argumentCount,
132 const JSValueRef arguments[],
133 JSValueRef* exception);
134 static JSValueRef sort(JSContextRef context,
135 JSObjectRef function,
136 JSObjectRef thisObject,
137 size_t argumentCount,
138 const JSValueRef arguments[],
139 JSValueRef* exception);
140 static JSValueRef splice(JSContextRef context,
141 JSObjectRef function,
142 JSObjectRef thisObject,
143 size_t argumentCount,
144 const JSValueRef arguments[],
145 JSValueRef* exception);
146 static JSValueRef toString(JSContextRef context,
147 JSObjectRef function,
148 JSObjectRef thisObject,
149 size_t argumentCount,
150 const JSValueRef arguments[],
151 JSValueRef* exception);
152 static JSValueRef unshift(JSContextRef context,
153 JSObjectRef function,
154 JSObjectRef thisObject,
155 size_t argumentCount,
156 const JSValueRef arguments[],
157 JSValueRef* exception);
158 static JSValueRef valueOf(JSContextRef context,
159 JSObjectRef function,
160 JSObjectRef thisObject,
161 size_t argumentCount,
162 const JSValueRef arguments[],
163 JSValueRef* exception);
165 static JSClassRef m_jsClassRef;
167 * This structure describes a statically declared function property.
169 static JSStaticFunction m_function[];
172 * This structure contains properties and callbacks that define a type of object.
174 static JSClassDefinition m_classInfo;
177 * This member variable contains the initialization values for the static properties of this class.
178 * The values are given according to the data structure JSPropertySpec
180 static JSStaticValue m_property[];
186 #endif /* _JS_ARRAY_H_ */