Update change log and spec for wrt-plugins-tizen_0.2.84
[framework/web/wrt-plugins-tizen.git] / src / standards / Tizen / Calendar / JSStringArray.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17
18 #ifndef _TIZEN_CALENDAR_JS_STRING_ARRAY_H_
19 #define _TIZEN_CALENDAR_JS_STRING_ARRAY_H_
20
21 #include <vector>
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include <API/Calendar/CalendarEvent.h>
25
26 namespace TizenApis {
27 namespace Tizen1_0 {
28 namespace Calendar {
29
30 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<TizenApis::Api::Calendar::StringArrayPtr>::Type JSStringArrayPriv;
31
32 class JSStringArray
33 {
34 public:
35
36         static const JSClassDefinition* getClassInfo();
37
38         static JSClassRef getClassRef();
39
40         static JSObjectRef createArray(JSContextRef context,
41                         const TizenApis::Api::Calendar::StringArrayPtr &Strings);
42
43         static bool isObjectOfClass(JSContextRef context, JSValueRef value);
44
45         static TizenApis::Api::Calendar::StringArrayPtr getStringArray(JSContextRef context, JSValueRef value);
46
47 private:
48
49         /**
50          * The callback invoked when an object is first created.
51          */
52         static void initialize(JSContextRef context,
53                         JSObjectRef object);
54
55         /**
56          * The callback invoked when an object is finalized.
57          */
58         static void finalize(JSObjectRef object);
59
60         static JSValueRef getLength(JSContextRef context,
61                         JSObjectRef object,
62                         JSStringRef propertyName,
63                         JSValueRef* exception);
64
65         static bool hasProperty(JSContextRef context,
66                         JSObjectRef object,
67                         JSStringRef propertyName);
68
69         static JSValueRef getProperty(JSContextRef context,
70                         JSObjectRef object,
71                         JSStringRef propertyName,
72                         JSValueRef* exception);
73
74         static bool setProperty(JSContextRef context,
75                         JSObjectRef object,
76                         JSStringRef propertyName,
77                         JSValueRef value,
78                         JSValueRef* exception);
79
80         static void getPropertyNames(JSContextRef context,
81                         JSObjectRef object,
82                         JSPropertyNameAccumulatorRef propertyNames);
83
84         static JSValueRef concat(JSContextRef context,
85                         JSObjectRef function,
86                         JSObjectRef thisObject,
87                         size_t argumentCount,
88                         const JSValueRef arguments[],
89                         JSValueRef* exception);
90         static JSValueRef join(JSContextRef context,
91                         JSObjectRef function,
92                         JSObjectRef thisObject,
93                         size_t argumentCount,
94                         const JSValueRef arguments[],
95                         JSValueRef* exception);
96         static JSValueRef pop(JSContextRef context,
97                         JSObjectRef function,
98                         JSObjectRef thisObject,
99                         size_t argumentCount,
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);
156
157         static bool checkValue(const std::string &value);
158
159         static JSClassRef m_jsClassRef;
160         /**
161          * This structure describes a statically declared function property.
162          */
163         static JSStaticFunction m_function[];
164
165         /**
166          * This structure contains properties and callbacks that define a type of object.
167          */
168         static JSClassDefinition m_classInfo;
169
170         /**
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
173          */
174         static JSStaticValue m_property[];
175 };
176
177 } // Calendar
178 } // Tizen1_0
179 } // TizenApis
180
181 #endif // _TIZEN_CALENDAR_JS_STRING_ARRAY_H_