Update change log and spec for wrt-plugins-tizen_0.4.70
[framework/web/wrt-plugins-tizen.git] / src / Callhistory / JSCallHistory.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18
19 #ifndef TIZEN_APIS_JS_CALLHISTORY_H_
20 #define TIZEN_APIS_JS_CALLHISTORY_H_
21
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include <Security.h>
25 #include "ICallHistory.h"
26
27 using namespace WrtDeviceApis::Commons;
28 using namespace WrtDeviceApis::CommonsJavaScript;
29
30 namespace DeviceAPI {
31 namespace CallHistory {
32
33 typedef PrivateObject<ICallHistoryPtr, NoOwnership> JSCallHistoryPrivObject;
34
35 class JSCallHistoryPriv :
36         public JSCallHistoryPrivObject,
37         public DeviceAPI::Common::SecurityAccessor
38 {
39 public:
40         JSCallHistoryPriv(JSContextRef context, ICallHistoryPtr callHistory) :
41                 JSCallHistoryPrivObject(context, callHistory),
42                 DeviceAPI::Common::SecurityAccessor()
43         {
44         }
45
46         virtual ~JSCallHistoryPriv()
47         {
48         }
49 };
50
51 class JSCallHistory
52 {
53 public:
54         static const JSClassDefinition* getClassInfo();
55
56         static const JSClassRef getClassRef();
57
58         static JSObjectRef createJSObject(JSContextRef context, JSObjectRef object);
59 private:
60         static void initialize(JSContextRef context, JSObjectRef object);
61
62         static void finalize(JSObjectRef object);
63
64         static JSValueRef getProperty(JSContextRef context, JSObjectRef object,
65                         JSStringRef propertyName, JSValueRef* exception);
66
67         static bool hasInstance(JSContextRef context, JSObjectRef constructor,
68                         JSValueRef possibleInstance, JSValueRef* exception);
69
70
71         static JSValueRef find(JSContextRef context, JSObjectRef object,
72                         JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
73                         JSValueRef* exception);
74
75         static JSValueRef remove(JSContextRef context, JSObjectRef object,
76                         JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
77                         JSValueRef* exception);
78
79         static JSValueRef removeBatch(JSContextRef context, JSObjectRef object,
80                         JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
81                         JSValueRef* exception);
82
83         static JSValueRef removeAll(JSContextRef context, JSObjectRef object,
84                         JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
85                         JSValueRef* exception);
86
87         static JSValueRef addChangeListener(JSContextRef context, JSObjectRef object,
88                         JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
89                         JSValueRef* exception);
90
91         static JSValueRef removeChangeListener(JSContextRef context, JSObjectRef object,
92                         JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
93                         JSValueRef* exception);
94
95         static JSClassDefinition m_classInfo;
96
97         static JSStaticValue m_property[];
98
99         static JSStaticFunction m_function[];
100
101         static JSClassRef m_jsClassRef;
102
103 };
104
105 }
106 }
107
108 #endif
109