dom/bluetooth/BluetoothSocketObserver.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/bluetooth/BluetoothSocketObserver.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
     1.5 +/* vim: set ts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef mozilla_dom_bluetooth_BluetoothSocketObserver_h
    1.11 +#define mozilla_dom_bluetooth_BluetoothSocketObserver_h
    1.12 +
    1.13 +#include "BluetoothCommon.h"
    1.14 +#include "mozilla/ipc/UnixSocket.h"
    1.15 +
    1.16 +BEGIN_BLUETOOTH_NAMESPACE
    1.17 +
    1.18 +class BluetoothSocket;
    1.19 +
    1.20 +class BluetoothSocketObserver
    1.21 +{
    1.22 +public:
    1.23 +  virtual void ReceiveSocketData(
    1.24 +    BluetoothSocket* aSocket,
    1.25 +    nsAutoPtr<mozilla::ipc::UnixSocketRawData>& aMessage) = 0;
    1.26 +
    1.27 +   /**
    1.28 +    * A callback function which would be called when a socket connection
    1.29 +    * is established successfully. To be more specific, this would be called
    1.30 +    * when socket state changes from CONNECTING/LISTENING to CONNECTED.
    1.31 +    */
    1.32 +  virtual void OnSocketConnectSuccess(BluetoothSocket* aSocket) = 0;
    1.33 +
    1.34 +   /**
    1.35 +    * A callback function which would be called when BluetoothSocket::Connect()
    1.36 +    * fails.
    1.37 +    */
    1.38 +  virtual void OnSocketConnectError(BluetoothSocket* aSocket) = 0;
    1.39 +
    1.40 +   /**
    1.41 +    * A callback function which would be called when a socket connection
    1.42 +    * is dropped. To be more specific, this would be called when socket state
    1.43 +    * changes from CONNECTED/LISTENING to DISCONNECTED.
    1.44 +    */
    1.45 +  virtual void OnSocketDisconnect(BluetoothSocket* aSocket) = 0;
    1.46 +
    1.47 +};
    1.48 +
    1.49 +END_BLUETOOTH_NAMESPACE
    1.50 +
    1.51 +#endif

mercurial