|
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/. */ |
|
5 |
|
6 #ifndef mozilla_dom_telephony_TelephonyParent_h |
|
7 #define mozilla_dom_telephony_TelephonyParent_h |
|
8 |
|
9 #include "mozilla/dom/telephony/TelephonyCommon.h" |
|
10 #include "mozilla/dom/telephony/PTelephonyParent.h" |
|
11 #include "mozilla/dom/telephony/PTelephonyRequestParent.h" |
|
12 #include "nsITelephonyProvider.h" |
|
13 |
|
14 BEGIN_TELEPHONY_NAMESPACE |
|
15 |
|
16 class TelephonyParent : public PTelephonyParent |
|
17 , public nsITelephonyListener |
|
18 { |
|
19 public: |
|
20 NS_DECL_ISUPPORTS |
|
21 NS_DECL_NSITELEPHONYLISTENER |
|
22 |
|
23 TelephonyParent(); |
|
24 |
|
25 protected: |
|
26 virtual ~TelephonyParent() {} |
|
27 |
|
28 virtual void |
|
29 ActorDestroy(ActorDestroyReason why); |
|
30 |
|
31 virtual bool |
|
32 RecvPTelephonyRequestConstructor(PTelephonyRequestParent* aActor, const IPCTelephonyRequest& aRequest) MOZ_OVERRIDE; |
|
33 |
|
34 virtual PTelephonyRequestParent* |
|
35 AllocPTelephonyRequestParent(const IPCTelephonyRequest& aRequest) MOZ_OVERRIDE; |
|
36 |
|
37 virtual bool |
|
38 DeallocPTelephonyRequestParent(PTelephonyRequestParent* aActor) MOZ_OVERRIDE; |
|
39 |
|
40 virtual bool |
|
41 Recv__delete__() MOZ_OVERRIDE; |
|
42 |
|
43 virtual bool |
|
44 RecvRegisterListener() MOZ_OVERRIDE; |
|
45 |
|
46 virtual bool |
|
47 RecvUnregisterListener() MOZ_OVERRIDE; |
|
48 |
|
49 virtual bool |
|
50 RecvHangUpCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; |
|
51 |
|
52 virtual bool |
|
53 RecvAnswerCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; |
|
54 |
|
55 virtual bool |
|
56 RecvRejectCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; |
|
57 |
|
58 virtual bool |
|
59 RecvHoldCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; |
|
60 |
|
61 virtual bool |
|
62 RecvResumeCall(const uint32_t& aClientId, const uint32_t& aCallIndex) MOZ_OVERRIDE; |
|
63 |
|
64 virtual bool |
|
65 RecvConferenceCall(const uint32_t& aClientId) MOZ_OVERRIDE; |
|
66 |
|
67 virtual bool |
|
68 RecvSeparateCall(const uint32_t& aClientId, const uint32_t& callIndex) MOZ_OVERRIDE; |
|
69 |
|
70 virtual bool |
|
71 RecvHoldConference(const uint32_t& aClientId) MOZ_OVERRIDE; |
|
72 |
|
73 virtual bool |
|
74 RecvResumeConference(const uint32_t& aClientId) MOZ_OVERRIDE; |
|
75 |
|
76 virtual bool |
|
77 RecvStartTone(const uint32_t& aClientId, const nsString& aTone) MOZ_OVERRIDE; |
|
78 |
|
79 virtual bool |
|
80 RecvStopTone(const uint32_t& aClientId) MOZ_OVERRIDE; |
|
81 |
|
82 virtual bool |
|
83 RecvGetMicrophoneMuted(bool* aMuted) MOZ_OVERRIDE; |
|
84 |
|
85 virtual bool |
|
86 RecvSetMicrophoneMuted(const bool& aMuted) MOZ_OVERRIDE; |
|
87 |
|
88 virtual bool |
|
89 RecvGetSpeakerEnabled(bool* aEnabled) MOZ_OVERRIDE; |
|
90 |
|
91 virtual bool |
|
92 RecvSetSpeakerEnabled(const bool& aEnabled) MOZ_OVERRIDE; |
|
93 |
|
94 private: |
|
95 bool mActorDestroyed; |
|
96 bool mRegistered; |
|
97 }; |
|
98 |
|
99 class TelephonyRequestParent : public PTelephonyRequestParent |
|
100 , public nsITelephonyListener |
|
101 , public nsITelephonyCallback |
|
102 { |
|
103 friend class TelephonyParent; |
|
104 |
|
105 public: |
|
106 NS_DECL_ISUPPORTS |
|
107 NS_DECL_NSITELEPHONYLISTENER |
|
108 NS_DECL_NSITELEPHONYCALLBACK |
|
109 |
|
110 protected: |
|
111 TelephonyRequestParent(); |
|
112 virtual ~TelephonyRequestParent() {} |
|
113 |
|
114 virtual void |
|
115 ActorDestroy(ActorDestroyReason why); |
|
116 |
|
117 private: |
|
118 bool mActorDestroyed; |
|
119 |
|
120 bool |
|
121 DoRequest(const EnumerateCallsRequest& aRequest); |
|
122 |
|
123 bool |
|
124 DoRequest(const DialRequest& aRequest); |
|
125 }; |
|
126 |
|
127 END_TELEPHONY_NAMESPACE |
|
128 |
|
129 #endif /* mozilla_dom_telephony_TelephonyParent_h */ |