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>
24 #include "ICallHistory.h"
27 namespace CallHistory {
29 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<ICallHistoryPtr>::Type JSCallHistoryPriv;
34 static const JSClassDefinition* getClassInfo();
36 static const JSClassRef getClassRef();
38 static JSObjectRef createJSObject(JSContextRef context, JSObjectRef object);
40 static void initialize(JSContextRef context, JSObjectRef object);
42 static void finalize(JSObjectRef object);
44 static JSValueRef getProperty(JSContextRef context, JSObjectRef object,
45 JSStringRef propertyName, JSValueRef* exception);
47 static bool hasInstance(JSContextRef context, JSObjectRef constructor,
48 JSValueRef possibleInstance, JSValueRef* exception);
51 static JSValueRef find(JSContextRef context, JSObjectRef object,
52 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
53 JSValueRef* exception);
55 static JSValueRef remove(JSContextRef context, JSObjectRef object,
56 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
57 JSValueRef* exception);
59 static JSValueRef removeBatch(JSContextRef context, JSObjectRef object,
60 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
61 JSValueRef* exception);
63 static JSValueRef removeAll(JSContextRef context, JSObjectRef object,
64 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
65 JSValueRef* exception);
67 static JSValueRef addChangeListener(JSContextRef context, JSObjectRef object,
68 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
69 JSValueRef* exception);
71 static JSValueRef removeChangeListener(JSContextRef context, JSObjectRef object,
72 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
73 JSValueRef* exception);
75 static JSClassDefinition m_classInfo;
77 static JSStaticValue m_property[];
79 static JSStaticFunction m_function[];
81 static JSClassRef m_jsClassRef;