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