author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 06 Jul 2010 14:15:47 +0300 | |
changeset 46 | bc5a64e5bc3c |
parent 37 | ba76fc04e6c2 |
child 50 | 377c906a8701 |
child 51 | f39ed5e045e0 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2005 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: |
|
15 |
* Phone UI controller class. |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
||
20 |
#ifndef CPHONEUICONTROLLER_H |
|
21 |
#define CPHONEUICONTROLLER_H |
|
22 |
||
23 |
// INCLUDES |
|
24 |
#include <e32base.h> |
|
25 |
#include <e32std.h> |
|
26 |
||
27 |
#include "mphonekeyeventhandler.h" |
|
28 |
#include "mphonemenuandcbaevents.h" |
|
29 |
#include "mphonesystemeventhandler.h" |
|
30 |
#include "mphonestatemachine.h" |
|
31 |
||
32 |
// FORWARD DECLARATIONS |
|
33 |
class CPhoneEngineHandler; |
|
34 |
class MPhoneKeyEventHandler; |
|
35 |
class CPhoneSystemEventHandler; |
|
36 |
class MPhoneViewCommandHandle; |
|
37 |
class MPhoneStateMachine; |
|
38 |
class CPhoneStateHandle; |
|
39 |
class CPEPhoneModel; |
|
40 |
class CPhoneRemoteControlHandler; |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
41 |
|
37 | 42 |
|
43 |
class CPhoneUIController : |
|
44 |
public CBase, |
|
45 |
public MEngineMonitor, |
|
46 |
public MPhoneKeyEventHandler, |
|
47 |
public MPhoneSystemEventHandler, |
|
48 |
public MPhoneMenuAndCbaEvents |
|
49 |
{ |
|
50 |
public: |
|
51 |
||
52 |
/** |
|
53 |
* Two-phased constructor. |
|
54 |
*/ |
|
55 |
IMPORT_C static CPhoneUIController* NewL( |
|
56 |
MPhoneViewCommandHandle* aViewCommandHandle ); |
|
57 |
||
58 |
/** |
|
59 |
* Destructor. |
|
60 |
*/ |
|
61 |
IMPORT_C virtual ~CPhoneUIController(); |
|
62 |
||
63 |
/** |
|
64 |
* HandleMessage |
|
65 |
* Creates a trap for leaves from message handling functions and |
|
66 |
* calls DoHandleMessage to handle the message. |
|
67 |
* @param aMessage: a message Id from phone application engine |
|
68 |
* @param aCallId: a Id of the call |
|
69 |
* @return |
|
70 |
*/ |
|
71 |
IMPORT_C void HandleMessage( |
|
72 |
const TInt aMessage, |
|
73 |
const TInt aCallId ); |
|
74 |
||
75 |
/** |
|
76 |
* HandleError |
|
77 |
* Implements error handling framework |
|
78 |
* @param aErrorInfo: the error info |
|
79 |
*/ |
|
80 |
IMPORT_C void HandleError( const TPEErrorInfo& aErrorInfo ); |
|
81 |
||
82 |
IMPORT_C TKeyResponse HandleKeyEventL( |
|
83 |
const TKeyEvent& aKeyEvent, |
|
84 |
TEventCode aEventCode ); |
|
85 |
||
86 |
/** |
|
87 |
* From CAknAppUi, initialise a menupane (dynamic). |
|
88 |
* |
|
89 |
* @param aResourceId It is the resource id for the pane. |
|
90 |
* @param aMenuPane It is the menu pane corresponding to the resource. |
|
91 |
*/ |
|
92 |
IMPORT_C void DynInitMenuPaneL( |
|
93 |
TInt aResourceId, |
|
94 |
CEikMenuPane* aMenuPane ); |
|
95 |
||
96 |
/** |
|
97 |
* From CAknAppUi, initialise a menubar (dynamic). |
|
98 |
* |
|
99 |
* @param aResourceId It is the resource id for the bar. |
|
100 |
* @param aMenuBar It is the menu bar corresponding to the resource. |
|
101 |
*/ |
|
102 |
IMPORT_C void DynInitMenuBarL( |
|
103 |
TInt aResourceId, |
|
104 |
CEikMenuBar* aMenuBar ); |
|
105 |
||
106 |
/** |
|
107 |
* From CEikAppUi. For Idle indicator |
|
108 |
*/ |
|
109 |
IMPORT_C void HandleSystemEventL( |
|
110 |
const TWsEvent& aEvent ); |
|
111 |
||
112 |
/** |
|
113 |
* From CAknAppUi, indicates when app ui is on the foreground. |
|
114 |
* @param aForeground It is true if app is on the foreground. |
|
115 |
*/ |
|
116 |
IMPORT_C void HandleForegroundEventL( TBool aForeground ); |
|
117 |
||
118 |
/** |
|
119 |
* Indicates when the Phone app is in the foreground. |
|
120 |
*/ |
|
121 |
IMPORT_C virtual void HandlePhoneForegroundEventL(); |
|
122 |
||
123 |
/** |
|
124 |
* Indicates when the Phone app is losing focus. |
|
125 |
*/ |
|
126 |
IMPORT_C virtual void HandlePhoneFocusLostEventL(); |
|
127 |
||
128 |
/** |
|
129 |
* Indicates when the Idle app is in the foreground. |
|
130 |
*/ |
|
131 |
IMPORT_C virtual void HandleIdleForegroundEventL(); |
|
132 |
||
133 |
/** |
|
134 |
* Handle environment changes. |
|
135 |
* @param aChanges environment changes which may be reported by |
|
136 |
* a change notifier through the RChangeNotifier interface. |
|
137 |
*/ |
|
138 |
IMPORT_C void HandleEnvironmentChangeL( const TInt aChanges ); |
|
139 |
||
140 |
/** |
|
141 |
* Handles startup of the phone application |
|
142 |
*/ |
|
143 |
IMPORT_C void HandlePhoneStartupL(); |
|
144 |
||
145 |
/** |
|
146 |
* Handles commands. |
|
147 |
* @param aCommand It is the code of the command to be handled. |
|
148 |
* @returns boolean value was the command handled by the state |
|
149 |
* (ETrue) or not (EFalse) |
|
150 |
*/ |
|
151 |
IMPORT_C TBool HandleCommandL( TInt aCommand ); |
|
152 |
||
153 |
/** |
|
154 |
* Process command. |
|
155 |
* @param aCommand It is the code of the command to be handled. |
|
156 |
* @returns boolean value was the command handled by the state |
|
157 |
* (ETrue) or not (EFalse) |
|
158 |
*/ |
|
159 |
IMPORT_C TBool ProcessCommandL( TInt aCommand ); |
|
160 |
||
161 |
/** |
|
162 |
* Handles keylock events |
|
163 |
* @param aCommand It is the code of the command to be handled. |
|
164 |
*/ |
|
165 |
IMPORT_C void HandleKeyLockEnabled( TBool aKeylockEnabled ); |
|
166 |
||
167 |
private: |
|
168 |
||
169 |
/** |
|
170 |
* C++ default constructor. |
|
171 |
*/ |
|
172 |
CPhoneUIController(); |
|
173 |
||
174 |
/** |
|
175 |
* By default EPOC constructor is private. |
|
176 |
*/ |
|
177 |
void ConstructL( MPhoneViewCommandHandle* aViewCommandHandle ); |
|
178 |
||
179 |
/** |
|
180 |
* Creates correct protocol DLL depending of the variation. |
|
181 |
*/ |
|
182 |
void CreateProtocolDllL( MPhoneViewCommandHandle* aViewCommandHandle ); |
|
183 |
/** |
|
184 |
* CallBack for Phone Number Editor |
|
185 |
*/ |
|
186 |
static TInt HandlePhoneNumberEditorCallBack( TAny* aAny ); |
|
187 |
||
188 |
/** |
|
189 |
* Handles the CallBack for Phone Number Editor |
|
190 |
*/ |
|
191 |
void DoHandlePhoneNumberEditorCallBack(); |
|
192 |
||
193 |
private: // Data |
|
194 |
||
195 |
/** |
|
196 |
* CPEPhoneModel |
|
197 |
*/ |
|
198 |
MPEPhoneModel* iPhoneEngine; |
|
199 |
||
200 |
/** |
|
201 |
* MPEEngineInfo |
|
202 |
*/ |
|
203 |
MPEEngineInfo* iEngineInfo; |
|
204 |
||
205 |
/** |
|
206 |
* iEngineHandler : |
|
207 |
*/ |
|
208 |
CPhoneEngineHandler* iEngineHandler; |
|
209 |
||
210 |
/** |
|
211 |
* iKeyEventHandler : |
|
212 |
*/ |
|
213 |
MPhoneKeyEventHandler* iKeyEventHandler; |
|
214 |
||
215 |
/** |
|
216 |
* iSystemEventHandler : |
|
217 |
*/ |
|
218 |
CPhoneSystemEventHandler* iSystemEventHandler; |
|
219 |
||
220 |
/** |
|
221 |
* iRemoteControlHandler : |
|
222 |
*/ |
|
223 |
CPhoneRemoteControlHandler* iRemoteControlHandler; |
|
224 |
||
225 |
/** |
|
226 |
* MPhoneStateMachine |
|
227 |
*/ |
|
228 |
CPhoneStateHandle* iStateHandle; |
|
229 |
||
230 |
/** |
|
231 |
* MPhoneStateMachine |
|
232 |
*/ |
|
233 |
MPhoneStateMachine* iStateMachine; // NOT OWNED |
|
234 |
||
235 |
}; |
|
236 |
||
237 |
#endif // CPHONEUICONTROLLER_H |
|
238 |
||
239 |
// End of File |