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