72c56e93d595be12824110ec318058f0dbd73378
[platform/framework/web/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
23 namespace DeviceAPI {
24 namespace Bluetooth {
25
26 class JSBluetoothAdapter
27 {
28 public:
29     static const JSClassDefinition* getClassInfo();
30     static const JSClassRef getClassRef();
31     static JSObjectRef createJSObject(JSContextRef context);
32
33 private:
34
35     /**
36      * The callback invoked when an object is first created.
37      */
38     static void initialize(JSContextRef context,
39             JSObjectRef object);
40
41     /**
42      * The callback invoked when an object is finalized.
43      */
44     static void finalize(JSObjectRef object);
45     
46     static JSValueRef getProperty(JSContextRef context,
47             JSObjectRef object,
48             JSStringRef propertyName,
49             JSValueRef* exception);
50
51     static JSValueRef setName(JSContextRef context,
52             JSObjectRef object,
53             JSObjectRef thisObject,
54             size_t argumentCount,
55             const JSValueRef arguments[],
56             JSValueRef* exception);
57
58     static JSValueRef setPowered(JSContextRef context,
59             JSObjectRef object,
60             JSObjectRef thisObject,
61             size_t argumentCount,
62             const JSValueRef arguments[],
63             JSValueRef* exception);
64
65     static JSValueRef setVisible(JSContextRef context,
66             JSObjectRef object,
67             JSObjectRef thisObject,
68             size_t argumentCount,
69             const JSValueRef arguments[],
70             JSValueRef* exception);
71
72     static JSValueRef discoverDevices(JSContextRef context,
73             JSObjectRef object,
74             JSObjectRef thisObject,
75             size_t argumentCount,
76             const JSValueRef arguments[],
77             JSValueRef* exception);
78
79     static JSValueRef stopDiscovery(JSContextRef context,
80             JSObjectRef object,
81             JSObjectRef thisObject,
82             size_t argumentCount,
83             const JSValueRef arguments[],
84             JSValueRef* exception);
85
86     static JSValueRef getKnownDevices(JSContextRef context,
87             JSObjectRef object,
88             JSObjectRef thisObject,
89             size_t argumentCount,
90             const JSValueRef arguments[],
91             JSValueRef* exception);
92
93     static JSValueRef getDevice(JSContextRef context,
94             JSObjectRef object,
95             JSObjectRef thisObject,
96             size_t argumentCount,
97             const JSValueRef arguments[],
98             JSValueRef* exception);
99
100     static JSValueRef createBonding(JSContextRef context,
101             JSObjectRef object,
102             JSObjectRef thisObject,
103             size_t argumentCount,
104             const JSValueRef arguments[],
105             JSValueRef* exception);
106
107     static JSValueRef destroyBonding(JSContextRef context,
108             JSObjectRef object,
109             JSObjectRef thisObject,
110             size_t argumentCount,
111             const JSValueRef arguments[],
112             JSValueRef* exception);
113
114     static JSValueRef registerRFCOMMServiceByUUID(JSContextRef context,
115             JSObjectRef object,
116             JSObjectRef thisObject,
117             size_t argumentCount,
118             const JSValueRef arguments[],
119             JSValueRef* exception);
120
121     static JSValueRef getBluetoothProfileHandler(JSContextRef context,
122             JSObjectRef object,
123             JSObjectRef thisObject,
124             size_t argumentCount,
125             const JSValueRef arguments[],
126             JSValueRef* exception);    
127
128     static JSValueRef setChangeListener(JSContextRef context,
129             JSObjectRef object,
130             JSObjectRef thisObject,
131             size_t argumentCount,
132             const JSValueRef arguments[],
133             JSValueRef* exception);    
134
135     static JSValueRef unsetChangeListener(JSContextRef context,
136             JSObjectRef object,
137             JSObjectRef thisObject,
138             size_t argumentCount,
139             const JSValueRef arguments[],
140             JSValueRef* exception);    
141
142     /**
143      * This member variable contains the values which has to be passed
144      * when the this class is embedded into JS Engine.
145      */
146     static JSClassDefinition m_classInfo;
147
148     /**
149      * This structure describes a statically declared function property.
150      */
151     static JSStaticFunction m_function[];
152
153     /**
154      * This member variable contains the initialization values for the
155      * properties of this class. The values are given according to
156      * the data structure JSPropertySpec
157      */
158     static JSStaticValue m_property[];
159
160     static JSClassRef m_jsClassRef;
161 };
162
163
164
165 } // Bluetooth
166 } // DeviceAPI
167
168 #endif // __TIZEN_JS_DOWNLOAD_MANAGER_H__