2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file JSContactProperties.h
19 * @author Kisub Song (kisubs.song@samsung.com)
21 * @brief Declaration of the JSContactProperties class
24 #ifndef _TIZEN_CONTACT_JS_CONTACT_PROPERTIES_H_
25 #define _TIZEN_CONTACT_JS_CONTACT_PROPERTIES_H_
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>
37 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<TizenApis::Api::Contact::ContactPropertiesPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSContactPropertiesPriv;
39 class JSContactProperties {
42 * This initializes this JS class in the JS Engine.
44 static JSClassRef getClassRef();
46 static JSValueRef createJSObject(JSContextRef context);
48 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
50 static TizenApis::Api::Contact::ContactPropertiesPtr getContactProperties(JSContextRef context, JSValueRef value);
54 * The callback invoked when an object is first created.
56 static void Initialize(JSContextRef context, JSObjectRef object);
59 * The callback invoked when an object is finalized.
61 static void Finalize(JSObjectRef object);
64 * This structure contains properties and callbacks that define a type of object.
66 static JSClassDefinition m_classInfo;
69 * This structure describes a statically declared function property.
71 static JSStaticFunction m_functions[];
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
77 static JSStaticValue m_property[];
79 static JSClassRef m_classRef;
81 static TizenApis::Api::Contact::ContactPropertiesPtr getPrivData(JSObjectRef object);
83 static JSValueRef getName(JSContextRef context,
85 JSStringRef propertyName,
86 JSValueRef* exception);
88 static bool setName(JSContextRef context,
90 JSStringRef propertyName,
92 JSValueRef* exception);
94 static JSValueRef getAccount(JSContextRef context,
96 JSStringRef propertyName,
97 JSValueRef* exception);
99 static bool setAccount(JSContextRef context,
101 JSStringRef propertyName,
103 JSValueRef* exception);
105 static JSValueRef getAddresses(JSContextRef context,
107 JSStringRef propertyName,
108 JSValueRef* exception);
110 static bool setAddresses(JSContextRef context,
112 JSStringRef propertyName,
114 JSValueRef* exception);
116 static JSValueRef getPhotoURI(JSContextRef context,
118 JSStringRef propertyName,
119 JSValueRef* exception);
121 static bool setPhotoURI(JSContextRef context,
123 JSStringRef propertyName,
125 JSValueRef* exception);
127 static JSValueRef getPhoneNumbers(JSContextRef context,
129 JSStringRef propertyName,
130 JSValueRef* exception);
132 static bool setPhoneNumbers(JSContextRef context,
134 JSStringRef propertyName,
136 JSValueRef* exception);
138 static JSValueRef getEmails(JSContextRef context,
140 JSStringRef propertyName,
141 JSValueRef* exception);
143 static bool setEmails(JSContextRef context,
145 JSStringRef propertyName,
147 JSValueRef* exception);
149 static JSValueRef getBirthday(JSContextRef context,
151 JSStringRef propertyName,
152 JSValueRef* exception);
154 static bool setBirthday(JSContextRef context,
156 JSStringRef propertyName,
158 JSValueRef* exception);
160 static JSValueRef getAnniversaries(JSContextRef context,
162 JSStringRef propertyName,
163 JSValueRef* exception);
165 static bool setAnniversaries(JSContextRef context,
167 JSStringRef propertyName,
169 JSValueRef* exception);
171 static JSValueRef getOrganization(JSContextRef context,
173 JSStringRef propertyName,
174 JSValueRef* exception);
176 static bool setOrganization(JSContextRef context,
178 JSStringRef propertyName,
180 JSValueRef* exception);
182 static JSValueRef getNotes(JSContextRef context,
184 JSStringRef propertyName,
185 JSValueRef* exception);
187 static bool setNotes(JSContextRef context,
189 JSStringRef propertyName,
191 JSValueRef* exception);
193 static JSValueRef getUrls(JSContextRef context,
195 JSStringRef propertyName,
196 JSValueRef* exception);
198 static bool setUrls(JSContextRef context,
200 JSStringRef propertyName,
202 JSValueRef* exception);
204 static JSValueRef getIsFavorite(JSContextRef context,
206 JSStringRef propertyName,
207 JSValueRef* exception);
209 static bool setIsFavorite(JSContextRef context,
211 JSStringRef propertyName,
213 JSValueRef* exception);
215 static JSValueRef getRingtoneURI(JSContextRef context,
217 JSStringRef propertyName,
218 JSValueRef* exception);
220 static bool setRingtoneURI(JSContextRef context,
222 JSStringRef propertyName,
224 JSValueRef* exception);
226 static JSValueRef getCategories(JSContextRef context,
228 JSStringRef propertyName,
229 JSValueRef* exception);
231 static bool setCategories(JSContextRef context,
233 JSStringRef propertyName,
235 JSValueRef* exception);
242 #endif // _TIZEN_CONTACT_JS_CONTACT_PROPERTIES_H_