2013-09-06 23:19:53 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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_telephony_TelephonyParent_h
|
|
|
|
#define mozilla_dom_telephony_TelephonyParent_h
|
|
|
|
|
|
|
|
#include "mozilla/dom/telephony/TelephonyCommon.h"
|
|
|
|
#include "mozilla/dom/telephony/PTelephonyParent.h"
|
|
|
|
#include "mozilla/dom/telephony/PTelephonyRequestParent.h"
|
2014-06-03 07:15:25 -07:00
|
|
|
#include "nsITelephonyService.h"
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
BEGIN_TELEPHONY_NAMESPACE
|
|
|
|
|
|
|
|
class TelephonyParent : public PTelephonyParent
|
|
|
|
, public nsITelephonyListener
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSITELEPHONYLISTENER
|
|
|
|
|
|
|
|
TelephonyParent();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~TelephonyParent() {}
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
ActorDestroy(ActorDestroyReason why);
|
|
|
|
|
|
|
|
virtual bool
|
2014-02-26 22:12:30 -08:00
|
|
|
RecvPTelephonyRequestConstructor(PTelephonyRequestParent* aActor, const IPCTelephonyRequest& aRequest) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual PTelephonyRequestParent*
|
2014-02-26 22:12:30 -08:00
|
|
|
AllocPTelephonyRequestParent(const IPCTelephonyRequest& aRequest) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPTelephonyRequestParent(PTelephonyRequestParent* aActor) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
Recv__delete__() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvRegisterListener() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvUnregisterListener() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool
|
2013-10-31 05:05:51 -07:00
|
|
|
RecvHangUpCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual bool
|
2013-10-31 05:05:51 -07:00
|
|
|
RecvAnswerCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual bool
|
2013-10-31 05:05:51 -07:00
|
|
|
RecvRejectCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual bool
|
2013-10-31 05:05:51 -07:00
|
|
|
RecvHoldCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual bool
|
2013-10-31 05:05:51 -07:00
|
|
|
RecvResumeCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual bool
|
2013-10-31 05:05:51 -07:00
|
|
|
RecvConferenceCall(const uint32_t& aClientId) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual bool
|
2013-10-31 05:05:51 -07:00
|
|
|
RecvSeparateCall(const uint32_t& aClientId, const uint32_t& callIndex) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual bool
|
2013-10-31 05:05:51 -07:00
|
|
|
RecvHoldConference(const uint32_t& aClientId) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual bool
|
2013-10-31 05:05:51 -07:00
|
|
|
RecvResumeConference(const uint32_t& aClientId) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual bool
|
2013-10-31 05:05:51 -07:00
|
|
|
RecvStartTone(const uint32_t& aClientId, const nsString& aTone) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual bool
|
2013-10-31 05:05:51 -07:00
|
|
|
RecvStopTone(const uint32_t& aClientId) MOZ_OVERRIDE;
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvGetMicrophoneMuted(bool* aMuted) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvSetMicrophoneMuted(const bool& aMuted) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvGetSpeakerEnabled(bool* aEnabled) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvSetSpeakerEnabled(const bool& aEnabled) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool mActorDestroyed;
|
|
|
|
bool mRegistered;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TelephonyRequestParent : public PTelephonyRequestParent
|
|
|
|
, public nsITelephonyListener
|
2014-02-26 22:12:30 -08:00
|
|
|
, public nsITelephonyCallback
|
2013-09-06 23:19:53 -07:00
|
|
|
{
|
|
|
|
friend class TelephonyParent;
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSITELEPHONYLISTENER
|
2014-02-26 22:12:30 -08:00
|
|
|
NS_DECL_NSITELEPHONYCALLBACK
|
2013-09-06 23:19:53 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
TelephonyRequestParent();
|
|
|
|
virtual ~TelephonyRequestParent() {}
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
ActorDestroy(ActorDestroyReason why);
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool mActorDestroyed;
|
|
|
|
|
|
|
|
bool
|
2014-02-26 22:12:30 -08:00
|
|
|
DoRequest(const EnumerateCallsRequest& aRequest);
|
|
|
|
|
|
|
|
bool
|
|
|
|
DoRequest(const DialRequest& aRequest);
|
2013-09-06 23:19:53 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
END_TELEPHONY_NAMESPACE
|
|
|
|
|
|
|
|
#endif /* mozilla_dom_telephony_TelephonyParent_h */
|