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 JSAccountService.h
20 * @author Jihwa Park (jh7979.park@samsung.com)
25 #ifndef _JS_TIZEN_ACCOUNTSERVICE_H_
26 #define _JS_TIZEN_ACCOUNTSERVICE_H_
30 #include <JavaScriptCore/JavaScript.h>
31 #include <CommonsJavaScript/PrivateObject.h>
32 #include <API/Account/IAccountService.h>
33 #include <CommonsJavaScript/JSCallbackManager.h>
36 using namespace TizenApis::Api::Account;
37 using namespace WrtDeviceApis::Commons;
38 using namespace WrtDeviceApis::CommonsJavaScript;
43 typedef PrivateObject<IAccountServicePtr,
44 NoOwnership> AccountServicePrivObject;
46 class JSAccountService
50 static const JSClassDefinition* getClassInfo();
52 static const JSClassRef getClassRef();
56 * This member variable contains the values which has to be passed
57 * when the this class is embedded into JS Engine.
59 static JSClassDefinition m_classInfo;
62 * This structure describes a statically declared function property.
64 static JSStaticFunction m_function[];
67 * This member variable contains the initialization values for the
68 * properties of this class. The values are given according to
69 * the data structure JSPropertySpec
71 static JSStaticValue m_property[];
73 static JSClassRef m_jsClassRef;
76 * The callback invoked when an object is first created.
78 static void initialize(JSContextRef context,
82 * The callback invoked when an object is finalized.
84 static void finalize(JSObjectRef object);
86 static JSValueRef getPropertyName(JSContextRef context,
88 JSStringRef propertyName,
89 JSValueRef* exception);
91 static JSValueRef getPropertyType(JSContextRef context,
93 JSStringRef propertyName,
94 JSValueRef* exception);
101 static JSValueRef updateAccount(JSContextRef context,
103 JSObjectRef thisObject,
104 size_t argumentCount,
105 const JSValueRef arguments[],
106 JSValueRef* exception);
109 * Delete a calendar event.
111 static JSValueRef deleteAccount(JSContextRef context,
113 JSObjectRef thisObject,
114 size_t argumentCount,
115 const JSValueRef arguments[],
116 JSValueRef* exception);
119 * Search for calendar events.
121 static JSValueRef findAccounts(JSContextRef context,
123 JSObjectRef thisObject,
124 size_t argumentCount,
125 const JSValueRef arguments[],
126 JSValueRef* exception);
131 static JSValueRef createAccount(JSContextRef context,
133 JSObjectRef thisObject,
134 size_t argumentCount,
135 const JSValueRef arguments[],
136 JSValueRef* exception);
142 static JSValueRef addAccount(JSContextRef context,
144 JSObjectRef thisObject,
145 size_t argumentCount,
146 const JSValueRef arguments[],
147 JSValueRef* exception);
150 * Returns calendar stored as private object
152 static IAccountServicePtr getAccountService(JSContextRef ctx,
153 const JSObjectRef object,
154 JSValueRef* exception);
162 #endif /* _JS_TIZEN_ACCOUNTSERVICE_H_ */