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 JSContactEmailAddressTypeArray.h
19 * @author Kisub Song (kisubs.song@samsung.com)
24 #ifndef _TIZEN_CONTACT_JS_CONTACT_EMAIL_ADDRESS_TYPE_ARRAY_H_
25 #define _TIZEN_CONTACT_JS_CONTACT_EMAIL_ADDRESS_TYPE_ARRAY_H_
28 #include <JavaScriptCore/JavaScript.h>
29 #include <CommonsJavaScript/PrivateObject.h>
30 #include <API/Contact/ContactEmailAddress.h>
36 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<TizenApis::Api::Contact::ContactEmailAddressTypeArrayPtr>::Type JSContactEmailAddressTypeArrayPriv;
38 class JSContactEmailAddressTypeArray
42 static const JSClassDefinition* getClassInfo();
44 static JSClassRef getClassRef();
46 static JSObjectRef createArray(JSContextRef context,
47 const TizenApis::Api::Contact::ContactEmailAddressTypeArrayPtr &Strings);
49 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
51 static TizenApis::Api::Contact::ContactEmailAddressTypeArrayPtr getContactEmailAddressTypeArray(JSContextRef context, JSValueRef value);
56 * The callback invoked when an object is first created.
58 static void initialize(JSContextRef context,
62 * The callback invoked when an object is finalized.
64 static void finalize(JSObjectRef object);
66 static JSValueRef getLength(JSContextRef context,
68 JSStringRef propertyName,
69 JSValueRef* exception);
71 static bool hasProperty(JSContextRef context,
73 JSStringRef propertyName);
75 static JSValueRef getProperty(JSContextRef context,
77 JSStringRef propertyName,
78 JSValueRef* exception);
80 static bool setProperty(JSContextRef context,
82 JSStringRef propertyName,
84 JSValueRef* exception);
86 static JSValueRef concat(JSContextRef context,
88 JSObjectRef thisObject,
90 const JSValueRef arguments[],
91 JSValueRef* exception);
92 static JSValueRef join(JSContextRef context,
94 JSObjectRef thisObject,
96 const JSValueRef arguments[],
97 JSValueRef* exception);
98 static JSValueRef pop(JSContextRef context,
100 JSObjectRef thisObject,
101 size_t argumentCount,
102 const JSValueRef arguments[],
103 JSValueRef* exception);
104 static JSValueRef push(JSContextRef context,
105 JSObjectRef function,
106 JSObjectRef thisObject,
107 size_t argumentCount,
108 const JSValueRef arguments[],
109 JSValueRef* exception);
110 static JSValueRef reverse(JSContextRef context,
111 JSObjectRef function,
112 JSObjectRef thisObject,
113 size_t argumentCount,
114 const JSValueRef arguments[],
115 JSValueRef* exception);
116 static JSValueRef shift(JSContextRef context,
117 JSObjectRef function,
118 JSObjectRef thisObject,
119 size_t argumentCount,
120 const JSValueRef arguments[],
121 JSValueRef* exception);
122 static JSValueRef slice(JSContextRef context,
123 JSObjectRef function,
124 JSObjectRef thisObject,
125 size_t argumentCount,
126 const JSValueRef arguments[],
127 JSValueRef* exception);
128 static JSValueRef sort(JSContextRef context,
129 JSObjectRef function,
130 JSObjectRef thisObject,
131 size_t argumentCount,
132 const JSValueRef arguments[],
133 JSValueRef* exception);
134 static JSValueRef splice(JSContextRef context,
135 JSObjectRef function,
136 JSObjectRef thisObject,
137 size_t argumentCount,
138 const JSValueRef arguments[],
139 JSValueRef* exception);
140 static JSValueRef toString(JSContextRef context,
141 JSObjectRef function,
142 JSObjectRef thisObject,
143 size_t argumentCount,
144 const JSValueRef arguments[],
145 JSValueRef* exception);
146 static JSValueRef unshift(JSContextRef context,
147 JSObjectRef function,
148 JSObjectRef thisObject,
149 size_t argumentCount,
150 const JSValueRef arguments[],
151 JSValueRef* exception);
152 static JSValueRef valueOf(JSContextRef context,
153 JSObjectRef function,
154 JSObjectRef thisObject,
155 size_t argumentCount,
156 const JSValueRef arguments[],
157 JSValueRef* exception);
159 static bool checkValue(const std::string &value);
161 static JSClassRef m_jsClassRef;
163 * This structure describes a statically declared function property.
165 static JSStaticFunction m_function[];
168 * This structure contains properties and callbacks that define a type of object.
170 static JSClassDefinition m_classInfo;
173 * This member variable contains the initialization values for the static properties of this class.
174 * The values are given according to the data structure JSPropertySpec
176 static JSStaticValue m_property[];
183 #endif // _TIZEN_CONTACT_JS_CONTACT_EMAIL_ADDRESS_TYPE_ARRAY_H_