1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/telephony/ipc/TelephonyParent.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,129 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef mozilla_dom_telephony_TelephonyParent_h 1.10 +#define mozilla_dom_telephony_TelephonyParent_h 1.11 + 1.12 +#include "mozilla/dom/telephony/TelephonyCommon.h" 1.13 +#include "mozilla/dom/telephony/PTelephonyParent.h" 1.14 +#include "mozilla/dom/telephony/PTelephonyRequestParent.h" 1.15 +#include "nsITelephonyProvider.h" 1.16 + 1.17 +BEGIN_TELEPHONY_NAMESPACE 1.18 + 1.19 +class TelephonyParent : public PTelephonyParent 1.20 + , public nsITelephonyListener 1.21 +{ 1.22 +public: 1.23 + NS_DECL_ISUPPORTS 1.24 + NS_DECL_NSITELEPHONYLISTENER 1.25 + 1.26 + TelephonyParent(); 1.27 + 1.28 +protected: 1.29 + virtual ~TelephonyParent() {} 1.30 + 1.31 + virtual void 1.32 + ActorDestroy(ActorDestroyReason why); 1.33 + 1.34 + virtual bool 1.35 + RecvPTelephonyRequestConstructor(PTelephonyRequestParent* aActor, const IPCTelephonyRequest& aRequest) MOZ_OVERRIDE; 1.36 + 1.37 + virtual PTelephonyRequestParent* 1.38 + AllocPTelephonyRequestParent(const IPCTelephonyRequest& aRequest) MOZ_OVERRIDE; 1.39 + 1.40 + virtual bool 1.41 + DeallocPTelephonyRequestParent(PTelephonyRequestParent* aActor) MOZ_OVERRIDE; 1.42 + 1.43 + virtual bool 1.44 + Recv__delete__() MOZ_OVERRIDE; 1.45 + 1.46 + virtual bool 1.47 + RecvRegisterListener() MOZ_OVERRIDE; 1.48 + 1.49 + virtual bool 1.50 + RecvUnregisterListener() MOZ_OVERRIDE; 1.51 + 1.52 + virtual bool 1.53 + RecvHangUpCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; 1.54 + 1.55 + virtual bool 1.56 + RecvAnswerCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; 1.57 + 1.58 + virtual bool 1.59 + RecvRejectCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; 1.60 + 1.61 + virtual bool 1.62 + RecvHoldCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; 1.63 + 1.64 + virtual bool 1.65 + RecvResumeCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; 1.66 + 1.67 + virtual bool 1.68 + RecvConferenceCall(const uint32_t& aClientId) MOZ_OVERRIDE; 1.69 + 1.70 + virtual bool 1.71 + RecvSeparateCall(const uint32_t& aClientId, const uint32_t& callIndex) MOZ_OVERRIDE; 1.72 + 1.73 + virtual bool 1.74 + RecvHoldConference(const uint32_t& aClientId) MOZ_OVERRIDE; 1.75 + 1.76 + virtual bool 1.77 + RecvResumeConference(const uint32_t& aClientId) MOZ_OVERRIDE; 1.78 + 1.79 + virtual bool 1.80 + RecvStartTone(const uint32_t& aClientId, const nsString& aTone) MOZ_OVERRIDE; 1.81 + 1.82 + virtual bool 1.83 + RecvStopTone(const uint32_t& aClientId) MOZ_OVERRIDE; 1.84 + 1.85 + virtual bool 1.86 + RecvGetMicrophoneMuted(bool* aMuted) MOZ_OVERRIDE; 1.87 + 1.88 + virtual bool 1.89 + RecvSetMicrophoneMuted(const bool& aMuted) MOZ_OVERRIDE; 1.90 + 1.91 + virtual bool 1.92 + RecvGetSpeakerEnabled(bool* aEnabled) MOZ_OVERRIDE; 1.93 + 1.94 + virtual bool 1.95 + RecvSetSpeakerEnabled(const bool& aEnabled) MOZ_OVERRIDE; 1.96 + 1.97 +private: 1.98 + bool mActorDestroyed; 1.99 + bool mRegistered; 1.100 +}; 1.101 + 1.102 +class TelephonyRequestParent : public PTelephonyRequestParent 1.103 + , public nsITelephonyListener 1.104 + , public nsITelephonyCallback 1.105 +{ 1.106 + friend class TelephonyParent; 1.107 + 1.108 +public: 1.109 + NS_DECL_ISUPPORTS 1.110 + NS_DECL_NSITELEPHONYLISTENER 1.111 + NS_DECL_NSITELEPHONYCALLBACK 1.112 + 1.113 +protected: 1.114 + TelephonyRequestParent(); 1.115 + virtual ~TelephonyRequestParent() {} 1.116 + 1.117 + virtual void 1.118 + ActorDestroy(ActorDestroyReason why); 1.119 + 1.120 +private: 1.121 + bool mActorDestroyed; 1.122 + 1.123 + bool 1.124 + DoRequest(const EnumerateCallsRequest& aRequest); 1.125 + 1.126 + bool 1.127 + DoRequest(const DialRequest& aRequest); 1.128 +}; 1.129 + 1.130 +END_TELEPHONY_NAMESPACE 1.131 + 1.132 +#endif /* mozilla_dom_telephony_TelephonyParent_h */