Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Contact / JSContactProperties.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        JSContactProperties.h
19  * @author      Kisub Song (kisubs.song@samsung.com)
20  * @version     0.1
21  * @brief       Declaration of the JSContactProperties class
22  */
23
24 #ifndef _TIZEN_CONTACT_JS_CONTACT_PROPERTIES_H_
25 #define _TIZEN_CONTACT_JS_CONTACT_PROPERTIES_H_
26
27 #include <JavaScriptCore/JavaScript.h>
28 #include <dpl/shared_ptr.h>
29 #include <CommonsJavaScript/PrivateObject.h>
30 #include <Commons/IEvent.h>
31 #include <API/Contact/ContactProperties.h>
32
33 namespace TizenApis {
34 namespace Tizen1_0 {
35 namespace Contact {
36
37 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<TizenApis::Api::Contact::ContactPropertiesPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSContactPropertiesPriv;
38
39 class JSContactProperties {
40 public:
41         /*
42         * This initializes this JS class in the JS Engine.
43         */
44         static JSClassRef getClassRef();
45
46         static JSValueRef createJSObject(JSContextRef context);
47
48         static bool isObjectOfClass(JSContextRef context, JSValueRef value);
49
50         static TizenApis::Api::Contact::ContactPropertiesPtr getContactProperties(JSContextRef context, JSValueRef value);
51
52 private:
53    /**
54         * The callback invoked when an object is first created.
55         */
56         static void Initialize(JSContextRef context, JSObjectRef object);
57
58    /**
59         * The callback invoked when an object is finalized.
60         */
61         static void Finalize(JSObjectRef object);
62
63    /**
64         * This structure contains properties and callbacks that define a type of object.
65         */
66         static JSClassDefinition m_classInfo;
67
68    /**
69         * This structure describes a statically declared function property.
70         */
71         static JSStaticFunction m_functions[];
72
73         /**
74          * This member variable contains the initialization values for the static properties of this class.
75          * The values are given according to the data structure JSPropertySpec
76          */
77         static JSStaticValue m_property[];
78
79         static JSClassRef m_classRef;
80
81         static TizenApis::Api::Contact::ContactPropertiesPtr getPrivData(JSObjectRef object);
82
83         static JSValueRef getName(JSContextRef context,
84                         JSObjectRef object,
85                         JSStringRef propertyName,
86                         JSValueRef* exception);
87
88         static bool setName(JSContextRef context,
89                         JSObjectRef object,
90                         JSStringRef propertyName,
91                         JSValueRef value,
92                         JSValueRef* exception);
93
94         static JSValueRef getAccount(JSContextRef context,
95                         JSObjectRef object,
96                         JSStringRef propertyName,
97                         JSValueRef* exception);
98
99         static bool setAccount(JSContextRef context,
100                         JSObjectRef object,
101                         JSStringRef propertyName,
102                         JSValueRef value,
103                         JSValueRef* exception);
104
105         static JSValueRef getAddresses(JSContextRef context,
106                         JSObjectRef object,
107                         JSStringRef propertyName,
108                         JSValueRef* exception);
109
110         static bool setAddresses(JSContextRef context,
111                         JSObjectRef object,
112                         JSStringRef propertyName,
113                         JSValueRef value,
114                         JSValueRef* exception);
115
116         static JSValueRef getPhotoURI(JSContextRef context,
117                         JSObjectRef object,
118                         JSStringRef propertyName,
119                         JSValueRef* exception);
120
121         static bool setPhotoURI(JSContextRef context,
122                         JSObjectRef object,
123                         JSStringRef propertyName,
124                         JSValueRef value,
125                         JSValueRef* exception);
126
127         static JSValueRef getPhoneNumbers(JSContextRef context,
128                         JSObjectRef object,
129                         JSStringRef propertyName,
130                         JSValueRef* exception);
131
132         static bool setPhoneNumbers(JSContextRef context,
133                         JSObjectRef object,
134                         JSStringRef propertyName,
135                         JSValueRef value,
136                         JSValueRef* exception);
137
138         static JSValueRef getEmails(JSContextRef context,
139                         JSObjectRef object,
140                         JSStringRef propertyName,
141                         JSValueRef* exception);
142
143         static bool setEmails(JSContextRef context,
144                         JSObjectRef object,
145                         JSStringRef propertyName,
146                         JSValueRef value,
147                         JSValueRef* exception);
148
149         static JSValueRef getBirthday(JSContextRef context,
150                         JSObjectRef object,
151                         JSStringRef propertyName,
152                         JSValueRef* exception);
153
154         static bool setBirthday(JSContextRef context,
155                         JSObjectRef object,
156                         JSStringRef propertyName,
157                         JSValueRef value,
158                         JSValueRef* exception);
159
160         static JSValueRef getAnniversaries(JSContextRef context,
161                         JSObjectRef object,
162                         JSStringRef propertyName,
163                         JSValueRef* exception);
164
165         static bool setAnniversaries(JSContextRef context,
166                         JSObjectRef object,
167                         JSStringRef propertyName,
168                         JSValueRef value,
169                         JSValueRef* exception);
170
171         static JSValueRef getOrganization(JSContextRef context,
172                         JSObjectRef object,
173                         JSStringRef propertyName,
174                         JSValueRef* exception);
175
176         static bool setOrganization(JSContextRef context,
177                         JSObjectRef object,
178                         JSStringRef propertyName,
179                         JSValueRef value,
180                         JSValueRef* exception);
181
182         static JSValueRef getNotes(JSContextRef context,
183                         JSObjectRef object,
184                         JSStringRef propertyName,
185                         JSValueRef* exception);
186
187         static bool setNotes(JSContextRef context,
188                         JSObjectRef object,
189                         JSStringRef propertyName,
190                         JSValueRef value,
191                         JSValueRef* exception);
192
193         static JSValueRef getUrls(JSContextRef context,
194                         JSObjectRef object,
195                         JSStringRef propertyName,
196                         JSValueRef* exception);
197
198         static bool setUrls(JSContextRef context,
199                         JSObjectRef object,
200                         JSStringRef propertyName,
201                         JSValueRef value,
202                         JSValueRef* exception);
203
204         static JSValueRef getIsFavorite(JSContextRef context,
205                         JSObjectRef object,
206                         JSStringRef propertyName,
207                         JSValueRef* exception);
208
209         static bool setIsFavorite(JSContextRef context,
210                         JSObjectRef object,
211                         JSStringRef propertyName,
212                         JSValueRef value,
213                         JSValueRef* exception);
214
215         static JSValueRef getRingtoneURI(JSContextRef context,
216                         JSObjectRef object,
217                         JSStringRef propertyName,
218                         JSValueRef* exception);
219
220         static bool setRingtoneURI(JSContextRef context,
221                         JSObjectRef object,
222                         JSStringRef propertyName,
223                         JSValueRef value,
224                         JSValueRef* exception);
225
226         static JSValueRef getCategories(JSContextRef context,
227                         JSObjectRef object,
228                         JSStringRef propertyName,
229                         JSValueRef* exception);
230
231         static bool setCategories(JSContextRef context,
232                         JSObjectRef object,
233                         JSStringRef propertyName,
234                         JSValueRef value,
235                         JSValueRef* exception);
236 };
237
238 } // Contact
239 } // Tizen1_0
240 } // TizenApis
241
242 #endif // _TIZEN_CONTACT_JS_CONTACT_PROPERTIES_H_