Update change log and spec for wrt-plugins-tizen_0.4.13
[framework/web/wrt-plugins-tizen.git] / src / NFC / JSNFCAdapter.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
20 #ifndef _JS_TIZEN_NFCADAPTER_H_
21 #define _JS_TIZEN_NFCADAPTER_H_
22
23 #include <JavaScriptCore/JavaScript.h>
24 #include <CommonsJavaScript/PrivateObject.h>
25 #include "INFCAdapter.h"
26
27 namespace DeviceAPI {
28 namespace NFC {
29
30 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<INFCAdapterPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> NFCAdapterPrivObject;
31 class JSNFCAdapter
32 {
33 public:
34
35     static const JSClassDefinition* getClassInfo();
36
37     static const JSClassRef getClassRef();
38
39     static JSObjectRef createJSObject(JSContextRef context);
40 private:
41     /**
42      * This member variable contains the values which has to be passed when
43      * the this class is embedded into JS Engine.
44      */
45     static JSClassDefinition m_classInfo;
46
47     /**
48      * This structure describes a statically declared function property.
49      */
50     static JSStaticFunction m_function[];
51
52     /**
53      * This member variable contains the initialization values for the
54      * properties of this class. The values are given according to the
55      * data structure JSPropertySpec.
56      */
57     static JSStaticValue m_property[];
58
59     static JSClassRef m_jsClassRef;
60
61     /**
62      * The callback invoked when an object is first created.
63      */
64     static void initialize(JSContextRef context, JSObjectRef object);
65
66     /**
67      * The callback invoked when an object is finalized.
68      */
69     static void finalize(JSObjectRef object);
70
71     /**
72      * Getters  for properties
73      */
74     static JSValueRef getProperty(JSContextRef context, JSObjectRef object,
75             JSStringRef propertyName, JSValueRef* exception);
76
77         static JSValueRef setTagListener(JSContextRef context, JSObjectRef object,
78                 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
79                 JSValueRef* exception);
80
81         static JSValueRef unsetTagListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
82                         size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
83
84         static JSValueRef setPeerListener(JSContextRef context, JSObjectRef object,
85                 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
86                 JSValueRef* exception);
87
88         static JSValueRef unsetPeerListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
89                         size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
90     static JSValueRef getCachedMessage(JSContextRef context,
91                 JSObjectRef object,
92                 JSObjectRef thisObject,
93                 size_t argumentCount,
94                 const JSValueRef arguments[],
95                 JSValueRef* exception);
96
97     static JSValueRef setPowered(JSContextRef context,
98                 JSObjectRef object,
99                 JSObjectRef thisObject,
100                 size_t argumentCount,
101                 const JSValueRef arguments[],
102                 JSValueRef* exception);
103 };
104
105 }
106 }
107
108 #endif /* _JS_TIZEN_NFCADAPTER_H_ */