tizen 2.3.1 release
[framework/web/wearable/wrt-plugins-tizen.git] / src / Bluetooth / JSBluetoothAdapter.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 #ifndef __TIZEN_JS_BLUETOOTH_ADAPTER_H__
19 #define __TIZEN_JS_BLUETOOTH_ADAPTER_H__
20
21 #include <JavaScriptCore/JavaScript.h>
22 #include <Security.h>
23
24 namespace DeviceAPI {
25 namespace Bluetooth {
26
27 class JSBluetoothAdapter
28 {
29 public:
30     static const JSClassDefinition* getClassInfo();
31     static const JSClassRef getClassRef();
32     static JSObjectRef createJSObject(JSContextRef context);
33
34 private:
35
36     /**
37      * The callback invoked when an object is first created.
38      */
39     static void initialize(JSContextRef context,
40             JSObjectRef object);
41
42     /**
43      * The callback invoked when an object is finalized.
44      */
45     static void finalize(JSObjectRef object);
46
47     static JSValueRef getProperty(JSContextRef context,
48             JSObjectRef object,
49             JSStringRef propertyName,
50             JSValueRef* exception);
51
52     static JSValueRef setName(JSContextRef context,
53             JSObjectRef object,
54             JSObjectRef thisObject,
55             size_t argumentCount,
56             const JSValueRef arguments[],
57             JSValueRef* exception);
58
59     static JSValueRef setPowered(JSContextRef context,
60             JSObjectRef object,
61             JSObjectRef thisObject,
62             size_t argumentCount,
63             const JSValueRef arguments[],
64             JSValueRef* exception);
65
66     static JSValueRef setVisible(JSContextRef context,
67             JSObjectRef object,
68             JSObjectRef thisObject,
69             size_t argumentCount,
70             const JSValueRef arguments[],
71             JSValueRef* exception);
72
73     static JSValueRef discoverDevices(JSContextRef context,
74             JSObjectRef object,
75             JSObjectRef thisObject,
76             size_t argumentCount,
77             const JSValueRef arguments[],
78             JSValueRef* exception);
79
80     static JSValueRef stopDiscovery(JSContextRef context,
81             JSObjectRef object,
82             JSObjectRef thisObject,
83             size_t argumentCount,
84             const JSValueRef arguments[],
85             JSValueRef* exception);
86
87     static JSValueRef getKnownDevices(JSContextRef context,
88             JSObjectRef object,
89             JSObjectRef thisObject,
90             size_t argumentCount,
91             const JSValueRef arguments[],
92             JSValueRef* exception);
93
94     static JSValueRef getDevice(JSContextRef context,
95             JSObjectRef object,
96             JSObjectRef thisObject,
97             size_t argumentCount,
98             const JSValueRef arguments[],
99             JSValueRef* exception);
100
101     static JSValueRef createBonding(JSContextRef context,
102             JSObjectRef object,
103             JSObjectRef thisObject,
104             size_t argumentCount,
105             const JSValueRef arguments[],
106             JSValueRef* exception);
107
108     static JSValueRef destroyBonding(JSContextRef context,
109             JSObjectRef object,
110             JSObjectRef thisObject,
111             size_t argumentCount,
112             const JSValueRef arguments[],
113             JSValueRef* exception);
114
115     static JSValueRef registerRFCOMMServiceByUUID(JSContextRef context,
116             JSObjectRef object,
117             JSObjectRef thisObject,
118             size_t argumentCount,
119             const JSValueRef arguments[],
120             JSValueRef* exception);
121
122     static JSValueRef getBluetoothProfileHandler(JSContextRef context,
123             JSObjectRef object,
124             JSObjectRef thisObject,
125             size_t argumentCount,
126             const JSValueRef arguments[],
127             JSValueRef* exception);
128
129     static JSValueRef setChangeListener(JSContextRef context,
130             JSObjectRef object,
131             JSObjectRef thisObject,
132             size_t argumentCount,
133             const JSValueRef arguments[],
134             JSValueRef* exception);
135
136     static JSValueRef unsetChangeListener(JSContextRef context,
137             JSObjectRef object,
138             JSObjectRef thisObject,
139             size_t argumentCount,
140             const JSValueRef arguments[],
141             JSValueRef* exception);
142
143     /**
144      * This member variable contains the values which has to be passed
145      * when the this class is embedded into JS Engine.
146      */
147     static JSClassDefinition m_classInfo;
148
149     /**
150      * This structure describes a statically declared function property.
151      */
152     static JSStaticFunction m_function[];
153
154     /**
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
158      */
159     static JSStaticValue m_property[];
160
161     static JSClassRef m_jsClassRef;
162 };
163
164
165
166 } // Bluetooth
167 } // DeviceAPI
168
169 #endif // __TIZEN_JS_DOWNLOAD_MANAGER_H__