mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
d9c8a6c13c
Backed out changeset a107de5616a0 (bug 814625) Backed out changeset 416665a419f4 (bug 814625) Backed out changeset b6fc8734864f (bug 814625) Backed out changeset 9f5e2e44a914 (bug 814625) Backed out changeset 17b3050df362 (bug 814625) Backed out changeset 43a047c081c8 (bug 814625) Backed out changeset 90bdcd099320 (bug 814625) Backed out changeset 8957cc31cce2 (bug 814625) Backed out changeset de45eb7a8d16 (bug 814625)
131 lines
3.3 KiB
C++
131 lines
3.3 KiB
C++
/* -*- 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/. */
|
|
|
|
#include "mozilla/dom/telephony/TelephonyChild.h"
|
|
|
|
USING_TELEPHONY_NAMESPACE
|
|
|
|
/*******************************************************************************
|
|
* TelephonyChild
|
|
******************************************************************************/
|
|
|
|
TelephonyChild::TelephonyChild(nsITelephonyListener* aListener)
|
|
: mListener(aListener)
|
|
{
|
|
MOZ_ASSERT(aListener);
|
|
}
|
|
|
|
void
|
|
TelephonyChild::ActorDestroy(ActorDestroyReason aWhy)
|
|
{
|
|
mListener = nullptr;
|
|
}
|
|
|
|
PTelephonyRequestChild*
|
|
TelephonyChild::AllocPTelephonyRequestChild()
|
|
{
|
|
MOZ_CRASH("Caller is supposed to manually construct a request!");
|
|
}
|
|
|
|
bool
|
|
TelephonyChild::DeallocPTelephonyRequestChild(PTelephonyRequestChild* aActor)
|
|
{
|
|
delete aActor;
|
|
return true;
|
|
}
|
|
|
|
bool
|
|
TelephonyChild::RecvNotifyCallError(const int32_t& aCallIndex,
|
|
const nsString& aError)
|
|
{
|
|
MOZ_ASSERT(mListener);
|
|
|
|
mListener->NotifyError(aCallIndex, aError);
|
|
return true;
|
|
}
|
|
|
|
bool
|
|
TelephonyChild::RecvNotifyCallStateChanged(const IPCCallStateData& aData)
|
|
{
|
|
MOZ_ASSERT(mListener);
|
|
|
|
mListener->CallStateChanged(aData.callIndex(),
|
|
aData.callState(),
|
|
aData.number(),
|
|
aData.isActive(),
|
|
aData.isOutGoing(),
|
|
aData.isEmergency(),
|
|
aData.isConference());
|
|
return true;
|
|
}
|
|
|
|
bool
|
|
TelephonyChild::RecvNotifyCdmaCallWaiting(const nsString& aNumber)
|
|
{
|
|
MOZ_ASSERT(mListener);
|
|
|
|
mListener->NotifyCdmaCallWaiting(aNumber);
|
|
return true;
|
|
}
|
|
|
|
bool
|
|
TelephonyChild::RecvNotifyConferenceCallStateChanged(const uint16_t& aCallState)
|
|
{
|
|
MOZ_ASSERT(mListener);
|
|
|
|
mListener->ConferenceCallStateChanged(aCallState);
|
|
return true;
|
|
}
|
|
|
|
bool
|
|
TelephonyChild::RecvNotifySupplementaryService(const int32_t& aCallIndex,
|
|
const uint16_t& aNotification)
|
|
{
|
|
MOZ_ASSERT(mListener);
|
|
|
|
mListener->SupplementaryServiceNotification(aCallIndex, aNotification);
|
|
return true;
|
|
}
|
|
|
|
/*******************************************************************************
|
|
* TelephonyRequestChild
|
|
******************************************************************************/
|
|
|
|
TelephonyRequestChild::TelephonyRequestChild(nsITelephonyListener* aListener)
|
|
: mListener(aListener)
|
|
{
|
|
MOZ_ASSERT(aListener);
|
|
}
|
|
|
|
void
|
|
TelephonyRequestChild::ActorDestroy(ActorDestroyReason aWhy)
|
|
{
|
|
mListener = nullptr;
|
|
}
|
|
|
|
bool
|
|
TelephonyRequestChild::Recv__delete__()
|
|
{
|
|
MOZ_ASSERT(mListener);
|
|
|
|
mListener->EnumerateCallStateComplete();
|
|
return true;
|
|
}
|
|
|
|
bool
|
|
TelephonyRequestChild::RecvNotifyEnumerateCallState(const IPCCallStateData& aData)
|
|
{
|
|
MOZ_ASSERT(mListener);
|
|
|
|
mListener->EnumerateCallState(aData.callIndex(),
|
|
aData.callState(),
|
|
aData.number(),
|
|
aData.isActive(),
|
|
aData.isOutGoing(),
|
|
aData.isEmergency(),
|
|
aData.isConference());
|
|
return true;
|
|
}
|