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.
18 #ifndef _TIZEN_CALENDAR_JS_STRING_ARRAY_H_
19 #define _TIZEN_CALENDAR_JS_STRING_ARRAY_H_
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include <API/Calendar/CalendarEvent.h>
30 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<TizenApis::Api::Calendar::StringArrayPtr>::Type JSStringArrayPriv;
36 static const JSClassDefinition* getClassInfo();
38 static JSClassRef getClassRef();
40 static JSObjectRef createArray(JSContextRef context,
41 const TizenApis::Api::Calendar::StringArrayPtr &Strings);
43 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
45 static TizenApis::Api::Calendar::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[];
181 #endif // _TIZEN_CALENDAR_JS_STRING_ARRAY_H_