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 #ifndef _TIZEN_CALENDAR_JS_STRING_ARRAY_H_
20 #define _TIZEN_CALENDAR_JS_STRING_ARRAY_H_
23 #include <JavaScriptCore/JavaScript.h>
24 #include <CommonsJavaScript/PrivateObject.h>
25 #include "CalendarEvent.h"
30 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<StringArrayPtr>::Type JSStringArrayPriv;
36 static const JSClassDefinition* getClassInfo();
38 static JSClassRef getClassRef();
40 static JSObjectRef createArray(JSContextRef context,
41 const StringArrayPtr &Strings);
43 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
45 static StringArrayPtr getStringArray(JSContextRef context, JSValueRef value);
50 * The callback invoked when an object is first created.
52 static void initialize(JSContextRef context,
56 * The callback invoked when an object is finalized.
58 static void finalize(JSObjectRef object);
60 static JSValueRef getLength(JSContextRef context,
62 JSStringRef propertyName,
63 JSValueRef* exception);
65 static bool hasProperty(JSContextRef context,
67 JSStringRef propertyName);
69 static JSValueRef getProperty(JSContextRef context,
71 JSStringRef propertyName,
72 JSValueRef* exception);
74 static bool setProperty(JSContextRef context,
76 JSStringRef propertyName,
78 JSValueRef* exception);
80 static void getPropertyNames(JSContextRef context,
82 JSPropertyNameAccumulatorRef propertyNames);
84 static JSValueRef concat(JSContextRef context,
86 JSObjectRef thisObject,
88 const JSValueRef arguments[],
89 JSValueRef* exception);
90 static JSValueRef join(JSContextRef context,
92 JSObjectRef thisObject,
94 const JSValueRef arguments[],
95 JSValueRef* exception);
96 static JSValueRef pop(JSContextRef context,
98 JSObjectRef thisObject,
100 const JSValueRef arguments[],
101 JSValueRef* exception);
102 static JSValueRef push(JSContextRef context,
103 JSObjectRef function,
104 JSObjectRef thisObject,
105 size_t argumentCount,
106 const JSValueRef arguments[],
107 JSValueRef* exception);
108 static JSValueRef reverse(JSContextRef context,
109 JSObjectRef function,
110 JSObjectRef thisObject,
111 size_t argumentCount,
112 const JSValueRef arguments[],
113 JSValueRef* exception);
114 static JSValueRef shift(JSContextRef context,
115 JSObjectRef function,
116 JSObjectRef thisObject,
117 size_t argumentCount,
118 const JSValueRef arguments[],
119 JSValueRef* exception);
120 static JSValueRef slice(JSContextRef context,
121 JSObjectRef function,
122 JSObjectRef thisObject,
123 size_t argumentCount,
124 const JSValueRef arguments[],
125 JSValueRef* exception);
126 static JSValueRef sort(JSContextRef context,
127 JSObjectRef function,
128 JSObjectRef thisObject,
129 size_t argumentCount,
130 const JSValueRef arguments[],
131 JSValueRef* exception);
132 static JSValueRef splice(JSContextRef context,
133 JSObjectRef function,
134 JSObjectRef thisObject,
135 size_t argumentCount,
136 const JSValueRef arguments[],
137 JSValueRef* exception);
138 static JSValueRef toString(JSContextRef context,
139 JSObjectRef function,
140 JSObjectRef thisObject,
141 size_t argumentCount,
142 const JSValueRef arguments[],
143 JSValueRef* exception);
144 static JSValueRef unshift(JSContextRef context,
145 JSObjectRef function,
146 JSObjectRef thisObject,
147 size_t argumentCount,
148 const JSValueRef arguments[],
149 JSValueRef* exception);
150 static JSValueRef valueOf(JSContextRef context,
151 JSObjectRef function,
152 JSObjectRef thisObject,
153 size_t argumentCount,
154 const JSValueRef arguments[],
155 JSValueRef* exception);
157 static bool checkValue(const std::string &value);
159 static JSClassRef m_jsClassRef;
161 * This structure describes a statically declared function property.
163 static JSStaticFunction m_function[];
166 * This structure contains properties and callbacks that define a type of object.
168 static JSClassDefinition m_classInfo;
171 * This member variable contains the initialization values for the static properties of this class.
172 * The values are given according to the data structure JSPropertySpec
174 static JSStaticValue m_property[];
180 #endif // _TIZEN_CALENDAR_JS_STRING_ARRAY_H_