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 #ifndef TIZEN_APIS_JS_CALLHISTORY_H_
20 #define TIZEN_APIS_JS_CALLHISTORY_H_
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
25 #include "ICallHistory.h"
27 using namespace WrtDeviceApis::Commons;
28 using namespace WrtDeviceApis::CommonsJavaScript;
31 namespace CallHistory {
33 typedef PrivateObject<ICallHistoryPtr, NoOwnership> JSCallHistoryPrivObject;
35 class JSCallHistoryPriv :
36 public JSCallHistoryPrivObject,
37 public DeviceAPI::Common::SecurityAccessor
40 JSCallHistoryPriv(JSContextRef context, ICallHistoryPtr callHistory) :
41 JSCallHistoryPrivObject(context, callHistory),
42 DeviceAPI::Common::SecurityAccessor()
46 virtual ~JSCallHistoryPriv()
54 static const JSClassDefinition* getClassInfo();
56 static const JSClassRef getClassRef();
58 static JSObjectRef createJSObject(JSContextRef context, JSObjectRef object);
60 static void initialize(JSContextRef context, JSObjectRef object);
62 static void finalize(JSObjectRef object);
64 static JSValueRef getProperty(JSContextRef context, JSObjectRef object,
65 JSStringRef propertyName, JSValueRef* exception);
67 static bool hasInstance(JSContextRef context, JSObjectRef constructor,
68 JSValueRef possibleInstance, JSValueRef* exception);
71 static JSValueRef find(JSContextRef context, JSObjectRef object,
72 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
73 JSValueRef* exception);
75 static JSValueRef remove(JSContextRef context, JSObjectRef object,
76 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
77 JSValueRef* exception);
79 static JSValueRef removeBatch(JSContextRef context, JSObjectRef object,
80 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
81 JSValueRef* exception);
83 static JSValueRef removeAll(JSContextRef context, JSObjectRef object,
84 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
85 JSValueRef* exception);
87 static JSValueRef addChangeListener(JSContextRef context, JSObjectRef object,
88 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
89 JSValueRef* exception);
91 static JSValueRef removeChangeListener(JSContextRef context, JSObjectRef object,
92 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
93 JSValueRef* exception);
95 static JSClassDefinition m_classInfo;
97 static JSStaticValue m_property[];
99 static JSStaticFunction m_function[];
101 static JSClassRef m_jsClassRef;