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_NFCTARGET_H_
21 #define _JS_TIZEN_NFCTARGET_H_
23 #include <JavaScriptCore/JavaScript.h>
24 #include <CommonsJavaScript/PrivateObject.h>
25 #include "INFCTarget.h"
30 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<INFCTargetPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> NFCTargetPrivObject;
36 static const JSClassDefinition* getClassInfo();
38 static const JSClassRef getClassRef();
40 static JSObjectRef createJSObject(JSContextRef context, void *tagHandle);
44 * This member variable contains the values which has to be passed when
45 * the this class is embedded into JS Engine.
47 static JSClassDefinition m_classInfo;
50 * This structure describes a statically declared function property.
52 static JSStaticFunction m_function[];
55 * This member variable contains the initialization values for the
56 * properties of this class. The values are given according to the
57 * data structure JSPropertySpec.
59 static JSStaticValue m_property[];
61 static JSClassRef m_jsClassRef;
64 * The callback invoked when an object is first created.
66 static void initialize(JSContextRef context, JSObjectRef object);
69 * The callback invoked when an object is finalized.
71 static void finalize(JSObjectRef object);
74 * Getters and setters for properties
76 static JSValueRef getProperty(JSContextRef context, JSObjectRef object,
77 JSStringRef propertyName, JSValueRef* exception);
80 * The callback invoked when an object is used as the target of an 'instanceof' expression.
82 static bool hasInstance(JSContextRef context,
83 JSObjectRef constructor,
84 JSValueRef possibleInstance,
85 JSValueRef* exception);
87 static JSValueRef setReceiveNDEFListener(JSContextRef context,
89 JSObjectRef thisObject,
91 const JSValueRef arguments[],
92 JSValueRef* exception);
94 static JSValueRef unsetReceiveNDEFListener(JSContextRef context,
96 JSObjectRef thisObject,
98 const JSValueRef arguments[],
99 JSValueRef* exception);
101 static JSValueRef sendNDEF(JSContextRef context,
103 JSObjectRef thisObject,
104 size_t argumentCount,
105 const JSValueRef arguments[],
106 JSValueRef* exception);
112 #endif /* _JS_TIZEN_NFCTARGET_H_ */