|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Delivers asynchronous requests to ETel |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSPETELCALLREQUESTER_H |
|
20 #define CSPETELCALLREQUESTER_H |
|
21 |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <etelmm.h> |
|
25 #include <rmmcustomapi.h> |
|
26 #include <ccpdefs.h> |
|
27 |
|
28 class MCSPCallErrorObserver; |
|
29 |
|
30 /** |
|
31 * Makes asynchronic request to ETel interface according to given request type. |
|
32 * Provides canceling via CActive::Cancel(). |
|
33 * |
|
34 */ |
|
35 class CSPEtelCallRequester |
|
36 : public CActive |
|
37 { |
|
38 |
|
39 public: |
|
40 /** |
|
41 * Supported request types. |
|
42 */ |
|
43 enum TRequestType { |
|
44 ERequestTypeNone, |
|
45 ERequestTypeDial, |
|
46 ERequestTypeAnswer, |
|
47 ERequestTypeHangup, |
|
48 ERequestTypeHold, |
|
49 ERequestTypeResume, |
|
50 ERequestTypeGoOneToOne, |
|
51 ERequestTypeSwap, |
|
52 ERequestTypeDialEmergency |
|
53 }; |
|
54 |
|
55 /** |
|
56 * Constructs the requester via two phase. |
|
57 * |
|
58 * @param aObserver the observer for request errors |
|
59 * @param aCall ETel RMobileCall reference that is the object |
|
60 * of the request. |
|
61 */ |
|
62 static CSPEtelCallRequester* NewL( MCSPCallErrorObserver& aObserver, |
|
63 RMobileCall& aCall ); |
|
64 |
|
65 /** |
|
66 * C++ default destructor |
|
67 */ |
|
68 virtual ~CSPEtelCallRequester( ); |
|
69 |
|
70 /** |
|
71 * Makes the request. Note that ERequestTypeDial is made with a |
|
72 * separate MakeDialRequest function. |
|
73 * |
|
74 * @since S60 3.2 |
|
75 * @param aRequest type of request |
|
76 * @return KErrNone if request was sent successfully. |
|
77 * KErrNotSupported if the given request is not supported |
|
78 * KErrArgument if the specified request is not known. |
|
79 * KErrUnknown if unspecified error (should not happen) |
|
80 */ |
|
81 TInt MakeRequest( TRequestType aRequest ); |
|
82 |
|
83 /** |
|
84 * Cancels the request. |
|
85 * |
|
86 * @since S60 3.2 |
|
87 * @param aRequest type of request |
|
88 * @return KErrNone if request was sent successfully. |
|
89 * KErrNotSupported if the given request is not supported |
|
90 * KErrArgument if the specified request is not known. |
|
91 * KErrUnknown if unspecified error (should not happen) |
|
92 */ |
|
93 TInt CancelRequest( TRequestType aRequest ); |
|
94 |
|
95 |
|
96 /** |
|
97 * Makes a dial request. |
|
98 * @since S60 3.2 |
|
99 * @param aCallParamsPckg call parametrs |
|
100 * @param aRemoteParty phone number |
|
101 * @return KErrNone if successful, else error code |
|
102 */ |
|
103 TInt MakeDialRequest( |
|
104 const TDesC8& aCallParams, |
|
105 TDesC& aRemoteParty ); |
|
106 |
|
107 /** |
|
108 * Makes a dial request without FDN check. |
|
109 * @since S60 3.2 |
|
110 * @param aCallParamsPckg call parametrs |
|
111 * @param aRemoteParty phone number |
|
112 * @return KErrNone if successful, else error code |
|
113 */ |
|
114 TInt MakeDialNoFdnCheckRequest( |
|
115 const TDesC8& aCallParams, |
|
116 TDesC& aRemoteParty ); |
|
117 |
|
118 |
|
119 /** |
|
120 * Makes a answer request. |
|
121 * @since S60 3.2 |
|
122 * @param aCallParams call parametrs |
|
123 * @return KErrNone if successful, else error code |
|
124 */ |
|
125 TInt MakeAnswerRequest( |
|
126 const TDesC8& aCallParams ); |
|
127 |
|
128 /** |
|
129 * Makes emergency request. |
|
130 * @param aRecipient emengency number |
|
131 * @return error code |
|
132 */ |
|
133 TInt MakeDialEmergencyRequest( |
|
134 const RMobileENStore::TEmergencyNumber& aRecipient ); |
|
135 |
|
136 /** |
|
137 * Mapping between ETel and CCP errors. |
|
138 * @param aErrorCode ETel error code |
|
139 * @return CCP error code |
|
140 */ |
|
141 TCCPError MapError( TInt aErrorCode ); |
|
142 |
|
143 /** |
|
144 * Getter for the active request. |
|
145 * @return request. |
|
146 */ |
|
147 TRequestType Request(); |
|
148 |
|
149 /** |
|
150 * Cancel dial (applies both emergency and normal calls) |
|
151 * @return result of cancel (system wide error code) |
|
152 */ |
|
153 TInt CSPEtelCallRequester::DialCancel(); |
|
154 |
|
155 protected: // From CActive |
|
156 /** |
|
157 * From CActive |
|
158 * RunL |
|
159 * @since S60 3.2 |
|
160 */ |
|
161 void RunL(); |
|
162 |
|
163 /** |
|
164 * From CActive |
|
165 * Cancels the monitor |
|
166 * @since S60 3.2 |
|
167 */ |
|
168 void DoCancel(); |
|
169 |
|
170 |
|
171 private: |
|
172 |
|
173 /** |
|
174 * Constructs the requester. |
|
175 * |
|
176 * @param aObserver the observer for request errors |
|
177 * @param aCall ETel RMobileCall reference that is the object |
|
178 * of the request. |
|
179 */ |
|
180 CSPEtelCallRequester( MCSPCallErrorObserver& aObserver, |
|
181 RMobileCall& aCall ); |
|
182 |
|
183 |
|
184 private: // data |
|
185 /** |
|
186 * Observer for request errors. |
|
187 */ |
|
188 MCSPCallErrorObserver& iObserver; |
|
189 |
|
190 /** |
|
191 * ETel call which this monitors |
|
192 */ |
|
193 RMobileCall& iCall; |
|
194 |
|
195 /** |
|
196 * Type of request. |
|
197 */ |
|
198 TRequestType iRequestType; |
|
199 |
|
200 }; |
|
201 |
|
202 #endif // CSPETELCALLREQUESTER_H |