2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef _JS_TIZEN_NFCADAPTER_H_
21 #define _JS_TIZEN_NFCADAPTER_H_
23 #include <JavaScriptCore/JavaScript.h>
24 #include <CommonsJavaScript/PrivateObject.h>
25 #include "INFCAdapter.h"
30 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<INFCAdapterPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> NFCAdapterPrivObject;
35 static const JSClassDefinition* getClassInfo();
37 static const JSClassRef getClassRef();
39 static JSObjectRef createJSObject(JSContextRef context);
42 * This member variable contains the values which has to be passed when
43 * the this class is embedded into JS Engine.
45 static JSClassDefinition m_classInfo;
48 * This structure describes a statically declared function property.
50 static JSStaticFunction m_function[];
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.
57 static JSStaticValue m_property[];
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);
72 * Getters for properties
74 static JSValueRef getProperty(JSContextRef context, JSObjectRef object,
75 JSStringRef propertyName, JSValueRef* exception);
77 static JSValueRef setTagListener(JSContextRef context, JSObjectRef object,
78 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
79 JSValueRef* exception);
81 static JSValueRef unsetTagListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
82 size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
84 static JSValueRef setPeerListener(JSContextRef context, JSObjectRef object,
85 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
86 JSValueRef* exception);
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,
92 JSObjectRef thisObject,
94 const JSValueRef arguments[],
95 JSValueRef* exception);
97 static JSValueRef setPowered(JSContextRef context,
99 JSObjectRef thisObject,
100 size_t argumentCount,
101 const JSValueRef arguments[],
102 JSValueRef* exception);
104 static JSValueRef setCardEmulation(JSContextRef context,
106 JSObjectRef thisObject,
107 size_t argumentCount,
108 const JSValueRef arguments[],
109 JSValueRef* exception);
111 static JSValueRef setCardEmulationChangeListener(JSContextRef context,
113 JSObjectRef thisObject,
114 size_t argumentCount,
115 const JSValueRef arguments[],
116 JSValueRef* exception);
118 static JSValueRef unsetCardEmulationChangeListener(JSContextRef context,
120 JSObjectRef thisObject,
121 size_t argumentCount,
122 const JSValueRef arguments[],
123 JSValueRef* exception);
129 #endif /* _JS_TIZEN_NFCADAPTER_H_ */