michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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_telephony_TelephonyParent_h michael@0: #define mozilla_dom_telephony_TelephonyParent_h michael@0: michael@0: #include "mozilla/dom/telephony/TelephonyCommon.h" michael@0: #include "mozilla/dom/telephony/PTelephonyParent.h" michael@0: #include "mozilla/dom/telephony/PTelephonyRequestParent.h" michael@0: #include "nsITelephonyProvider.h" michael@0: michael@0: BEGIN_TELEPHONY_NAMESPACE michael@0: michael@0: class TelephonyParent : public PTelephonyParent michael@0: , public nsITelephonyListener michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSITELEPHONYLISTENER michael@0: michael@0: TelephonyParent(); michael@0: michael@0: protected: michael@0: virtual ~TelephonyParent() {} michael@0: michael@0: virtual void michael@0: ActorDestroy(ActorDestroyReason why); michael@0: michael@0: virtual bool michael@0: RecvPTelephonyRequestConstructor(PTelephonyRequestParent* aActor, const IPCTelephonyRequest& aRequest) MOZ_OVERRIDE; michael@0: michael@0: virtual PTelephonyRequestParent* michael@0: AllocPTelephonyRequestParent(const IPCTelephonyRequest& aRequest) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: DeallocPTelephonyRequestParent(PTelephonyRequestParent* aActor) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: Recv__delete__() MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvRegisterListener() MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvUnregisterListener() MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvHangUpCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvAnswerCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvRejectCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvHoldCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvResumeCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvConferenceCall(const uint32_t& aClientId) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvSeparateCall(const uint32_t& aClientId, const uint32_t& callIndex) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvHoldConference(const uint32_t& aClientId) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvResumeConference(const uint32_t& aClientId) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvStartTone(const uint32_t& aClientId, const nsString& aTone) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvStopTone(const uint32_t& aClientId) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvGetMicrophoneMuted(bool* aMuted) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvSetMicrophoneMuted(const bool& aMuted) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvGetSpeakerEnabled(bool* aEnabled) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvSetSpeakerEnabled(const bool& aEnabled) MOZ_OVERRIDE; michael@0: michael@0: private: michael@0: bool mActorDestroyed; michael@0: bool mRegistered; michael@0: }; michael@0: michael@0: class TelephonyRequestParent : public PTelephonyRequestParent michael@0: , public nsITelephonyListener michael@0: , public nsITelephonyCallback michael@0: { michael@0: friend class TelephonyParent; michael@0: michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSITELEPHONYLISTENER michael@0: NS_DECL_NSITELEPHONYCALLBACK michael@0: michael@0: protected: michael@0: TelephonyRequestParent(); michael@0: virtual ~TelephonyRequestParent() {} michael@0: michael@0: virtual void michael@0: ActorDestroy(ActorDestroyReason why); michael@0: michael@0: private: michael@0: bool mActorDestroyed; michael@0: michael@0: bool michael@0: DoRequest(const EnumerateCallsRequest& aRequest); michael@0: michael@0: bool michael@0: DoRequest(const DialRequest& aRequest); michael@0: }; michael@0: michael@0: END_TELEPHONY_NAMESPACE michael@0: michael@0: #endif /* mozilla_dom_telephony_TelephonyParent_h */