Bug 851046 - New interface: BluetoothSocketObserver. r=mrbkap
authorEric Chou <echou@mozilla.com>
Tue, 26 Feb 2013 10:34:54 +0800
changeset 139314 4511485feea4ba9a656a2b2631604aa0066ce1a4
parent 139313 1c37f9187fa83fd53e81dc5fcd917ec6c81586d0
child 139315 59c72b632fcceb06dad7e7eaa3856c7e3456353c
push idunknown
push userunknown
push dateunknown
reviewersmrbkap
bugs851046
milestone23.0a1
Bug 851046 - New interface: BluetoothSocketObserver. r=mrbkap For those instances which want to be notified for any event sent from a BluetoothSocket instance, they need to implement this interface to get notification.
dom/bluetooth/BluetoothSocketObserver.h
new file mode 100644
--- /dev/null
+++ b/dom/bluetooth/BluetoothSocketObserver.h
@@ -0,0 +1,28 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=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/UnixSocket.h>
+
+using namespace mozilla::ipc;
+
+BEGIN_BLUETOOTH_NAMESPACE
+
+class BluetoothSocketObserver
+{
+public:
+  virtual void ReceiveSocketData(nsAutoPtr<UnixSocketRawData>& aMessage) = 0;
+  virtual void OnConnectSuccess() = 0;
+  virtual void OnConnectError() = 0;
+  virtual void OnDisconnect() = 0;
+};
+
+END_BLUETOOTH_NAMESPACE
+
+#endif