michael@0: /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_bluetooth_BluetoothSocketObserver_h michael@0: #define mozilla_dom_bluetooth_BluetoothSocketObserver_h michael@0: michael@0: #include "BluetoothCommon.h" michael@0: #include "mozilla/ipc/UnixSocket.h" michael@0: michael@0: BEGIN_BLUETOOTH_NAMESPACE michael@0: michael@0: class BluetoothSocket; michael@0: michael@0: class BluetoothSocketObserver michael@0: { michael@0: public: michael@0: virtual void ReceiveSocketData( michael@0: BluetoothSocket* aSocket, michael@0: nsAutoPtr& aMessage) = 0; michael@0: michael@0: /** michael@0: * A callback function which would be called when a socket connection michael@0: * is established successfully. To be more specific, this would be called michael@0: * when socket state changes from CONNECTING/LISTENING to CONNECTED. michael@0: */ michael@0: virtual void OnSocketConnectSuccess(BluetoothSocket* aSocket) = 0; michael@0: michael@0: /** michael@0: * A callback function which would be called when BluetoothSocket::Connect() michael@0: * fails. michael@0: */ michael@0: virtual void OnSocketConnectError(BluetoothSocket* aSocket) = 0; michael@0: michael@0: /** michael@0: * A callback function which would be called when a socket connection michael@0: * is dropped. To be more specific, this would be called when socket state michael@0: * changes from CONNECTED/LISTENING to DISCONNECTED. michael@0: */ michael@0: virtual void OnSocketDisconnect(BluetoothSocket* aSocket) = 0; michael@0: michael@0: }; michael@0: michael@0: END_BLUETOOTH_NAMESPACE michael@0: michael@0: #endif