gecko-dev/dom/bluetooth/common/BluetoothSocketObserver.h
Ben Tian 8ddbe69e4f Bug 1193379 - Move backend-neutral files into dom/bluetooth/common. r=joliu
--HG--
rename : dom/bluetooth/BluetoothCommon.h => dom/bluetooth/common/BluetoothCommon.h
rename : dom/bluetooth/BluetoothHfpManagerBase.h => dom/bluetooth/common/BluetoothHfpManagerBase.h
rename : dom/bluetooth/BluetoothHidManager.cpp => dom/bluetooth/common/BluetoothHidManager.cpp
rename : dom/bluetooth/BluetoothHidManager.h => dom/bluetooth/common/BluetoothHidManager.h
rename : dom/bluetooth/BluetoothInterface.cpp => dom/bluetooth/common/BluetoothInterface.cpp
rename : dom/bluetooth/BluetoothInterface.h => dom/bluetooth/common/BluetoothInterface.h
rename : dom/bluetooth/BluetoothPbapRequestHandle.cpp => dom/bluetooth/common/BluetoothPbapRequestHandle.cpp
rename : dom/bluetooth/BluetoothPbapRequestHandle.h => dom/bluetooth/common/BluetoothPbapRequestHandle.h
rename : dom/bluetooth/BluetoothProfileManagerBase.h => dom/bluetooth/common/BluetoothProfileManagerBase.h
rename : dom/bluetooth/BluetoothRilListener.cpp => dom/bluetooth/common/BluetoothRilListener.cpp
rename : dom/bluetooth/BluetoothRilListener.h => dom/bluetooth/common/BluetoothRilListener.h
rename : dom/bluetooth/BluetoothSocketObserver.h => dom/bluetooth/common/BluetoothSocketObserver.h
rename : dom/bluetooth/BluetoothUtils.cpp => dom/bluetooth/common/BluetoothUtils.cpp
rename : dom/bluetooth/BluetoothUtils.h => dom/bluetooth/common/BluetoothUtils.h
rename : dom/bluetooth/BluetoothUuid.cpp => dom/bluetooth/common/BluetoothUuid.cpp
rename : dom/bluetooth/BluetoothUuid.h => dom/bluetooth/common/BluetoothUuid.h
rename : dom/bluetooth/ObexBase.cpp => dom/bluetooth/common/ObexBase.cpp
rename : dom/bluetooth/ObexBase.h => dom/bluetooth/common/ObexBase.h
2015-08-21 15:17:44 +08:00

56 lines
2.1 KiB
C++

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