Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Bluetooth / JSBluetoothAdapter.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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. 
15  */
16
17
18 #ifndef TIZENAPIS_TIZEN_JS_BLUETOOTH_ADAPTER_H_
19 #define TIZENAPIS_TIZEN_JS_BLUETOOTH_ADAPTER_H_
20
21 #include <JavaScriptCore/JavaScript.h>
22 #include <CommonsJavaScript/PrivateObject.h>
23 #include <API/Bluetooth/IBluetoothAdapterManager.h>
24
25 using namespace TizenApis::Api::Bluetooth;
26 using namespace WrtDeviceApis::CommonsJavaScript;
27
28
29 namespace TizenApis {
30 namespace Tizen1_0 {
31
32 typedef PrivateObjectT<Api::Bluetooth::IBluetoothAdapterManagerPtr>::Type JSBluetoothAdapterPriv;
33 class JSBluetoothAdapter {
34 public:
35         static const JSClassDefinition* getClassInfo();
36         static const JSClassRef getClassRef();
37         static JSObjectRef createJSObject(JSContextRef context);
38 private:
39         static void initialize(JSContextRef context, JSObjectRef object);
40         static void finalize(JSObjectRef object);
41         static bool hasInstance(JSContextRef context, JSObjectRef constructor,
42         JSValueRef possibleInstance, JSValueRef* exception);
43
44         static JSValueRef setPowered(
45                 JSContextRef context, JSObjectRef object,
46                 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
47                 JSValueRef* exception);
48
49         static JSValueRef getPowered(
50                 JSContextRef context, JSObjectRef object,
51                 JSStringRef propertyName, JSValueRef* exception);
52
53         static JSValueRef setVisible(
54                 JSContextRef context, JSObjectRef object,
55                 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
56                 JSValueRef* exception);
57
58         static JSValueRef getVisible(
59                 JSContextRef context, JSObjectRef object,
60                 JSStringRef propertyName, JSValueRef* exception);
61
62         static JSValueRef setName(
63                 JSContextRef context, JSObjectRef object,
64                 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
65                 JSValueRef* exception);
66         
67         static JSValueRef getName(
68                 JSContextRef context, JSObjectRef object,
69                 JSStringRef propertyName, JSValueRef* exception);
70
71         
72
73         static JSValueRef discoveryDevices(
74                 JSContextRef context, JSObjectRef object,
75                 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
76                 JSValueRef* exception);
77
78         static JSValueRef stopDiscovery(
79                 JSContextRef context, JSObjectRef object,
80                 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
81                 JSValueRef* exception);
82
83
84         static JSValueRef getKnownDevices(
85                 JSContextRef context, JSObjectRef object,
86                 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
87                 JSValueRef* exception);
88
89
90         static JSValueRef getDevice(
91                 JSContextRef context, JSObjectRef object,
92                 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
93                 JSValueRef* exception);
94
95
96         static JSValueRef createBonding(
97                 JSContextRef context, JSObjectRef object,
98                 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
99                 JSValueRef* exception);
100
101         static JSValueRef destroyBonding(
102                 JSContextRef context, JSObjectRef object,
103                 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
104                 JSValueRef* exception);
105
106         static JSValueRef registerRFCOMMServiceByUUID(
107                 JSContextRef context, JSObjectRef object,
108                 JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
109                 JSValueRef* exception);
110
111         static JSValueRef getAddress(
112                 JSContextRef context, JSObjectRef object, 
113                 JSStringRef propertyName, JSValueRef* exception);
114
115         static JSClassDefinition m_classInfo;
116
117         static JSStaticFunction m_function[];
118         static JSStaticValue m_properties[];
119
120         static JSClassRef m_jsClassRef;
121         static bool m_AdapterEnabled;
122 };
123
124 }
125 }
126
127 #endif
128