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.
18 #ifndef __TIZEN_JS_BLUETOOTH_ADAPTER_H__
19 #define __TIZEN_JS_BLUETOOTH_ADAPTER_H__
21 #include <JavaScriptCore/JavaScript.h>
27 class JSBluetoothAdapter
30 static const JSClassDefinition* getClassInfo();
31 static const JSClassRef getClassRef();
32 static JSObjectRef createJSObject(JSContextRef context);
37 * The callback invoked when an object is first created.
39 static void initialize(JSContextRef context,
43 * The callback invoked when an object is finalized.
45 static void finalize(JSObjectRef object);
47 static JSValueRef getProperty(JSContextRef context,
49 JSStringRef propertyName,
50 JSValueRef* exception);
52 static JSValueRef setName(JSContextRef context,
54 JSObjectRef thisObject,
56 const JSValueRef arguments[],
57 JSValueRef* exception);
59 static JSValueRef setPowered(JSContextRef context,
61 JSObjectRef thisObject,
63 const JSValueRef arguments[],
64 JSValueRef* exception);
66 static JSValueRef setVisible(JSContextRef context,
68 JSObjectRef thisObject,
70 const JSValueRef arguments[],
71 JSValueRef* exception);
73 static JSValueRef discoverDevices(JSContextRef context,
75 JSObjectRef thisObject,
77 const JSValueRef arguments[],
78 JSValueRef* exception);
80 static JSValueRef stopDiscovery(JSContextRef context,
82 JSObjectRef thisObject,
84 const JSValueRef arguments[],
85 JSValueRef* exception);
87 static JSValueRef getKnownDevices(JSContextRef context,
89 JSObjectRef thisObject,
91 const JSValueRef arguments[],
92 JSValueRef* exception);
94 static JSValueRef getDevice(JSContextRef context,
96 JSObjectRef thisObject,
98 const JSValueRef arguments[],
99 JSValueRef* exception);
101 static JSValueRef createBonding(JSContextRef context,
103 JSObjectRef thisObject,
104 size_t argumentCount,
105 const JSValueRef arguments[],
106 JSValueRef* exception);
108 static JSValueRef destroyBonding(JSContextRef context,
110 JSObjectRef thisObject,
111 size_t argumentCount,
112 const JSValueRef arguments[],
113 JSValueRef* exception);
115 static JSValueRef registerRFCOMMServiceByUUID(JSContextRef context,
117 JSObjectRef thisObject,
118 size_t argumentCount,
119 const JSValueRef arguments[],
120 JSValueRef* exception);
122 static JSValueRef getBluetoothProfileHandler(JSContextRef context,
124 JSObjectRef thisObject,
125 size_t argumentCount,
126 const JSValueRef arguments[],
127 JSValueRef* exception);
129 static JSValueRef setChangeListener(JSContextRef context,
131 JSObjectRef thisObject,
132 size_t argumentCount,
133 const JSValueRef arguments[],
134 JSValueRef* exception);
136 static JSValueRef unsetChangeListener(JSContextRef context,
138 JSObjectRef thisObject,
139 size_t argumentCount,
140 const JSValueRef arguments[],
141 JSValueRef* exception);
144 * This member variable contains the values which has to be passed
145 * when the this class is embedded into JS Engine.
147 static JSClassDefinition m_classInfo;
150 * This structure describes a statically declared function property.
152 static JSStaticFunction m_function[];
155 * This member variable contains the initialization values for the
156 * properties of this class. The values are given according to
157 * the data structure JSPropertySpec
159 static JSStaticValue m_property[];
161 static JSClassRef m_jsClassRef;
169 #endif // __TIZEN_JS_DOWNLOAD_MANAGER_H__