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.
17 #ifndef TIZENAPIS_TIZEN_BLUETOOTH_MULTI_CALLBACK_H_
18 #define TIZENAPIS_TIZEN_BLUETOOTH_MULTI_CALLBACK_H_
20 #include <dpl/shared_ptr.h>
21 #include <Commons/IEvent.h>
22 #include <CommonsJavaScript/JSCallbackManager.h>
23 #include <JavaScriptCore/JavaScript.h>
25 using namespace WrtDeviceApis::CommonsJavaScript;
30 struct BluetoothDiscoveryDevicesSuccessCallback
34 JSValueRef onFinished;
36 BluetoothDiscoveryDevicesSuccessCallback()
43 struct BluetoothSocketNotifier
49 BluetoothSocketNotifier()
57 struct BluetoothRegisterServiceSuccessCallback
60 JSValueRef onConnected;
62 BluetoothRegisterServiceSuccessCallback()
69 class EventBTOnDiscoveryDevicesPrivateData : public WrtDeviceApis::Commons::IEventPrivateData
72 EventBTOnDiscoveryDevicesPrivateData(const JSCallbackManagerPtr& onSuccess,
73 const JSCallbackManagerPtr& onFound,
74 const JSCallbackManagerPtr& onFinished);
76 JSCallbackManagerPtr getOnSuccess() const;
77 JSCallbackManagerPtr getOnFound() const;
78 JSCallbackManagerPtr getOnFinished() const;
81 JSCallbackManagerPtr m_onSuccess;
82 JSCallbackManagerPtr m_onFound;
83 JSCallbackManagerPtr m_onFinished;
86 typedef DPL::SharedPtr<EventBTOnDiscoveryDevicesPrivateData> EventBTOnDiscoveryDevicesPrivateDataPtr;
89 class BluetoothSocketNotifierPrivateData : public WrtDeviceApis::Commons::IEventPrivateData
92 BluetoothSocketNotifierPrivateData
93 (const JSCallbackManagerPtr& onMessage,
94 const JSCallbackManagerPtr& onError,
95 const JSCallbackManagerPtr& onClose);
97 JSCallbackManagerPtr getOnMessage() const;
98 JSCallbackManagerPtr getOnError() const;
99 JSCallbackManagerPtr getOnClose() const;
100 JSObjectRef getObject() const;
101 void setObject(const JSObjectRef object);
104 JSCallbackManagerPtr m_onMessage;
105 JSCallbackManagerPtr m_onError;
106 JSCallbackManagerPtr m_onClose;
107 JSObjectRef m_object;
110 typedef DPL::SharedPtr<BluetoothSocketNotifierPrivateData> BluetoothSocketNotifierPrivateDataPtr;
113 class BluetoothRegisterServiceSuccessCallbackPrivateData : public WrtDeviceApis::Commons::IEventPrivateData
116 BluetoothRegisterServiceSuccessCallbackPrivateData
117 (const JSCallbackManagerPtr& onSuccess, const JSCallbackManagerPtr& onConnected);
119 JSCallbackManagerPtr getOnSuccess() const;
120 JSCallbackManagerPtr getOnConnected() const;
123 JSCallbackManagerPtr m_onSuccess;
124 JSCallbackManagerPtr m_onConnected;
127 typedef DPL::SharedPtr<BluetoothRegisterServiceSuccessCallbackPrivateData> BluetoothRegisterServiceSuccessCallbackPrivateDataPtr;