author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:11:35 +0300 | |
branch | RCL_3 |
changeset 78 | 356f28cd5ca0 |
parent 66 | bd7edf625bdd |
child 86 | ed599363c2d7 |
permissions | -rw-r--r-- |
66 | 1 |
/* |
2 |
* Copyright (c) 2008 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 is the source file for the CAdtUpdaterAppUi class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// System includes |
|
19 |
#include <apgtask.h> |
|
20 |
#include <w32std.h> |
|
21 |
||
22 |
// User includes |
|
23 |
#include "adtupdaterappui.h" |
|
24 |
#include "adtupdatercontainer.h" |
|
25 |
#include "clock_debug.h" |
|
26 |
||
27 |
// Constants |
|
28 |
const TInt KOrdinalPosition( 0 ); |
|
29 |
const TInt KOrdinalPriority( 0 ); |
|
30 |
||
78
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
31 |
// Uid of phoneapp |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
32 |
const TUid KPhoneUid = {0x100058B3}; |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
33 |
|
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
34 |
|
66 | 35 |
// Literals |
36 |
||
37 |
// --------------------------------------------------------- |
|
38 |
// CAdtUpdaterAppUi::CAdtUpdaterAppUi |
|
39 |
// rest of the details are commented in the header |
|
40 |
// --------------------------------------------------------- |
|
41 |
// |
|
42 |
CAdtUpdaterAppUi::CAdtUpdaterAppUi() |
|
43 |
{ |
|
44 |
__PRINTS( "CAdtUpdaterAppUi::CAdtUpdaterAppUi - Entry" ); |
|
45 |
||
46 |
// No implementation yet. |
|
47 |
||
48 |
__PRINTS( "CAdtUpdaterAppUi::CAdtUpdaterAppUi - Exit" ); |
|
49 |
} |
|
50 |
||
51 |
// --------------------------------------------------------- |
|
52 |
// CAdtUpdaterAppUi::~CAdtUpdaterAppUi |
|
53 |
// rest of the details are commented in the header |
|
54 |
// --------------------------------------------------------- |
|
55 |
// |
|
56 |
CAdtUpdaterAppUi::~CAdtUpdaterAppUi() |
|
57 |
{ |
|
58 |
__PRINTS( "CAdtUpdaterAppUi::~CAdtUpdaterAppUi - Entry" ); |
|
59 |
||
60 |
if( iContainer ) |
|
61 |
{ |
|
62 |
RemoveFromStack(iContainer); |
|
63 |
delete iContainer; |
|
64 |
iContainer = NULL; |
|
65 |
} |
|
66 |
||
67 |
__PRINTS( "CAdtUpdaterAppUi::~CAdtUpdaterAppUi - Exit" ); |
|
68 |
} |
|
69 |
||
70 |
// --------------------------------------------------------- |
|
71 |
// CAdtUpdaterAppUi::ConstructL |
|
72 |
// rest of the details are commented in the header |
|
73 |
// --------------------------------------------------------- |
|
74 |
// |
|
75 |
void CAdtUpdaterAppUi::ConstructL() |
|
76 |
{ |
|
77 |
__PRINTS( "CAdtUpdaterAppUi::ConstructL - Entry" ); |
|
78 |
||
79 |
//Single click integration |
|
80 |
BaseConstructL( EStandardApp | EAknEnableSkin | EAknEnableMSK | |
|
81 |
EAknSingleClickCompatible ); |
|
82 |
||
78
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
83 |
iAdtWgId = iCoeEnv->RootWin().Identifier(); |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
84 |
|
66 | 85 |
// Sets the priority for window group |
86 |
CEikonEnv &eikEnv = *CEikonEnv::Static(); |
|
87 |
eikEnv.RootWin().SetOrdinalPosition( KOrdinalPosition, KOrdinalPriority ); |
|
88 |
||
89 |
// Disable priority changes of window server. |
|
90 |
eikEnv.WsSession().ComputeMode( RWsSession::EPriorityControlDisabled ); |
|
91 |
||
92 |
if( !iContainer ) |
|
93 |
{ |
|
94 |
// Container is not present. Construct and add to the control stack. |
|
95 |
iContainer = CAdtUpdaterContainer::NewL( ApplicationRect() ); |
|
96 |
||
97 |
AddToStackL( iContainer ); |
|
98 |
// Get the Nitz information. |
|
99 |
iContainer->InformAboutNwUpdateL(); |
|
100 |
} |
|
101 |
||
102 |
__PRINTS( "CAdtUpdaterAppUi::ConstructL - Exit" ); |
|
103 |
} |
|
104 |
||
105 |
// --------------------------------------------------------- |
|
106 |
// CAdtUpdaterAppUi::HandleCommandL |
|
107 |
// rest of the details are commented in the header |
|
108 |
// --------------------------------------------------------- |
|
109 |
// |
|
110 |
void CAdtUpdaterAppUi::HandleCommandL( TInt aCommandId ) |
|
111 |
{ |
|
112 |
__PRINTS( "CAdtUpdaterAppUi::HandleCommandL - Entry" ); |
|
113 |
||
114 |
switch( aCommandId ) |
|
115 |
{ |
|
116 |
case EEikCmdExit: |
|
117 |
case EAknCmdExit: |
|
118 |
{ |
|
119 |
__PRINTS( "CAdtUpdaterAppUi::HandleCommandL - Exit" ); |
|
120 |
||
121 |
Exit(); |
|
122 |
} |
|
123 |
break; |
|
124 |
||
125 |
default: |
|
126 |
{ |
|
127 |
// No implementation yet. |
|
128 |
} |
|
129 |
break; |
|
130 |
} |
|
131 |
||
132 |
__PRINTS( "CAdtUpdaterAppUi::HandleCommandL - Exit" ); |
|
133 |
} |
|
134 |
||
135 |
// --------------------------------------------------------- |
|
136 |
// CAdtUpdaterAppUi::HandleForegroundEventL |
|
137 |
// rest of the details are commented in the header |
|
138 |
// --------------------------------------------------------- |
|
139 |
// |
|
140 |
void CAdtUpdaterAppUi::HandleForegroundEventL( TBool aForeground ) |
|
141 |
{ |
|
142 |
__PRINTS( "CAdtUpdaterAppUi::HandleForegroundEventL - Entry" ); |
|
143 |
||
144 |
if( !aForeground && iContainer->QueryDialogsInDisplay() ) |
|
145 |
{ |
|
146 |
ToggleAppViewL( ETrue ); |
|
147 |
} |
|
148 |
||
149 |
__PRINTS( "CAdtUpdaterAppUi::HandleForegroundEventL - Exit" ); |
|
150 |
} |
|
151 |
||
152 |
// --------------------------------------------------------- |
|
78
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
153 |
// CAdtUpdaterAppUi::IsAppInBackground |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
154 |
// rest of the details are commented in the header |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
155 |
// --------------------------------------------------------- |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
156 |
// |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
157 |
TBool CAdtUpdaterAppUi::IsAppInBackground() |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
158 |
{ |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
159 |
__PRINTS( "CAdtUpdaterAppUi::IsAppInBackground - Entry" ); |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
160 |
// Gets the window group id of the app coming in foreground |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
161 |
TInt activeWgId = iCoeEnv->WsSession().GetFocusWindowGroup(); |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
162 |
__PRINTS( "CAdtUpdaterAppUi::IsAppInBackground - Exit" ); |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
163 |
if(activeWgId != iAdtWgId) |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
164 |
{ |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
165 |
return ETrue; |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
166 |
} |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
167 |
return EFalse; |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
168 |
} |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
169 |
|
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
170 |
// --------------------------------------------------------- |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
171 |
// CAdtUpdaterAppUi::IsHighPriorityWindowActive |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
172 |
// rest of the details are commented in the header |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
173 |
// --------------------------------------------------------- |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
174 |
// |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
175 |
TBool CAdtUpdaterAppUi::IsHighPriorityWindowActive() |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
176 |
{ |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
177 |
__PRINTS( "CCAdtUpdaterAppUi::IsHighPriorityWindowActive - Entry" ); |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
178 |
// Gets the window group id of the app coming in foreground |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
179 |
TInt activeWgId = iCoeEnv->WsSession().GetFocusWindowGroup(); |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
180 |
TApaTaskList taskList(iCoeEnv->WsSession()); |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
181 |
|
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
182 |
//In future, if any other high priority window will be there, then |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
183 |
//add that particular UID in the below check. |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
184 |
//Note: Key Lock and alarm are not handled here as these windows already |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
185 |
//have high priority than CDT. In callui window group, the window - when |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
186 |
//call is answered, has a low priority, that's why callui is handled here. |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
187 |
__PRINTS( "CCAdtUpdaterAppUi::IsHighPriorityWindowActive - Exit" ); |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
188 |
if(activeWgId == taskList.FindApp(KPhoneUid).WgId()) |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
189 |
{ |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
190 |
return ETrue; |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
191 |
} |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
192 |
return EFalse; |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
193 |
} |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
194 |
// --------------------------------------------------------- |
66 | 195 |
// CAdtUpdaterAppUi::ToggleAppViewL |
196 |
// rest of the details are commented in the header |
|
197 |
// --------------------------------------------------------- |
|
198 |
// |
|
199 |
void CAdtUpdaterAppUi::ToggleAppViewL( TBool aForeground ) |
|
200 |
{ |
|
201 |
__PRINTS( "CCAdtUpdaterAppUi::ToggleAppViewL - Entry" ); |
|
202 |
||
203 |
// Construct en empty TApaTask object. |
|
204 |
// Giving it a reference to the Window Server session. |
|
205 |
TApaTask task( iEikonEnv->WsSession( ) ); |
|
206 |
||
207 |
// Initialise the object with the window group id of |
|
208 |
// our application (so that it represent our app). |
|
209 |
task.SetWgId( CEikonEnv::Static()->RootWin().Identifier() ); |
|
210 |
||
211 |
if( aForeground ) |
|
212 |
{ |
|
213 |
__PRINTS( "Bringing application to foreground" ); |
|
214 |
||
215 |
// Request window server to bring our application to foreground. |
|
216 |
task.BringToForeground(); |
|
217 |
} |
|
218 |
else |
|
219 |
{ |
|
220 |
__PRINTS( "Sending application to background" ); |
|
221 |
||
222 |
// Request window server to send our application to background. |
|
223 |
task.SendToBackground(); |
|
224 |
} |
|
225 |
||
226 |
__PRINTS( "CAdtUpdaterAppUi::ToggleAppViewL - Exit" ); |
|
227 |
} |
|
228 |
||
229 |
// --------------------------------------------------------- |
|
230 |
// CAdtUpdaterAppView::HideStatusPane |
|
231 |
// rest of the details are commented in the header |
|
232 |
// --------------------------------------------------------- |
|
233 |
// |
|
234 |
void CAdtUpdaterAppUi::HideStatusPane( TBool aHide ) |
|
235 |
{ |
|
236 |
__PRINTS( "CAdtUpdaterAppUi::HideStatusPane - Entry" ); |
|
237 |
||
238 |
if( aHide ) |
|
239 |
{ |
|
240 |
// Hide the status pane. |
|
241 |
CEikStatusPane* statusPane = StatusPane(); |
|
242 |
statusPane->MakeVisible( EFalse ); |
|
243 |
} |
|
244 |
||
245 |
__PRINTS( "CAdtUpdaterAppUi::HideStatusPane - Exit" ); |
|
246 |
} |
|
247 |
||
248 |
// End of file |