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.
17 #ifndef TIZENAPIS_TIZEN_JS_APPLICATION_INFORMATION_ARRAY_H_
18 #define TIZENAPIS_TIZEN_JS_APPLICATION_INFORMATION_ARRAY_H_
20 #include <JavaScriptCore/JavaScript.h>
21 #include <CommonsJavaScript/PrivateObject.h>
22 #include <API/Application/ApplicationInformation.h>
26 namespace Application {
28 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<Api::Application::ApplicationInformationArrayPtr>::Type JSApplicationInformationArrayPriv;
30 class JSApplicationInformationArray
34 static const JSClassDefinition* getClassInfo();
36 static JSClassRef getClassRef();
38 static JSObjectRef createArray(JSContextRef context,
39 const Api::Application::ApplicationInformationArrayPtr &appinfoArray);
41 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
43 static Api::Application::ApplicationInformationArrayPtr
44 getApplicationInformationArray(JSContextRef context, JSValueRef value);
49 * The callback invoked when an object is first created.
51 static void initialize(JSContextRef context,
55 * The callback invoked when an object is finalized.
57 static void finalize(JSObjectRef object);
59 static JSValueRef getLength(JSContextRef context,
61 JSStringRef propertyName,
62 JSValueRef* exception);
64 static bool hasProperty(JSContextRef context,
66 JSStringRef propertyName);
68 static JSValueRef getProperty(JSContextRef context,
70 JSStringRef propertyName,
71 JSValueRef* exception);
73 static bool setProperty(JSContextRef context,
75 JSStringRef propertyName,
77 JSValueRef* exception);
79 static JSValueRef concat(JSContextRef context,
81 JSObjectRef thisObject,
83 const JSValueRef arguments[],
84 JSValueRef* exception);
85 static JSValueRef join(JSContextRef context,
87 JSObjectRef thisObject,
89 const JSValueRef arguments[],
90 JSValueRef* exception);
91 static JSValueRef pop(JSContextRef context,
93 JSObjectRef thisObject,
95 const JSValueRef arguments[],
96 JSValueRef* exception);
97 static JSValueRef push(JSContextRef context,
99 JSObjectRef thisObject,
100 size_t argumentCount,
101 const JSValueRef arguments[],
102 JSValueRef* exception);
103 static JSValueRef reverse(JSContextRef context,
104 JSObjectRef function,
105 JSObjectRef thisObject,
106 size_t argumentCount,
107 const JSValueRef arguments[],
108 JSValueRef* exception);
109 static JSValueRef shift(JSContextRef context,
110 JSObjectRef function,
111 JSObjectRef thisObject,
112 size_t argumentCount,
113 const JSValueRef arguments[],
114 JSValueRef* exception);
115 static JSValueRef slice(JSContextRef context,
116 JSObjectRef function,
117 JSObjectRef thisObject,
118 size_t argumentCount,
119 const JSValueRef arguments[],
120 JSValueRef* exception);
121 static JSValueRef sort(JSContextRef context,
122 JSObjectRef function,
123 JSObjectRef thisObject,
124 size_t argumentCount,
125 const JSValueRef arguments[],
126 JSValueRef* exception);
127 static JSValueRef splice(JSContextRef context,
128 JSObjectRef function,
129 JSObjectRef thisObject,
130 size_t argumentCount,
131 const JSValueRef arguments[],
132 JSValueRef* exception);
133 static JSValueRef toString(JSContextRef context,
134 JSObjectRef function,
135 JSObjectRef thisObject,
136 size_t argumentCount,
137 const JSValueRef arguments[],
138 JSValueRef* exception);
139 static JSValueRef unshift(JSContextRef context,
140 JSObjectRef function,
141 JSObjectRef thisObject,
142 size_t argumentCount,
143 const JSValueRef arguments[],
144 JSValueRef* exception);
145 static JSValueRef valueOf(JSContextRef context,
146 JSObjectRef function,
147 JSObjectRef thisObject,
148 size_t argumentCount,
149 const JSValueRef arguments[],
150 JSValueRef* exception);
152 static bool checkValue(const std::string &value);
154 static JSClassRef m_jsClassRef;
156 * This structure describes a statically declared function property.
158 static JSStaticFunction m_function[];
161 * This structure contains properties and callbacks that define a type of object.
163 static JSClassDefinition m_classInfo;
166 * This member variable contains the initialization values for the static properties of this class.
167 * The values are given according to the data structure JSPropertySpec
169 static JSStaticValue m_property[];