1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_telephony_TelephonyChild_h
7 #define mozilla_dom_telephony_TelephonyChild_h
9 #include "mozilla/dom/telephony/TelephonyCommon.h"
10 #include "mozilla/dom/telephony/PTelephonyChild.h"
11 #include "mozilla/dom/telephony/PTelephonyRequestChild.h"
12 #include "nsITelephonyService.h"
14 BEGIN_TELEPHONY_NAMESPACE
16 class TelephonyIPCService
;
18 class TelephonyChild
: public PTelephonyChild
21 TelephonyChild(TelephonyIPCService
* aService
);
24 virtual ~TelephonyChild();
27 ActorDestroy(ActorDestroyReason aWhy
) MOZ_OVERRIDE
;
29 virtual PTelephonyRequestChild
*
30 AllocPTelephonyRequestChild(const IPCTelephonyRequest
& aRequest
) MOZ_OVERRIDE
;
33 DeallocPTelephonyRequestChild(PTelephonyRequestChild
* aActor
) MOZ_OVERRIDE
;
36 RecvNotifyCallError(const uint32_t& aClientId
, const int32_t& aCallIndex
,
37 const nsString
& aError
) MOZ_OVERRIDE
;
40 RecvNotifyCallStateChanged(const uint32_t& aClientId
,
41 const IPCCallStateData
& aData
) MOZ_OVERRIDE
;
44 RecvNotifyCdmaCallWaiting(const uint32_t& aClientId
,
45 const IPCCdmaWaitingCallData
& aData
) MOZ_OVERRIDE
;
48 RecvNotifyConferenceCallStateChanged(const uint16_t& aCallState
) MOZ_OVERRIDE
;
51 RecvNotifyConferenceError(const nsString
& aName
,
52 const nsString
& aMessage
) MOZ_OVERRIDE
;
55 RecvNotifySupplementaryService(const uint32_t& aClientId
,
56 const int32_t& aCallIndex
,
57 const uint16_t& aNotification
) MOZ_OVERRIDE
;
60 nsRefPtr
<TelephonyIPCService
> mService
;
63 class TelephonyRequestChild
: public PTelephonyRequestChild
66 TelephonyRequestChild(nsITelephonyListener
* aListener
,
67 nsITelephonyCallback
* aCallback
);
70 virtual ~TelephonyRequestChild() {}
73 ActorDestroy(ActorDestroyReason aWhy
) MOZ_OVERRIDE
;
76 Recv__delete__(const IPCTelephonyResponse
& aResponse
) MOZ_OVERRIDE
;
79 RecvNotifyEnumerateCallState(const uint32_t& aClientId
,
80 const IPCCallStateData
& aData
) MOZ_OVERRIDE
;
84 DoResponse(const SuccessResponse
& aResponse
);
87 DoResponse(const ErrorResponse
& aResponse
);
90 DoResponse(const DialResponseCallSuccess
& aResponse
);
92 nsCOMPtr
<nsITelephonyListener
> mListener
;
93 nsCOMPtr
<nsITelephonyCallback
> mCallback
;
96 END_TELEPHONY_NAMESPACE
98 #endif // mozilla_dom_telephony_TelephonyChild_h