tizen 2.3.1 release
[framework/web/mobile/wrt-plugins-tizen.git] / src / Contact / JSContactName.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 #ifndef __TIZEN_CONTACT_JS_CONTACT_NAME_H__
19 #define __TIZEN_CONTACT_JS_CONTACT_NAME_H__
20
21 #include <JavaScriptCore/JavaScript.h>
22 #include "ContactName.h"
23
24 namespace DeviceAPI {
25 namespace Contact {
26
27 class JSContactName {
28 public:
29     static JSClassRef getClassRef();
30
31     static const JSClassDefinition* getClassInfo();
32
33     static ContactNamePtr getPrivateObject(JSContextRef context, JSValueRef value);
34
35     static void setPrivateObject(JSObjectRef object, ContactNamePtr native);
36
37     static JSObjectRef makeJSObject(JSContextRef context, ContactNamePtr native);
38
39     static JSObjectRef constructor(JSContextRef context,
40             JSObjectRef constructor,
41             size_t argumentCount,
42             const JSValueRef arguments[],
43             JSValueRef* exception);
44
45 private:
46     /**
47      * This member variable contains the values which has to be passed
48      * when the this class is embedded into JS Engine.
49      */
50     static JSClassDefinition m_classInfo;
51
52     /**
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
55      */
56     static JSStaticValue m_property[];
57
58     static JSClassRef m_jsClassRef;
59
60     /**
61      * The callback invoked when an object is first created.
62      */
63     static void initialize(JSContextRef context, JSObjectRef object);
64
65     /**
66      * The callback invoked when an object is finalized.
67      */
68     static void finalize(JSObjectRef object);
69
70     static JSValueRef getPrefix(JSContextRef context,
71             JSObjectRef object,
72             JSStringRef propertyName,
73             JSValueRef* exception);
74
75     static JSValueRef getSuffix(JSContextRef context,
76             JSObjectRef object,
77             JSStringRef propertyName,
78             JSValueRef* exception);
79
80     static JSValueRef getFirstName(JSContextRef context,
81             JSObjectRef object,
82             JSStringRef propertyName,
83             JSValueRef* exception);
84
85     static JSValueRef getMiddleName(JSContextRef context,
86             JSObjectRef object,
87             JSStringRef propertyName,
88             JSValueRef* exception);
89
90     static JSValueRef getLastName(JSContextRef context,
91             JSObjectRef object,
92             JSStringRef propertyName,
93             JSValueRef* exception);
94
95     static JSValueRef getNicknames(JSContextRef context,
96             JSObjectRef object,
97             JSStringRef propertyName,
98             JSValueRef* exception);
99
100     static JSValueRef getPhoneticFirstName(JSContextRef context,
101             JSObjectRef object,
102             JSStringRef propertyName,
103             JSValueRef* exception);
104
105     static JSValueRef getPhoneticMiddleName(JSContextRef context,
106             JSObjectRef object,
107             JSStringRef propertyName,
108             JSValueRef* exception);
109
110     static JSValueRef getPhoneticLastName(JSContextRef context,
111             JSObjectRef object,
112             JSStringRef propertyName,
113             JSValueRef* exception);
114
115     static JSValueRef getDisplayName(JSContextRef context,
116             JSObjectRef object,
117             JSStringRef propertyName,
118             JSValueRef* exception);
119
120     static bool setPrefix(JSContextRef context,
121             JSObjectRef object,
122             JSStringRef propertyName,
123             JSValueRef value,
124             JSValueRef* exception);
125
126     static bool setSuffix(JSContextRef context,
127             JSObjectRef object,
128             JSStringRef propertyName,
129             JSValueRef value,
130             JSValueRef* exception);
131
132     static bool setFirstName(JSContextRef context,
133             JSObjectRef object,
134             JSStringRef propertyName,
135             JSValueRef value,
136             JSValueRef* exception);
137
138     static bool setMiddleName(JSContextRef context,
139             JSObjectRef object,
140             JSStringRef propertyName,
141             JSValueRef value,
142             JSValueRef* exception);
143
144     static bool setLastName(JSContextRef context,
145             JSObjectRef object,
146             JSStringRef propertyName,
147             JSValueRef value,
148             JSValueRef* exception);
149
150     static bool setNicknames(JSContextRef context,
151             JSObjectRef object,
152             JSStringRef propertyName,
153             JSValueRef value,
154             JSValueRef* exception);
155
156     static bool setPhoneticFirstName(JSContextRef context,
157             JSObjectRef object,
158             JSStringRef propertyName,
159             JSValueRef value,
160             JSValueRef* exception);
161
162     static bool setPhoneticMiddleName(JSContextRef context,
163             JSObjectRef object,
164             JSStringRef propertyName,
165             JSValueRef value,
166             JSValueRef* exception);
167
168     static bool setPhoneticLastName(JSContextRef context,
169             JSObjectRef object,
170             JSStringRef propertyName,
171             JSValueRef value,
172             JSValueRef* exception);
173
174 };
175
176 } // Contact
177 } // DeviceAPI
178
179 #endif // __TIZEN_CONTACT_JS_CONTACT_NAME_H__