Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Contact / JSContactEmailAddressTypeArray.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  * @file        JSContactEmailAddressTypeArray.h
19  * @author      Kisub Song (kisubs.song@samsung.com)
20  * @version     0.1
21  * @brief
22  */
23
24 #ifndef _TIZEN_CONTACT_JS_CONTACT_EMAIL_ADDRESS_TYPE_ARRAY_H_
25 #define _TIZEN_CONTACT_JS_CONTACT_EMAIL_ADDRESS_TYPE_ARRAY_H_
26
27 #include <vector>
28 #include <JavaScriptCore/JavaScript.h>
29 #include <CommonsJavaScript/PrivateObject.h>
30 #include <API/Contact/ContactEmailAddress.h>
31
32 namespace TizenApis {
33 namespace Tizen1_0 {
34 namespace Contact {
35
36 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<TizenApis::Api::Contact::ContactEmailAddressTypeArrayPtr>::Type JSContactEmailAddressTypeArrayPriv;
37
38 class JSContactEmailAddressTypeArray
39 {
40 public:
41
42         static const JSClassDefinition* getClassInfo();
43
44         static JSClassRef getClassRef();
45
46         static JSObjectRef createArray(JSContextRef context,
47                         const TizenApis::Api::Contact::ContactEmailAddressTypeArrayPtr &Strings);
48
49         static bool isObjectOfClass(JSContextRef context, JSValueRef value);
50
51         static TizenApis::Api::Contact::ContactEmailAddressTypeArrayPtr getContactEmailAddressTypeArray(JSContextRef context, JSValueRef value);
52
53 private:
54
55         /**
56          * The callback invoked when an object is first created.
57          */
58         static void initialize(JSContextRef context,
59                         JSObjectRef object);
60
61         /**
62          * The callback invoked when an object is finalized.
63          */
64         static void finalize(JSObjectRef object);
65
66         static JSValueRef getLength(JSContextRef context,
67                         JSObjectRef object,
68                         JSStringRef propertyName,
69                         JSValueRef* exception);
70
71         static bool hasProperty(JSContextRef context,
72                         JSObjectRef object,
73                         JSStringRef propertyName);
74
75         static JSValueRef getProperty(JSContextRef context,
76                         JSObjectRef object,
77                         JSStringRef propertyName,
78                         JSValueRef* exception);
79
80         static bool setProperty(JSContextRef context,
81                         JSObjectRef object,
82                         JSStringRef propertyName,
83                         JSValueRef value,
84                         JSValueRef* exception);
85
86         static JSValueRef concat(JSContextRef context,
87                         JSObjectRef function,
88                         JSObjectRef thisObject,
89                         size_t argumentCount,
90                         const JSValueRef arguments[],
91                         JSValueRef* exception);
92         static JSValueRef join(JSContextRef context,
93                         JSObjectRef function,
94                         JSObjectRef thisObject,
95                         size_t argumentCount,
96                         const JSValueRef arguments[],
97                         JSValueRef* exception);
98         static JSValueRef pop(JSContextRef context,
99                         JSObjectRef function,
100                         JSObjectRef thisObject,
101                         size_t argumentCount,
102                         const JSValueRef arguments[],
103                         JSValueRef* exception);
104         static JSValueRef push(JSContextRef context,
105                         JSObjectRef function,
106                         JSObjectRef thisObject,
107                         size_t argumentCount,
108                         const JSValueRef arguments[],
109                         JSValueRef* exception);
110         static JSValueRef reverse(JSContextRef context,
111                         JSObjectRef function,
112                         JSObjectRef thisObject,
113                         size_t argumentCount,
114                         const JSValueRef arguments[],
115                         JSValueRef* exception);
116         static JSValueRef shift(JSContextRef context,
117                         JSObjectRef function,
118                         JSObjectRef thisObject,
119                         size_t argumentCount,
120                         const JSValueRef arguments[],
121                         JSValueRef* exception);
122         static JSValueRef slice(JSContextRef context,
123                         JSObjectRef function,
124                         JSObjectRef thisObject,
125                         size_t argumentCount,
126                         const JSValueRef arguments[],
127                         JSValueRef* exception);
128         static JSValueRef sort(JSContextRef context,
129                         JSObjectRef function,
130                         JSObjectRef thisObject,
131                         size_t argumentCount,
132                         const JSValueRef arguments[],
133                         JSValueRef* exception);
134         static JSValueRef splice(JSContextRef context,
135                         JSObjectRef function,
136                         JSObjectRef thisObject,
137                         size_t argumentCount,
138                         const JSValueRef arguments[],
139                         JSValueRef* exception);
140         static JSValueRef toString(JSContextRef context,
141                         JSObjectRef function,
142                         JSObjectRef thisObject,
143                         size_t argumentCount,
144                         const JSValueRef arguments[],
145                         JSValueRef* exception);
146         static JSValueRef unshift(JSContextRef context,
147                         JSObjectRef function,
148                         JSObjectRef thisObject,
149                         size_t argumentCount,
150                         const JSValueRef arguments[],
151                         JSValueRef* exception);
152         static JSValueRef valueOf(JSContextRef context,
153                         JSObjectRef function,
154                         JSObjectRef thisObject,
155                         size_t argumentCount,
156                         const JSValueRef arguments[],
157                         JSValueRef* exception);
158
159         static bool checkValue(const std::string &value);
160
161         static JSClassRef m_jsClassRef;
162         /**
163          * This structure describes a statically declared function property.
164          */
165         static JSStaticFunction m_function[];
166
167         /**
168          * This structure contains properties and callbacks that define a type of object.
169          */
170         static JSClassDefinition m_classInfo;
171
172         /**
173          * This member variable contains the initialization values for the static properties of this class.
174          * The values are given according to the data structure JSPropertySpec
175          */
176         static JSStaticValue m_property[];
177 };
178
179 } // Contact
180 } // Tizen1_0
181 } // TizenApis
182
183 #endif // _TIZEN_CONTACT_JS_CONTACT_EMAIL_ADDRESS_TYPE_ARRAY_H_