|
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/. */ |
|
6 |
|
7 #ifndef mozilla_dom_bluetooth_BluetoothSocketObserver_h |
|
8 #define mozilla_dom_bluetooth_BluetoothSocketObserver_h |
|
9 |
|
10 #include "BluetoothCommon.h" |
|
11 #include "mozilla/ipc/UnixSocket.h" |
|
12 |
|
13 BEGIN_BLUETOOTH_NAMESPACE |
|
14 |
|
15 class BluetoothSocket; |
|
16 |
|
17 class BluetoothSocketObserver |
|
18 { |
|
19 public: |
|
20 virtual void ReceiveSocketData( |
|
21 BluetoothSocket* aSocket, |
|
22 nsAutoPtr<mozilla::ipc::UnixSocketRawData>& aMessage) = 0; |
|
23 |
|
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; |
|
30 |
|
31 /** |
|
32 * A callback function which would be called when BluetoothSocket::Connect() |
|
33 * fails. |
|
34 */ |
|
35 virtual void OnSocketConnectError(BluetoothSocket* aSocket) = 0; |
|
36 |
|
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; |
|
43 |
|
44 }; |
|
45 |
|
46 END_BLUETOOTH_NAMESPACE |
|
47 |
|
48 #endif |