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.
19 * @file JSContactOrganization.h
20 * @author Kisub Song (kisubs.song@samsung.com)
22 * @brief Declaration of the JSContactOrganization class
25 #ifndef _TIZEN_CONTACT_JS_CONTACT_ORGANIZATION_H_
26 #define _TIZEN_CONTACT_JS_CONTACT_ORGANIZATION_H_
28 #include <JavaScriptCore/JavaScript.h>
29 #include <dpl/shared_ptr.h>
30 #include <CommonsJavaScript/PrivateObject.h>
31 #include <Commons/IEvent.h>
32 #include "ContactOrganization.h"
37 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<ContactOrganizationPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSContactOrganizationPriv;
39 class JSContactOrganization {
42 * This initializes this JS class in the JS Engine.
44 static JSClassRef getClassRef();
46 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
48 static ContactOrganizationPtr getContactOrganization(JSContextRef context, JSValueRef value);
52 * The callback invoked when an object is first created.
54 static void Initialize(JSContextRef context, JSObjectRef object);
57 * The callback invoked when an object is finalized.
59 static void Finalize(JSObjectRef object);
62 * This structure contains properties and callbacks that define a type of object.
64 static JSClassDefinition m_classInfo;
67 * This structure describes a statically declared function property.
69 static JSStaticFunction m_functions[];
72 * This member variable contains the initialization values for the static properties of this class.
73 * The values are given according to the data structure JSPropertySpec
75 static JSStaticValue m_property[];
77 static JSClassRef m_classRef;
79 static JSObjectRef createJSObject(JSContextRef context, ContactOrganizationPtr contactOrganization);
81 static ContactOrganizationPtr getPrivData(JSObjectRef object);
83 static JSObjectRef constructor(JSContextRef context,
84 JSObjectRef constructor,
86 const JSValueRef arguments[],
87 JSValueRef* exception);
89 static bool hasInstance(JSContextRef context,
90 JSObjectRef constructor,
91 JSValueRef possibleInstance,
92 JSValueRef* exception);
94 static JSValueRef getName(JSContextRef context,
96 JSStringRef propertyName,
97 JSValueRef* exception);
99 static bool setName(JSContextRef context,
101 JSStringRef propertyName,
103 JSValueRef* exception);
105 static JSValueRef getDepartment(JSContextRef context,
107 JSStringRef propertyName,
108 JSValueRef* exception);
110 static bool setDepartment(JSContextRef context,
112 JSStringRef propertyName,
114 JSValueRef* exception);
116 static JSValueRef getOffice(JSContextRef context,
118 JSStringRef propertyName,
119 JSValueRef* exception);
121 static bool setOffice(JSContextRef context,
123 JSStringRef propertyName,
125 JSValueRef* exception);
127 static JSValueRef getTitle(JSContextRef context,
129 JSStringRef propertyName,
130 JSValueRef* exception);
132 static bool setTitle(JSContextRef context,
134 JSStringRef propertyName,
136 JSValueRef* exception);
138 static JSValueRef getRole(JSContextRef context,
140 JSStringRef propertyName,
141 JSValueRef* exception);
143 static bool setRole(JSContextRef context,
145 JSStringRef propertyName,
147 JSValueRef* exception);
149 static JSValueRef getLogoURI(JSContextRef context,
151 JSStringRef propertyName,
152 JSValueRef* exception);
154 static bool setLogoURI(JSContextRef context,
156 JSStringRef propertyName,
158 JSValueRef* exception);
164 #endif // _TIZEN_CONTACT_JS_CONTACT_ORGANIZATION_H_