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 file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_bluetooth_ipc_bluetoothservicechildprocess_h__ michael@0: #define mozilla_dom_bluetooth_ipc_bluetoothservicechildprocess_h__ michael@0: michael@0: #include "BluetoothService.h" michael@0: michael@0: namespace mozilla { michael@0: namespace ipc { michael@0: class UnixSocketConsumer; michael@0: } michael@0: namespace dom { michael@0: namespace bluetooth { michael@0: michael@0: class BluetoothChild; michael@0: michael@0: } // namespace bluetooth michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: michael@0: BEGIN_BLUETOOTH_NAMESPACE michael@0: michael@0: class BluetoothServiceChildProcess : public BluetoothService michael@0: { michael@0: friend class mozilla::dom::bluetooth::BluetoothChild; michael@0: michael@0: public: michael@0: static BluetoothServiceChildProcess* michael@0: Create(); michael@0: michael@0: virtual void michael@0: RegisterBluetoothSignalHandler(const nsAString& aNodeName, michael@0: BluetoothSignalObserver* aMsgHandler) michael@0: MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: UnregisterBluetoothSignalHandler(const nsAString& aNodeName, michael@0: BluetoothSignalObserver* aMsgHandler) michael@0: MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: GetDefaultAdapterPathInternal(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: GetPairedDevicePropertiesInternal(const nsTArray& aDeviceAddresses, michael@0: BluetoothReplyRunnable* aRunnable) michael@0: MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: GetConnectedDevicePropertiesInternal(uint16_t aServiceUuid, michael@0: BluetoothReplyRunnable* aRunnable) michael@0: MOZ_OVERRIDE; michael@0: virtual nsresult michael@0: StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: SetProperty(BluetoothObjectType aType, michael@0: const BluetoothNamedValue& aValue, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: CreatePairedDeviceInternal(const nsAString& aAddress, michael@0: int aTimeout, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: RemoveDeviceInternal(const nsAString& aObjectPath, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: GetServiceChannel(const nsAString& aDeviceAddress, michael@0: const nsAString& aServiceUuid, michael@0: BluetoothProfileManagerBase* aManager) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: UpdateSdpRecords(const nsAString& aDeviceAddress, michael@0: BluetoothProfileManagerBase* aManager) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: SetPinCodeInternal(const nsAString& aDeviceAddress, michael@0: const nsAString& aPinCode, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: SetPasskeyInternal(const nsAString& aDeviceAddress, michael@0: uint32_t aPasskey, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: SetPairingConfirmationInternal(const nsAString& aDeviceAddress, michael@0: bool aConfirm, michael@0: BluetoothReplyRunnable* aRunnable) michael@0: MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: Connect(const nsAString& aDeviceAddress, michael@0: uint32_t aCod, michael@0: uint16_t aServiceUuid, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: Disconnect(const nsAString& aDeviceAddress, michael@0: uint16_t aServiceUuid, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: IsConnected(uint16_t aServiceUuid) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: SendFile(const nsAString& aDeviceAddress, michael@0: BlobParent* aBlobParent, michael@0: BlobChild* aBlobChild, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: SendFile(const nsAString& aDeviceAddress, michael@0: nsIDOMBlob* aBlob, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: StopSendingFile(const nsAString& aDeviceAddress, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: ConfirmReceivingFile(const nsAString& aDeviceAddress, michael@0: bool aConfirm, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: ConnectSco(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: DisconnectSco(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: IsScoConnected(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: #ifdef MOZ_B2G_RIL michael@0: virtual void michael@0: AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: IgnoreWaitingCall(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: ToggleCalls(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: #endif michael@0: michael@0: virtual void michael@0: SendMetaData(const nsAString& aTitle, michael@0: const nsAString& aArtist, michael@0: const nsAString& aAlbum, michael@0: int64_t aMediaNumber, michael@0: int64_t aTotalMediaCount, michael@0: int64_t aDuration, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: SendPlayStatus(int64_t aDuration, michael@0: int64_t aPosition, michael@0: const nsAString& aPlayStatus, michael@0: BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: UpdatePlayStatus(uint32_t aDuration, michael@0: uint32_t aPosition, michael@0: ControlPlayStatus aPlayStatus) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: SendSinkMessage(const nsAString& aDeviceAddresses, michael@0: const nsAString& aMessage) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: SendInputMessage(const nsAString& aDeviceAddresses, michael@0: const nsAString& aMessage) MOZ_OVERRIDE; michael@0: michael@0: protected: michael@0: BluetoothServiceChildProcess(); michael@0: virtual ~BluetoothServiceChildProcess(); michael@0: michael@0: void michael@0: NoteDeadActor(); michael@0: michael@0: void michael@0: NoteShutdownInitiated(); michael@0: michael@0: virtual nsresult michael@0: HandleStartup() MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: HandleShutdown() MOZ_OVERRIDE; michael@0: michael@0: private: michael@0: // This method should never be called. michael@0: virtual nsresult michael@0: StartInternal() MOZ_OVERRIDE; michael@0: michael@0: // This method should never be called. michael@0: virtual nsresult michael@0: StopInternal() MOZ_OVERRIDE; michael@0: michael@0: bool michael@0: IsSignalRegistered(const nsAString& aNodeName) { michael@0: return !!mBluetoothSignalObserverTable.Get(aNodeName); michael@0: } michael@0: }; michael@0: michael@0: END_BLUETOOTH_NAMESPACE michael@0: michael@0: #endif // mozilla_dom_bluetooth_ipc_bluetoothservicechildprocess_h__