author | hgs |
Fri, 03 Sep 2010 13:33:36 +0300 | |
changeset 65 | 2a5d4ab426d3 |
parent 45 | 6b911d05207e |
child 51 | f39ed5e045e0 |
child 78 | baacf668fe89 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2004 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: This file contains the header file of the CPEPhoneModel class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef CPEPHONEMODEL_H |
|
20 |
#define CPEPHONEMODEL_H |
|
21 |
||
22 |
//INCLUDES |
|
23 |
#include "mpeactivestarter.h" |
|
24 |
#include "mpephonemodelinternal.h" |
|
25 |
#include <apgtask.h> |
|
26 |
#include <coemain.h> |
|
27 |
#include <cpephonemodelif.h> |
|
28 |
#include <DosSvrServices.h> |
|
29 |
#include <e32base.h> |
|
30 |
#include <talogger.h> |
|
31 |
||
32 |
// FORWARD DECLARATIONS |
|
33 |
class CPEActiveStarter; |
|
34 |
class CCCE; |
|
35 |
class CPEEngineInfo; |
|
36 |
class CPEGsmAudioData; |
|
37 |
class CPEExternalDataHandler; |
|
38 |
class CPEMessageHandler; |
|
39 |
class CPESimStateMonitor; |
|
40 |
class MEngineMonitor; |
|
41 |
class MPEContactHandling; |
|
42 |
class MPECallHandling; |
|
43 |
class MPELogHandling; |
|
44 |
class MCCEDtmfInterface; |
|
45 |
class CPEAudioFactory; |
|
46 |
class MPEServiceHandling; |
|
47 |
class CPERemotePartyInfoMediator; |
|
48 |
class PhoneServices; |
|
49 |
||
50 |
// CLASS DECLARATION |
|
51 |
||
52 |
// DESCRIPTION |
|
53 |
// Handles phone related events from the phone application. |
|
54 |
// |
|
55 |
NONSHARABLE_CLASS( CPEPhoneModel ) |
|
56 |
: public CPEPhoneModelIF, |
|
57 |
public MPEPhoneModelInternal, |
|
58 |
public MPEActiveStarter |
|
59 |
{ |
|
60 |
public: //Constructors and destructor |
|
61 |
||
62 |
// Starting modules of active starter (StepL method) |
|
63 |
enum TActiveStarterSteps |
|
64 |
{ |
|
65 |
EPEInitializeCceConnection = 0, |
|
66 |
EPEExternalData, |
|
67 |
EPECallHandling, |
|
68 |
EPEAudioHandling, |
|
69 |
EPELogHandlingPhaseOne, |
|
70 |
EPEContactHandlingPhaseOne, |
|
71 |
EPESimStateMonitor, |
|
72 |
EPEServiceHandling, |
|
73 |
EPEMessageHandler, |
|
74 |
EPESimChangedMonitor, |
|
75 |
EPESimStatusMonitorStart, |
|
76 |
EPELogHandlingPhaseTwo, |
|
77 |
EPEContactHandlingPhaseTwo, |
|
78 |
EPEMediatorCommandHandler, |
|
79 |
EPEPhoneServices, |
|
80 |
EPENetworkHandling |
|
81 |
}; |
|
82 |
||
83 |
/** |
|
84 |
* Two-phased constructor. |
|
85 |
* |
|
86 |
* @param aEngineMonitor, for phone application communication |
|
87 |
*/ |
|
88 |
static CPEPhoneModel* NewL( MEngineMonitor& aEngineMonitor ); |
|
89 |
||
90 |
/** |
|
91 |
* Two-phased constructor for module tests. |
|
92 |
* |
|
93 |
* @param aEngineMonitor, for phone application communication |
|
94 |
* @param aAudioFactory for creating audio related classes. |
|
95 |
*/ |
|
96 |
static CPEPhoneModel* NewL( |
|
97 |
MEngineMonitor& aEngineMonitor, |
|
98 |
CPEAudioFactory& aAudioFactory ); |
|
99 |
||
100 |
/** |
|
101 |
* Destructor. |
|
102 |
*/ |
|
103 |
virtual ~CPEPhoneModel( ); |
|
104 |
||
105 |
public: //New functions |
|
106 |
||
107 |
/** |
|
108 |
* Recalls starting of modules after leave occured in the middle of StepL sequence. |
|
109 |
* |
|
110 |
*/ |
|
111 |
void RecallSteps( ); |
|
112 |
||
113 |
/** |
|
114 |
* Starts modules of PhoneEngine. |
|
115 |
* |
|
116 |
* @return True or False depending on wether to continue stepping. |
|
117 |
*/ |
|
118 |
TBool StepL( ); |
|
119 |
||
120 |
/** |
|
121 |
* Constructs Contact Handling Phase Two |
|
122 |
*/ |
|
123 |
void ConstructContactHandlingPhaseTwoL(); |
|
124 |
||
125 |
// Functions from CPEPhonemodelIF |
|
126 |
||
127 |
/** |
|
128 |
* From CPEPhonemodelIF |
|
129 |
* Returns the name of the specified message to PhoneEngine |
|
130 |
* |
|
131 |
* @since S60 v.4.0 |
|
132 |
* @param aMessage is the message code |
|
133 |
* @return String containing the name of the message |
|
134 |
*/ |
|
135 |
TPtrC NameByMessageToPhoneEngine( const TInt aMessage ) const; |
|
136 |
||
137 |
/** |
|
138 |
* From CPEPhonemodelIF |
|
139 |
* Returns the name of the specified message from PhoneEngine |
|
140 |
||
141 |
* @since S60 v.4.0 |
|
142 |
* @param aMessage is the message code |
|
143 |
* @return String containing the name of the message |
|
144 |
*/ |
|
145 |
TPtrC NameByMessageFromPhoneEngine( const TInt aMessage ) const; |
|
146 |
||
147 |
// Functions from MPEPhoneModel base class |
|
148 |
||
149 |
/** |
|
150 |
* From MPEPhoneModel |
|
151 |
* Returns pointer to information object (CPEEngineInfo) |
|
152 |
* |
|
153 |
* @return Return pointer to CPEEngineInfo object as MPEEngineInfo. |
|
154 |
*/ |
|
155 |
MPEEngineInfo* EngineInfo(); |
|
156 |
||
157 |
/** |
|
158 |
* From MPEPhoneModel |
|
159 |
* Reroutes messages from the phone application to the message handler |
|
160 |
* |
|
161 |
* @param aMessage is the message code. |
|
162 |
* @return Return possible error code. |
|
163 |
*/ |
|
164 |
void HandleMessage( const TInt aMessage ); |
|
165 |
||
166 |
// Functions from MPEPhoneModelInternal base class |
|
167 |
||
168 |
/** |
|
169 |
* From MPEPhoneModelInternal |
|
170 |
* Returns pointer to information object (CPEEngineInfo) |
|
171 |
* |
|
172 |
* @return pointer to CPEEngineInfo object as MPEDataStore |
|
173 |
*/ |
|
174 |
MPEDataStore* DataStore(); |
|
175 |
||
176 |
/** |
|
177 |
* From MPEPhoneModelInternal |
|
178 |
* Returns pointer to external data handler |
|
179 |
* |
|
180 |
* @return pointer to CPEExternalDataHandler as MPEExternalDataHandler |
|
181 |
*/ |
|
182 |
MPEExternalDataHandler* DataStoreExt(); |
|
183 |
||
184 |
/** |
|
185 |
* From MPEPhoneModelInternal |
|
186 |
* Returns pointer to Mediator Command handler |
|
187 |
* |
|
188 |
* @return pointer to CPERemotePartyInfoMediator object |
|
189 |
*/ |
|
190 |
CPERemotePartyInfoMediator* MediatorCommunicationHandler(); |
|
191 |
||
192 |
/** |
|
193 |
* From MPEPhoneModelInternal |
|
194 |
* Handle internal message |
|
195 |
* |
|
196 |
* @since S60 v4.0 |
|
197 |
* @param aMessage specifies the event that has taken place |
|
198 |
* @param aCallId is the call id number. |
|
199 |
*/ |
|
200 |
void HandleInternalMessage( const TInt aMessage ); |
|
201 |
||
202 |
||
203 |
/** |
|
204 |
* From MPEPhoneModelInternal |
|
205 |
* Reroutes messages from the subsystems to the message handler |
|
206 |
* |
|
207 |
* @param aMessage is the message id. |
|
208 |
* @return None. |
|
209 |
*/ |
|
210 |
void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage ); |
|
211 |
||
212 |
/** |
|
213 |
* From MPEPhoneModelInternal |
|
214 |
* Reroutes messages from the subsystems to the message handler. |
|
215 |
* |
|
216 |
* @param aMessage is the message id. |
|
217 |
* @param aCallId is the call id number. |
|
218 |
* @return None. |
|
219 |
*/ |
|
220 |
void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, |
|
221 |
const TInt aCallId ); |
|
222 |
||
223 |
||
224 |
private: |
|
225 |
||
226 |
/** |
|
227 |
* C++ default constructor. |
|
228 |
* @param aAudioFactory Makes copy of aAudioFactory |
|
229 |
*/ |
|
230 |
CPEPhoneModel( |
|
231 |
MEngineMonitor& aEngineMonitor ); |
|
232 |
||
233 |
/** |
|
234 |
* C++ default constructor. |
|
235 |
* @param aAudioFactory Makes copy of aAudioFactory |
|
236 |
*/ |
|
237 |
CPEPhoneModel( |
|
238 |
MEngineMonitor& aEngineMonitor, |
|
239 |
CPEAudioFactory& aAudioFactory ); |
|
240 |
||
241 |
/** |
|
242 |
* By default EPOC constructor is private. |
|
243 |
*/ |
|
244 |
void ConstructL(); |
|
245 |
||
246 |
/** |
|
247 |
* Static callback function to send message |
|
248 |
* @param aSelf - pointer to itself |
|
249 |
* @return KErrNone |
|
250 |
*/ |
|
251 |
static TInt CallBackMessageSend( TAny* aSelf ); |
|
252 |
||
253 |
/** |
|
254 |
* Process messages from the subsystems. |
|
255 |
* |
|
256 |
* @param aMessage is the message id. |
|
257 |
* @param aCallId is the call id number. |
|
258 |
* @return error from message handler. |
|
259 |
*/ |
|
260 |
TInt ProcessMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, |
|
261 |
const TInt aCallId ); |
|
262 |
||
263 |
/** |
|
264 |
* Determines which messages needs to be delayed and delays |
|
265 |
* sending them to Engine monitor. |
|
266 |
* |
|
267 |
* @param aMessage is the message id. |
|
268 |
* @param aCallId is the call id number. |
|
269 |
* @return info indicating wheather message sending needs to be delayed. |
|
270 |
*/ |
|
271 |
TBool DelayMessageSending( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, |
|
272 |
const TInt aCallId ); |
|
273 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
274 |
/** |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
275 |
* Gets call error from callinfo |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
276 |
*/ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
277 |
void SetCallError( TInt aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
278 |
|
37 | 279 |
|
280 |
private: //Data |
|
281 |
||
282 |
// Starts Phone Engine's modules asynchronically. |
|
283 |
CPEActiveStarter* iActiveStarter; |
|
284 |
// MEngineMonitor is the message api to phone application |
|
285 |
MEngineMonitor& iEngineMonitor; |
|
286 |
// CPEEngineInfo object which handles engine information |
|
287 |
CPEEngineInfo* iEngineInfo; |
|
288 |
// CPEMessageHandler object which handles messages |
|
289 |
CPEMessageHandler* iMessageHandler; |
|
290 |
// MPECallHandling object which handles call related commands |
|
291 |
MPECallHandling* iCallHandling; |
|
292 |
// CPEAudioHandling object which handles audio related commands |
|
293 |
CPEGsmAudioData* iAudioData; |
|
294 |
// Handle to log handling |
|
295 |
MPELogHandling* iLogHandling; |
|
296 |
// Handle to contact handling |
|
297 |
MPEContactHandling* iContactHandling; |
|
298 |
MPEServiceHandling* iServiceHandling; |
|
299 |
// handle to file server session |
|
300 |
RFs iFsSession; |
|
301 |
// External data handler |
|
302 |
CPEExternalDataHandler* iExternalDataHandler; |
|
303 |
// SIM changed monitor |
|
304 |
CPESimStateMonitor* iSimChangedMonitor; |
|
305 |
// SIM state monitor |
|
306 |
CPESimStateMonitor* iSimStatusMonitor; |
|
307 |
// DosServer connect error code. |
|
308 |
TInt iErrorCode; |
|
309 |
// Stepper counter |
|
310 |
TInt iStep; |
|
311 |
// CCE interface |
|
312 |
CCCE* iConvergedCallEngine; |
|
313 |
// CCE dtmf interface |
|
314 |
MCCEDtmfInterface* iDtmfInterface; |
|
315 |
/* |
|
316 |
* Audio factory |
|
317 |
* Not own. |
|
318 |
*/ |
|
319 |
CPEAudioFactory* iAudioFactory; |
|
320 |
// Callback |
|
321 |
CIdle* iCallStackCutter; |
|
322 |
// Message Id for callback |
|
323 |
MEngineMonitor::TPEMessagesFromPhoneEngine iCallBackMessage; |
|
324 |
// Call Id for callback |
|
325 |
TInt iCallBackCallId ; |
|
326 |
||
327 |
// Mediator command handler |
|
328 |
CPERemotePartyInfoMediator* iMediatorCommunicationHandler; |
|
329 |
||
330 |
// Phone Services offered via Qt Highway |
|
331 |
PhoneServices* iPhoneServices; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
332 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
333 |
// Mobile call info. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
334 |
RMobileCall::TMobileCallInfoV3* iCallInfo; |
37 | 335 |
}; |
336 |
||
337 |
#endif // CPEPHONEMODEL_H |
|
338 |
||
339 |
// End of File |