2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef _JS_TIZEN_NFCTAGMIFARECLASSIC_H_
20 #define _JS_TIZEN_NFCTAGMIFARECLASSIC_H_
22 #include <JavaScriptCore/JavaScript.h>
23 #include <API/NFC/INFCTagMifareClassic.h>
24 #include <CommonsJavaScript/PrivateObject.h>
29 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<Api::NFC::INFCTagMifareClassicPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> NFCTagMifareClassicPrivObject;
31 class JSNFCTagMifareClassic
35 static const JSClassDefinition* getClassInfo();
37 static const JSClassRef getClassRef();
39 static JSObjectRef createJSObject(JSContextRef context, void *tagHandle, void* privManager);
43 * This member variable contains the values which has to be passed when
44 * the this class is embedded into JS Engine.
46 static JSClassDefinition m_classInfo;
49 * This structure describes a statically declared function property.
51 static JSStaticFunction m_function[];
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.
59 static JSClassRef m_jsClassRef;
62 * The callback invoked when an object is first created.
64 static void initialize(JSContextRef context, JSObjectRef object);
67 * The callback invoked when an object is finalized.
69 static void finalize(JSObjectRef object);
71 static JSValueRef authenticateWithKeyA(JSContextRef context,
73 JSObjectRef thisObject,
75 const JSValueRef arguments[],
76 JSValueRef* exception);
78 static JSValueRef authenticateWithKeyB(JSContextRef context,
80 JSObjectRef thisObject,
82 const JSValueRef arguments[],
83 JSValueRef* exception);
85 static JSValueRef readBlock(JSContextRef context,
87 JSObjectRef thisObject,
89 const JSValueRef arguments[],
90 JSValueRef* exception);
91 static JSValueRef writeBlock(JSContextRef context,
93 JSObjectRef thisObject,
95 const JSValueRef arguments[],
96 JSValueRef* exception);
98 static JSValueRef incrementBlockValue(JSContextRef context,
100 JSObjectRef thisObject,
101 size_t argumentCount,
102 const JSValueRef arguments[],
103 JSValueRef* exception);
105 static JSValueRef decrementBlockValue(JSContextRef context,
107 JSObjectRef thisObject,
108 size_t argumentCount,
109 const JSValueRef arguments[],
110 JSValueRef* exception);
111 static JSValueRef transfer(JSContextRef context,
113 JSObjectRef thisObject,
114 size_t argumentCount,
115 const JSValueRef arguments[],
116 JSValueRef* exception);
118 static JSValueRef restore(JSContextRef context,
120 JSObjectRef thisObject,
121 size_t argumentCount,
122 const JSValueRef arguments[],
123 JSValueRef* exception);
130 #endif /* _JS_TIZEN_NFCTAGMIFARECLASSIC_H_ */