Add DRAFT stubs for Vehicle plugin
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Contact / JSContactPhoneNumberArray.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        JSContactPhoneNumberArray.h
19  * @author      Kisub Song (kisubs.song@samsung.com)
20  * @version     0.1
21  * @brief
22  */
23
24 #ifndef _TIZEN_CONTACT_JS_CONTACT_PHONE_NUMBER_ARRAY_H_
25 #define _TIZEN_CONTACT_JS_CONTACT_PHONE_NUMBER_ARRAY_H_
26
27 #include <JavaScriptCore/JavaScript.h>
28 #include <CommonsJavaScript/PrivateObject.h>
29 #include <API/Contact/ContactPhoneNumber.h>
30
31 namespace TizenApis {
32 namespace Tizen1_0 {
33 namespace Contact {
34
35 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<TizenApis::Api::Contact::ContactPhoneNumberArrayPtr>::Type JSContactPhoneNumberArrayPriv;
36
37 class JSContactPhoneNumberArray
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::ContactPhoneNumberArrayPtr &contactPhoneNumbers);
47
48         static bool isObjectOfClass(JSContextRef context, JSValueRef value);
49
50         static TizenApis::Api::Contact::ContactPhoneNumberArrayPtr getContactPhoneNumberArray(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 void getPropertyNames(JSContextRef context,
86                         JSObjectRef object,
87                         JSPropertyNameAccumulatorRef propertyNames);
88
89         static JSValueRef concat(JSContextRef context,
90                         JSObjectRef function,
91                         JSObjectRef thisObject,
92                         size_t argumentCount,
93                         const JSValueRef arguments[],
94                         JSValueRef* exception);
95         static JSValueRef join(JSContextRef context,
96                         JSObjectRef function,
97                         JSObjectRef thisObject,
98                         size_t argumentCount,
99                         const JSValueRef arguments[],
100                         JSValueRef* exception);
101         static JSValueRef pop(JSContextRef context,
102                         JSObjectRef function,
103                         JSObjectRef thisObject,
104                         size_t argumentCount,
105                         const JSValueRef arguments[],
106                         JSValueRef* exception);
107         static JSValueRef push(JSContextRef context,
108                         JSObjectRef function,
109                         JSObjectRef thisObject,
110                         size_t argumentCount,
111                         const JSValueRef arguments[],
112                         JSValueRef* exception);
113         static JSValueRef reverse(JSContextRef context,
114                         JSObjectRef function,
115                         JSObjectRef thisObject,
116                         size_t argumentCount,
117                         const JSValueRef arguments[],
118                         JSValueRef* exception);
119         static JSValueRef shift(JSContextRef context,
120                         JSObjectRef function,
121                         JSObjectRef thisObject,
122                         size_t argumentCount,
123                         const JSValueRef arguments[],
124                         JSValueRef* exception);
125         static JSValueRef slice(JSContextRef context,
126                         JSObjectRef function,
127                         JSObjectRef thisObject,
128                         size_t argumentCount,
129                         const JSValueRef arguments[],
130                         JSValueRef* exception);
131         static JSValueRef sort(JSContextRef context,
132                         JSObjectRef function,
133                         JSObjectRef thisObject,
134                         size_t argumentCount,
135                         const JSValueRef arguments[],
136                         JSValueRef* exception);
137         static JSValueRef splice(JSContextRef context,
138                         JSObjectRef function,
139                         JSObjectRef thisObject,
140                         size_t argumentCount,
141                         const JSValueRef arguments[],
142                         JSValueRef* exception);
143         static JSValueRef toString(JSContextRef context,
144                         JSObjectRef function,
145                         JSObjectRef thisObject,
146                         size_t argumentCount,
147                         const JSValueRef arguments[],
148                         JSValueRef* exception);
149         static JSValueRef unshift(JSContextRef context,
150                         JSObjectRef function,
151                         JSObjectRef thisObject,
152                         size_t argumentCount,
153                         const JSValueRef arguments[],
154                         JSValueRef* exception);
155         static JSValueRef valueOf(JSContextRef context,
156                         JSObjectRef function,
157                         JSObjectRef thisObject,
158                         size_t argumentCount,
159                         const JSValueRef arguments[],
160                         JSValueRef* exception);
161
162         static bool checkValue(const std::string &value);
163
164         static JSClassRef m_jsClassRef;
165         /**
166          * This structure describes a statically declared function property.
167          */
168         static JSStaticFunction m_function[];
169
170         /**
171          * This structure contains properties and callbacks that define a type of object.
172          */
173         static JSClassDefinition m_classInfo;
174
175         /**
176          * This member variable contains the initialization values for the static properties of this class.
177          * The values are given according to the data structure JSPropertySpec
178          */
179         static JSStaticValue m_property[];
180 };
181
182 } // Contact
183 } // Tizen1_0
184 } // TizenApis
185
186 #endif // _TIZEN_CONTACT_JS_CONTACT_PHONE_NUMBER_ARRAY_H_