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_NFCMANAGER_H_
20 #define _JS_TIZEN_NFCMANAGER_H_
22 #include <JavaScriptCore/JavaScript.h>
23 #include <API/NFC/INFCManager.h>
24 #include <CommonsJavaScript/PrivateObject.h>
29 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<Api::NFC::INFCManagerPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> NFCManagerPrivObject;
35 static const JSClassDefinition* getClassInfo();
37 static const JSClassRef getClassRef();
41 * This member variable contains the values which has to be passed when
42 * the this class is embedded into JS Engine.
44 static JSClassDefinition m_classInfo;
47 * This structure describes a statically declared function property.
49 static JSStaticFunction m_function[];
52 * This member variable contains the initialization values for the
53 * properties of this class. The values are given according to the
54 * data structure JSPropertySpec.
56 static JSStaticValue m_property[];
58 static JSClassRef m_jsClassRef;
61 * The callback invoked when an object is first created.
63 static void initialize(JSContextRef context, JSObjectRef object);
66 * The callback invoked when an object is finalized.
68 static void finalize(JSObjectRef object);
71 * Getters for properties
73 static JSValueRef getProperty(JSContextRef context, JSObjectRef object,
74 JSStringRef propertyName, JSValueRef* exception);
77 * register a listener to watch NFC tag.
79 static JSValueRef setTagListener(JSContextRef context, JSObjectRef object,
80 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
81 JSValueRef* exception);
83 * deregister the listener which was registered by using setTagListener api.
85 static JSValueRef unsetTagListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
86 size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
89 * register a listener to watch NFC tag.
91 static JSValueRef setPeerListener(JSContextRef context, JSObjectRef object,
92 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
93 JSValueRef* exception);
95 * deregister the listener which was registered by using setTagListener api.
97 static JSValueRef unsetPeerListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
98 size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
101 * register a listener to watch NFC tag.
103 static JSValueRef setNDEFListener(JSContextRef context, JSObjectRef object,
104 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
105 JSValueRef* exception);
107 * deregister the listener which was registered by using setTagListener api.
109 static JSValueRef unsetNDEFListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
110 size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
113 * register a listener to watch NFC SE Event.
115 static JSValueRef setSEEventListener(JSContextRef context, JSObjectRef object,
116 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
117 JSValueRef* exception);
119 * deregister the listener which was registered by using setSEEventListener api.
121 static JSValueRef unsetSEEventListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
122 size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
124 static JSValueRef getCachedMessage(JSContextRef context,
126 JSObjectRef thisObject,
127 size_t argumentCount,
128 const JSValueRef arguments[],
129 JSValueRef* exception);
135 #endif /* _JS_TIZEN_NFCMANAGER_H_ */