2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #ifndef __TIZEN_CONTACT_JS_CONTACT_NAME_H__
19 #define __TIZEN_CONTACT_JS_CONTACT_NAME_H__
21 #include <JavaScriptCore/JavaScript.h>
22 #include "ContactName.h"
29 static JSClassRef getClassRef();
31 static const JSClassDefinition* getClassInfo();
33 static ContactNamePtr getPrivateObject(JSContextRef context, JSValueRef value);
35 static void setPrivateObject(JSObjectRef object, ContactNamePtr native);
37 static JSObjectRef makeJSObject(JSContextRef context, ContactNamePtr native);
39 static JSObjectRef constructor(JSContextRef context,
40 JSObjectRef constructor,
42 const JSValueRef arguments[],
43 JSValueRef* exception);
47 * This member variable contains the values which has to be passed
48 * when the this class is embedded into JS Engine.
50 static JSClassDefinition m_classInfo;
53 * This member variable contains the initialization values for the static properties of this class.
54 * The values are given according to the data structure JSPropertySpec
56 static JSStaticValue m_property[];
58 static JSClassRef m_jsClassRef;
61 * The callback invoked when an object is first created.
63 static void initialize(JSContextRef context, JSObjectRef object);
66 * The callback invoked when an object is finalized.
68 static void finalize(JSObjectRef object);
70 static JSValueRef getPrefix(JSContextRef context,
72 JSStringRef propertyName,
73 JSValueRef* exception);
75 static JSValueRef getSuffix(JSContextRef context,
77 JSStringRef propertyName,
78 JSValueRef* exception);
80 static JSValueRef getFirstName(JSContextRef context,
82 JSStringRef propertyName,
83 JSValueRef* exception);
85 static JSValueRef getMiddleName(JSContextRef context,
87 JSStringRef propertyName,
88 JSValueRef* exception);
90 static JSValueRef getLastName(JSContextRef context,
92 JSStringRef propertyName,
93 JSValueRef* exception);
95 static JSValueRef getNicknames(JSContextRef context,
97 JSStringRef propertyName,
98 JSValueRef* exception);
100 static JSValueRef getPhoneticFirstName(JSContextRef context,
102 JSStringRef propertyName,
103 JSValueRef* exception);
105 static JSValueRef getPhoneticMiddleName(JSContextRef context,
107 JSStringRef propertyName,
108 JSValueRef* exception);
110 static JSValueRef getPhoneticLastName(JSContextRef context,
112 JSStringRef propertyName,
113 JSValueRef* exception);
115 static JSValueRef getDisplayName(JSContextRef context,
117 JSStringRef propertyName,
118 JSValueRef* exception);
120 static bool setPrefix(JSContextRef context,
122 JSStringRef propertyName,
124 JSValueRef* exception);
126 static bool setSuffix(JSContextRef context,
128 JSStringRef propertyName,
130 JSValueRef* exception);
132 static bool setFirstName(JSContextRef context,
134 JSStringRef propertyName,
136 JSValueRef* exception);
138 static bool setMiddleName(JSContextRef context,
140 JSStringRef propertyName,
142 JSValueRef* exception);
144 static bool setLastName(JSContextRef context,
146 JSStringRef propertyName,
148 JSValueRef* exception);
150 static bool setNicknames(JSContextRef context,
152 JSStringRef propertyName,
154 JSValueRef* exception);
156 static bool setPhoneticFirstName(JSContextRef context,
158 JSStringRef propertyName,
160 JSValueRef* exception);
162 static bool setPhoneticMiddleName(JSContextRef context,
164 JSStringRef propertyName,
166 JSValueRef* exception);
168 static bool setPhoneticLastName(JSContextRef context,
170 JSStringRef propertyName,
172 JSValueRef* exception);
179 #endif // __TIZEN_CONTACT_JS_CONTACT_NAME_H__