gecko-dev/dom/telephony/ipc/TelephonyChild.h

104 строки
2.8 KiB
C
Исходник Обычный вид История

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
2013-09-07 10:19:53 +04:00
/* 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_TelephonyChild_h
#define mozilla_dom_telephony_TelephonyChild_h
#include "mozilla/dom/telephony/PTelephonyChild.h"
#include "mozilla/dom/telephony/PTelephonyRequestChild.h"
#include "mozilla/dom/telephony/TelephonyCommon.h"
#include "nsITelephonyCallInfo.h"
#include "nsITelephonyService.h"
2013-09-07 10:19:53 +04:00
BEGIN_TELEPHONY_NAMESPACE
class TelephonyIPCService;
2013-09-07 10:19:53 +04:00
class TelephonyChild : public PTelephonyChild
{
public:
explicit TelephonyChild(TelephonyIPCService* aService);
2013-09-07 10:19:53 +04:00
protected:
virtual ~TelephonyChild();
2013-09-07 10:19:53 +04:00
virtual void
ActorDestroy(ActorDestroyReason aWhy) override;
2013-09-07 10:19:53 +04:00
virtual PTelephonyRequestChild*
AllocPTelephonyRequestChild(const IPCTelephonyRequest& aRequest) override;
2013-09-07 10:19:53 +04:00
virtual bool
DeallocPTelephonyRequestChild(PTelephonyRequestChild* aActor) override;
2013-09-07 10:19:53 +04:00
virtual bool
RecvNotifyCallStateChanged(nsTArray<nsITelephonyCallInfo*>&& aAllInfo) override;
2013-09-07 10:19:53 +04:00
virtual bool
RecvNotifyCdmaCallWaiting(const uint32_t& aClientId,
const IPCCdmaWaitingCallData& aData) override;
2013-09-07 10:19:53 +04:00
virtual bool
RecvNotifyConferenceCallStateChanged(const uint16_t& aCallState) override;
2013-09-07 10:19:53 +04:00
virtual bool
RecvNotifyConferenceError(const nsString& aName,
const nsString& aMessage) override;
2013-09-07 10:19:53 +04:00
virtual bool
RecvNotifySupplementaryService(const uint32_t& aClientId,
const int32_t& aCallIndex,
const uint16_t& aNotification) override;
2013-09-07 10:19:53 +04:00
private:
nsRefPtr<TelephonyIPCService> mService;
2013-09-07 10:19:53 +04:00
};
class TelephonyRequestChild : public PTelephonyRequestChild
{
public:
TelephonyRequestChild(nsITelephonyListener* aListener,
nsITelephonyCallback* aCallback);
2013-09-07 10:19:53 +04:00
protected:
virtual ~TelephonyRequestChild() {}
virtual void
ActorDestroy(ActorDestroyReason aWhy) override;
2013-09-07 10:19:53 +04:00
virtual bool
Recv__delete__(const IPCTelephonyResponse& aResponse) override;
2013-09-07 10:19:53 +04:00
virtual bool
RecvNotifyEnumerateCallState(nsITelephonyCallInfo* const& aInfo) override;
2013-09-07 10:19:53 +04:00
virtual bool
RecvNotifyDialMMI(const nsString& aServiceCode) override;
private:
bool
DoResponse(const SuccessResponse& aResponse);
bool
DoResponse(const ErrorResponse& aResponse);
bool
DoResponse(const DialResponseCallSuccess& aResponse);
bool
DoResponse(const DialResponseMMISuccess& aResponse);
bool
DoResponse(const DialResponseMMIError& aResponse);
2013-09-07 10:19:53 +04:00
nsCOMPtr<nsITelephonyListener> mListener;
nsCOMPtr<nsITelephonyCallback> mCallback;
2013-09-07 10:19:53 +04:00
};
END_TELEPHONY_NAMESPACE
#endif // mozilla_dom_telephony_TelephonyChild_h