Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_bluetooth_BluetoothSocketObserver_h
8 #define mozilla_dom_bluetooth_BluetoothSocketObserver_h
10 #include "BluetoothCommon.h"
11 #include "mozilla/ipc/UnixSocket.h"
13 BEGIN_BLUETOOTH_NAMESPACE
15 class BluetoothSocket;
17 class BluetoothSocketObserver
18 {
19 public:
20 virtual void ReceiveSocketData(
21 BluetoothSocket* aSocket,
22 nsAutoPtr<mozilla::ipc::UnixSocketRawData>& aMessage) = 0;
24 /**
25 * A callback function which would be called when a socket connection
26 * is established successfully. To be more specific, this would be called
27 * when socket state changes from CONNECTING/LISTENING to CONNECTED.
28 */
29 virtual void OnSocketConnectSuccess(BluetoothSocket* aSocket) = 0;
31 /**
32 * A callback function which would be called when BluetoothSocket::Connect()
33 * fails.
34 */
35 virtual void OnSocketConnectError(BluetoothSocket* aSocket) = 0;
37 /**
38 * A callback function which would be called when a socket connection
39 * is dropped. To be more specific, this would be called when socket state
40 * changes from CONNECTED/LISTENING to DISCONNECTED.
41 */
42 virtual void OnSocketDisconnect(BluetoothSocket* aSocket) = 0;
44 };
46 END_BLUETOOTH_NAMESPACE
48 #endif