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>
26 #include "INFCAdapter.h"
27 #include "JSNFCManager.h"
32 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<INFCAdapterPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> NFCAdapterPrivObjectBase;
33 class NFCAdapterPrivObject :
34 public DeviceAPI::Common::SecurityAccessor,
35 public NFCAdapterPrivObjectBase
38 NFCAdapterPrivObject(JSContextRef context, INFCAdapterPtr adapter) :
39 DeviceAPI::Common::SecurityAccessor(),
40 NFCAdapterPrivObjectBase(context, adapter)
44 virtual ~ NFCAdapterPrivObject()
53 static const JSClassDefinition* getClassInfo();
55 static const JSClassRef getClassRef();
57 static JSObjectRef createJSObject(JSContextRef context, NFCManagerPrivObject *nfcManagerPriv);
60 * This member variable contains the values which has to be passed when
61 * the this class is embedded into JS Engine.
63 static JSClassDefinition m_classInfo;
66 * This structure describes a statically declared function property.
68 static JSStaticFunction m_function[];
71 * This member variable contains the initialization values for the
72 * properties of this class. The values are given according to the
73 * data structure JSPropertySpec.
75 static JSStaticValue m_property[];
77 static JSClassRef m_jsClassRef;
80 * The callback invoked when an object is first created.
82 static void initialize(JSContextRef context, JSObjectRef object);
85 * The callback invoked when an object is finalized.
87 static void finalize(JSObjectRef object);
90 * Getters for properties
92 static JSValueRef getProperty(JSContextRef context, JSObjectRef object,
93 JSStringRef propertyName, JSValueRef* exception);
95 static JSValueRef setTagListener(JSContextRef context, JSObjectRef object,
96 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
97 JSValueRef* exception);
99 static JSValueRef unsetTagListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
100 size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
102 static JSValueRef setPeerListener(JSContextRef context, JSObjectRef object,
103 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
104 JSValueRef* exception);
106 static JSValueRef unsetPeerListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
107 size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
108 static JSValueRef getCachedMessage(JSContextRef context,
110 JSObjectRef thisObject,
111 size_t argumentCount,
112 const JSValueRef arguments[],
113 JSValueRef* exception);
115 static JSValueRef setPowered(JSContextRef context,
117 JSObjectRef thisObject,
118 size_t argumentCount,
119 const JSValueRef arguments[],
120 JSValueRef* exception);
126 #endif /* _JS_TIZEN_NFCADAPTER_H_ */