Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / NFC / JSNFCTagMifareClassic.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License. 
15  */
16
17
18
19 #ifndef _JS_TIZEN_NFCTAGMIFARECLASSIC_H_
20 #define _JS_TIZEN_NFCTAGMIFARECLASSIC_H_
21
22 #include <JavaScriptCore/JavaScript.h>
23 #include <API/NFC/INFCTagMifareClassic.h>
24 #include <CommonsJavaScript/PrivateObject.h>
25
26 namespace TizenApis {
27 namespace Tizen1_0 {
28
29 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<Api::NFC::INFCTagMifareClassicPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> NFCTagMifareClassicPrivObject;
30
31 class JSNFCTagMifareClassic
32 {
33 public:
34
35     static const JSClassDefinition* getClassInfo();
36
37     static const JSClassRef getClassRef();
38
39     static JSObjectRef createJSObject(JSContextRef context, void *tagHandle, void* privManager);
40
41 private:
42     /**
43      * This member variable contains the values which has to be passed when 
44      * the this class is embedded into JS Engine.
45      */
46     static JSClassDefinition m_classInfo;
47
48     /**
49      * This structure describes a statically declared function property.
50      */
51     static JSStaticFunction m_function[];
52
53     /**
54      * This member variable contains the initialization values for the 
55      * properties of this class. The values are given according to the
56      * data structure JSPropertySpec.
57      */
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      * The callback invoked when an object is used as the target of an 'instanceof' expression.
73      */
74     static bool hasInstance(JSContextRef context,
75             JSObjectRef constructor,
76             JSValueRef possibleInstance,
77             JSValueRef* exception);
78
79     static JSValueRef authenticateWithKeyA(JSContextRef context,
80                 JSObjectRef object,
81                 JSObjectRef thisObject,
82                 size_t argumentCount,
83                 const JSValueRef arguments[],
84                 JSValueRef* exception);
85         
86     static JSValueRef authenticateWithKeyB(JSContextRef context,
87                 JSObjectRef object,
88                 JSObjectRef thisObject,
89                 size_t argumentCount,
90                 const JSValueRef arguments[],
91                 JSValueRef* exception);
92         
93     static JSValueRef readBlock(JSContextRef context,
94                 JSObjectRef object,
95                 JSObjectRef thisObject,
96                 size_t argumentCount,
97                 const JSValueRef arguments[],
98                 JSValueRef* exception);
99     static JSValueRef writeBlock(JSContextRef context,
100                 JSObjectRef object,
101                 JSObjectRef thisObject,
102                 size_t argumentCount,
103                 const JSValueRef arguments[],
104                 JSValueRef* exception);
105         
106     static JSValueRef incrementBlockValue(JSContextRef context,
107                 JSObjectRef object,
108                 JSObjectRef thisObject,
109                 size_t argumentCount,
110                 const JSValueRef arguments[],
111                 JSValueRef* exception);
112         
113     static JSValueRef decrementBlockValue(JSContextRef context,
114                 JSObjectRef object,
115                 JSObjectRef thisObject,
116                 size_t argumentCount,
117                 const JSValueRef arguments[],
118                 JSValueRef* exception);
119     static JSValueRef transfer(JSContextRef context,
120                 JSObjectRef object,
121                 JSObjectRef thisObject,
122                 size_t argumentCount,
123                 const JSValueRef arguments[],
124                 JSValueRef* exception);
125         
126     static JSValueRef restore(JSContextRef context,
127                 JSObjectRef object,
128                 JSObjectRef thisObject,
129                 size_t argumentCount,
130                 const JSValueRef arguments[],
131                 JSValueRef* exception);
132
133 };
134
135 }
136 }
137
138 #endif /* _JS_TIZEN_NFCTAGMIFARECLASSIC_H_ */