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.
19 * @file JSAccountManager.h
20 * @author Jihwa Park (jh7979.park@samsung.com)
25 #ifndef _JS_TIZEN_ACCOUNT_MANAGER_H_
26 #define _JS_TIZEN_ACCOUNT_MANAGER_H_
28 #include <JavaScriptCore/JavaScript.h>
29 #include <CommonsJavaScript/PrivateObject.h>
30 #include <API/Account/IAccountManager.h>
31 #include <API/Account/IAccountService.h>
33 using namespace TizenApis::Api::Account;
34 using namespace WrtDeviceApis::Commons;
35 using namespace WrtDeviceApis::CommonsJavaScript;
40 typedef PrivateObject<IAccountManagerPtr, NoOwnership> AccountManagerPrivObject;
42 class JSAccountManager
54 static const JSClassDefinition* getClassInfo();
55 static const JSClassRef getClassRef();
59 * This structure describes a statically declared function property.
61 static JSStaticFunction m_function[];
64 * This member variable contains the initialization values for the
65 * properties of this class. The values are given according to
66 * the data structure JSPropertySpec
68 static JSStaticValue m_property[];
71 * This structure contains properties and callbacks
72 * that define a type of object.
74 static JSClassDefinition m_classInfo;
76 static JSClassRef m_jsClassRef;
79 * The callback invoked when an object is first created.
81 static void initialize(JSContextRef context,
85 * The callback invoked when an object is finalized.
87 static void finalize(JSObjectRef object);
93 static JSValueRef addAccount(JSContextRef context,
95 JSObjectRef thisObject,
97 const JSValueRef arguments[],
98 JSValueRef* exception);
100 static JSValueRef addAccountlistener(JSContextRef context,
102 JSObjectRef thisObject,
103 size_t argumentCount,
104 const JSValueRef arguments[],
105 JSValueRef* exception);
107 static JSValueRef removeAccountlistener(JSContextRef context,
109 JSObjectRef thisObject,
110 size_t argumentCount,
111 const JSValueRef arguments[],
112 JSValueRef* exception);
114 static JSValueRef getAccountById(JSContextRef context,
116 JSObjectRef thisObject,
117 size_t argumentCount,
118 const JSValueRef arguments[],
119 JSValueRef* exception);
121 static JSValueRef getServiceTypeById(JSContextRef context,
123 JSObjectRef thisObject,
124 size_t argumentCount,
125 const JSValueRef arguments[],
126 JSValueRef* exception);
128 static JSValueRef getProviderById(JSContextRef context,
130 JSObjectRef thisObject,
131 size_t argumentCount,
132 const JSValueRef arguments[],
133 JSValueRef* exception);
135 static JSValueRef findAccountsByServiceType(JSContextRef context,
137 JSObjectRef thisObject,
138 size_t argumentCount,
139 const JSValueRef arguments[],
140 JSValueRef* exception);
142 static JSValueRef findAccounts(JSContextRef context,
144 JSObjectRef thisObject,
145 size_t argumentCount,
146 const JSValueRef arguments[],
147 JSValueRef* exception);
149 static JSValueRef findServices(JSContextRef context,
151 JSObjectRef thisObject,
152 size_t argumentCount,
153 const JSValueRef arguments[],
154 JSValueRef* exception);
156 static JSValueRef findProviders(JSContextRef context,
158 JSObjectRef thisObject,
159 size_t argumentCount,
160 const JSValueRef arguments[],
161 JSValueRef* exception);
163 static JSValueRef findServiceTypes(JSContextRef context,
165 JSObjectRef thisObject,
166 size_t argumentCount,
167 const JSValueRef arguments[],
168 JSValueRef* exception);
170 static JSValueRef getTypeProperty(JSContextRef context,
172 JSStringRef propertyName,
173 JSValueRef* exception);
175 static JSValueRef getServiceById(JSContextRef context,
177 JSObjectRef thisObject,
178 size_t argumentCount,
179 const JSValueRef arguments[],
180 JSValueRef* exception);
182 static JSValueRef getServiceByName(JSContextRef context,
184 JSObjectRef thisObject,
185 size_t argumentCount,
186 const JSValueRef arguments[],
187 JSValueRef* exception);
193 #endif /* _JS_TIZEN_ACCOUNT_MANAGER_H_ */