Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef mozilla_dom_telephony_TelephonyParent_h |
michael@0 | 7 | #define mozilla_dom_telephony_TelephonyParent_h |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/dom/telephony/TelephonyCommon.h" |
michael@0 | 10 | #include "mozilla/dom/telephony/PTelephonyParent.h" |
michael@0 | 11 | #include "mozilla/dom/telephony/PTelephonyRequestParent.h" |
michael@0 | 12 | #include "nsITelephonyProvider.h" |
michael@0 | 13 | |
michael@0 | 14 | BEGIN_TELEPHONY_NAMESPACE |
michael@0 | 15 | |
michael@0 | 16 | class TelephonyParent : public PTelephonyParent |
michael@0 | 17 | , public nsITelephonyListener |
michael@0 | 18 | { |
michael@0 | 19 | public: |
michael@0 | 20 | NS_DECL_ISUPPORTS |
michael@0 | 21 | NS_DECL_NSITELEPHONYLISTENER |
michael@0 | 22 | |
michael@0 | 23 | TelephonyParent(); |
michael@0 | 24 | |
michael@0 | 25 | protected: |
michael@0 | 26 | virtual ~TelephonyParent() {} |
michael@0 | 27 | |
michael@0 | 28 | virtual void |
michael@0 | 29 | ActorDestroy(ActorDestroyReason why); |
michael@0 | 30 | |
michael@0 | 31 | virtual bool |
michael@0 | 32 | RecvPTelephonyRequestConstructor(PTelephonyRequestParent* aActor, const IPCTelephonyRequest& aRequest) MOZ_OVERRIDE; |
michael@0 | 33 | |
michael@0 | 34 | virtual PTelephonyRequestParent* |
michael@0 | 35 | AllocPTelephonyRequestParent(const IPCTelephonyRequest& aRequest) MOZ_OVERRIDE; |
michael@0 | 36 | |
michael@0 | 37 | virtual bool |
michael@0 | 38 | DeallocPTelephonyRequestParent(PTelephonyRequestParent* aActor) MOZ_OVERRIDE; |
michael@0 | 39 | |
michael@0 | 40 | virtual bool |
michael@0 | 41 | Recv__delete__() MOZ_OVERRIDE; |
michael@0 | 42 | |
michael@0 | 43 | virtual bool |
michael@0 | 44 | RecvRegisterListener() MOZ_OVERRIDE; |
michael@0 | 45 | |
michael@0 | 46 | virtual bool |
michael@0 | 47 | RecvUnregisterListener() MOZ_OVERRIDE; |
michael@0 | 48 | |
michael@0 | 49 | virtual bool |
michael@0 | 50 | RecvHangUpCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; |
michael@0 | 51 | |
michael@0 | 52 | virtual bool |
michael@0 | 53 | RecvAnswerCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; |
michael@0 | 54 | |
michael@0 | 55 | virtual bool |
michael@0 | 56 | RecvRejectCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; |
michael@0 | 57 | |
michael@0 | 58 | virtual bool |
michael@0 | 59 | RecvHoldCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; |
michael@0 | 60 | |
michael@0 | 61 | virtual bool |
michael@0 | 62 | RecvResumeCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; |
michael@0 | 63 | |
michael@0 | 64 | virtual bool |
michael@0 | 65 | RecvConferenceCall(const uint32_t& aClientId) MOZ_OVERRIDE; |
michael@0 | 66 | |
michael@0 | 67 | virtual bool |
michael@0 | 68 | RecvSeparateCall(const uint32_t& aClientId, const uint32_t& callIndex) MOZ_OVERRIDE; |
michael@0 | 69 | |
michael@0 | 70 | virtual bool |
michael@0 | 71 | RecvHoldConference(const uint32_t& aClientId) MOZ_OVERRIDE; |
michael@0 | 72 | |
michael@0 | 73 | virtual bool |
michael@0 | 74 | RecvResumeConference(const uint32_t& aClientId) MOZ_OVERRIDE; |
michael@0 | 75 | |
michael@0 | 76 | virtual bool |
michael@0 | 77 | RecvStartTone(const uint32_t& aClientId, const nsString& aTone) MOZ_OVERRIDE; |
michael@0 | 78 | |
michael@0 | 79 | virtual bool |
michael@0 | 80 | RecvStopTone(const uint32_t& aClientId) MOZ_OVERRIDE; |
michael@0 | 81 | |
michael@0 | 82 | virtual bool |
michael@0 | 83 | RecvGetMicrophoneMuted(bool* aMuted) MOZ_OVERRIDE; |
michael@0 | 84 | |
michael@0 | 85 | virtual bool |
michael@0 | 86 | RecvSetMicrophoneMuted(const bool& aMuted) MOZ_OVERRIDE; |
michael@0 | 87 | |
michael@0 | 88 | virtual bool |
michael@0 | 89 | RecvGetSpeakerEnabled(bool* aEnabled) MOZ_OVERRIDE; |
michael@0 | 90 | |
michael@0 | 91 | virtual bool |
michael@0 | 92 | RecvSetSpeakerEnabled(const bool& aEnabled) MOZ_OVERRIDE; |
michael@0 | 93 | |
michael@0 | 94 | private: |
michael@0 | 95 | bool mActorDestroyed; |
michael@0 | 96 | bool mRegistered; |
michael@0 | 97 | }; |
michael@0 | 98 | |
michael@0 | 99 | class TelephonyRequestParent : public PTelephonyRequestParent |
michael@0 | 100 | , public nsITelephonyListener |
michael@0 | 101 | , public nsITelephonyCallback |
michael@0 | 102 | { |
michael@0 | 103 | friend class TelephonyParent; |
michael@0 | 104 | |
michael@0 | 105 | public: |
michael@0 | 106 | NS_DECL_ISUPPORTS |
michael@0 | 107 | NS_DECL_NSITELEPHONYLISTENER |
michael@0 | 108 | NS_DECL_NSITELEPHONYCALLBACK |
michael@0 | 109 | |
michael@0 | 110 | protected: |
michael@0 | 111 | TelephonyRequestParent(); |
michael@0 | 112 | virtual ~TelephonyRequestParent() {} |
michael@0 | 113 | |
michael@0 | 114 | virtual void |
michael@0 | 115 | ActorDestroy(ActorDestroyReason why); |
michael@0 | 116 | |
michael@0 | 117 | private: |
michael@0 | 118 | bool mActorDestroyed; |
michael@0 | 119 | |
michael@0 | 120 | bool |
michael@0 | 121 | DoRequest(const EnumerateCallsRequest& aRequest); |
michael@0 | 122 | |
michael@0 | 123 | bool |
michael@0 | 124 | DoRequest(const DialRequest& aRequest); |
michael@0 | 125 | }; |
michael@0 | 126 | |
michael@0 | 127 | END_TELEPHONY_NAMESPACE |
michael@0 | 128 | |
michael@0 | 129 | #endif /* mozilla_dom_telephony_TelephonyParent_h */ |