author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:30:35 +0300 | |
branch | RCL_3 |
changeset 86 | ed599363c2d7 |
parent 78 | 356f28cd5ca0 |
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 |
||
31 |
// Literals |
|
32 |
||
33 |
// --------------------------------------------------------- |
|
34 |
// CAdtUpdaterAppUi::CAdtUpdaterAppUi |
|
35 |
// rest of the details are commented in the header |
|
36 |
// --------------------------------------------------------- |
|
37 |
// |
|
38 |
CAdtUpdaterAppUi::CAdtUpdaterAppUi() |
|
39 |
{ |
|
40 |
__PRINTS( "CAdtUpdaterAppUi::CAdtUpdaterAppUi - Entry" ); |
|
41 |
||
42 |
// No implementation yet. |
|
43 |
||
44 |
__PRINTS( "CAdtUpdaterAppUi::CAdtUpdaterAppUi - Exit" ); |
|
45 |
} |
|
46 |
||
47 |
// --------------------------------------------------------- |
|
48 |
// CAdtUpdaterAppUi::~CAdtUpdaterAppUi |
|
49 |
// rest of the details are commented in the header |
|
50 |
// --------------------------------------------------------- |
|
51 |
// |
|
52 |
CAdtUpdaterAppUi::~CAdtUpdaterAppUi() |
|
53 |
{ |
|
54 |
__PRINTS( "CAdtUpdaterAppUi::~CAdtUpdaterAppUi - Entry" ); |
|
55 |
||
56 |
if( iContainer ) |
|
57 |
{ |
|
58 |
RemoveFromStack(iContainer); |
|
59 |
delete iContainer; |
|
60 |
iContainer = NULL; |
|
61 |
} |
|
62 |
||
63 |
__PRINTS( "CAdtUpdaterAppUi::~CAdtUpdaterAppUi - Exit" ); |
|
64 |
} |
|
65 |
||
66 |
// --------------------------------------------------------- |
|
67 |
// CAdtUpdaterAppUi::ConstructL |
|
68 |
// rest of the details are commented in the header |
|
69 |
// --------------------------------------------------------- |
|
70 |
// |
|
71 |
void CAdtUpdaterAppUi::ConstructL() |
|
72 |
{ |
|
73 |
__PRINTS( "CAdtUpdaterAppUi::ConstructL - Entry" ); |
|
74 |
||
75 |
//Single click integration |
|
76 |
BaseConstructL( EStandardApp | EAknEnableSkin | EAknEnableMSK | |
|
77 |
EAknSingleClickCompatible ); |
|
78 |
||
78
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
79 |
iAdtWgId = iCoeEnv->RootWin().Identifier(); |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
80 |
|
66 | 81 |
// Sets the priority for window group |
82 |
CEikonEnv &eikEnv = *CEikonEnv::Static(); |
|
83 |
eikEnv.RootWin().SetOrdinalPosition( KOrdinalPosition, KOrdinalPriority ); |
|
84 |
||
85 |
// Disable priority changes of window server. |
|
86 |
eikEnv.WsSession().ComputeMode( RWsSession::EPriorityControlDisabled ); |
|
87 |
||
88 |
if( !iContainer ) |
|
89 |
{ |
|
90 |
// Container is not present. Construct and add to the control stack. |
|
91 |
iContainer = CAdtUpdaterContainer::NewL( ApplicationRect() ); |
|
92 |
||
93 |
AddToStackL( iContainer ); |
|
94 |
// Get the Nitz information. |
|
95 |
iContainer->InformAboutNwUpdateL(); |
|
96 |
} |
|
97 |
||
98 |
__PRINTS( "CAdtUpdaterAppUi::ConstructL - Exit" ); |
|
99 |
} |
|
100 |
||
101 |
// --------------------------------------------------------- |
|
102 |
// CAdtUpdaterAppUi::HandleCommandL |
|
103 |
// rest of the details are commented in the header |
|
104 |
// --------------------------------------------------------- |
|
105 |
// |
|
106 |
void CAdtUpdaterAppUi::HandleCommandL( TInt aCommandId ) |
|
107 |
{ |
|
108 |
__PRINTS( "CAdtUpdaterAppUi::HandleCommandL - Entry" ); |
|
109 |
||
110 |
switch( aCommandId ) |
|
111 |
{ |
|
112 |
case EEikCmdExit: |
|
113 |
case EAknCmdExit: |
|
114 |
{ |
|
115 |
__PRINTS( "CAdtUpdaterAppUi::HandleCommandL - Exit" ); |
|
116 |
||
117 |
Exit(); |
|
118 |
} |
|
119 |
break; |
|
120 |
||
121 |
default: |
|
122 |
{ |
|
123 |
// No implementation yet. |
|
124 |
} |
|
125 |
break; |
|
126 |
} |
|
127 |
||
128 |
__PRINTS( "CAdtUpdaterAppUi::HandleCommandL - Exit" ); |
|
129 |
} |
|
130 |
||
131 |
// --------------------------------------------------------- |
|
132 |
// CAdtUpdaterAppUi::HandleForegroundEventL |
|
133 |
// rest of the details are commented in the header |
|
134 |
// --------------------------------------------------------- |
|
135 |
// |
|
136 |
void CAdtUpdaterAppUi::HandleForegroundEventL( TBool aForeground ) |
|
137 |
{ |
|
138 |
__PRINTS( "CAdtUpdaterAppUi::HandleForegroundEventL - Entry" ); |
|
139 |
||
140 |
if( !aForeground && iContainer->QueryDialogsInDisplay() ) |
|
141 |
{ |
|
142 |
ToggleAppViewL( ETrue ); |
|
143 |
} |
|
144 |
||
145 |
__PRINTS( "CAdtUpdaterAppUi::HandleForegroundEventL - Exit" ); |
|
146 |
} |
|
147 |
||
148 |
// --------------------------------------------------------- |
|
78
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
149 |
// CAdtUpdaterAppUi::IsAppInBackground |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
150 |
// 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
|
151 |
// --------------------------------------------------------- |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
152 |
// |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
153 |
TBool CAdtUpdaterAppUi::IsAppInBackground() |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
154 |
{ |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
155 |
__PRINTS( "CAdtUpdaterAppUi::IsAppInBackground - Entry" ); |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
156 |
// 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
|
157 |
TInt activeWgId = iCoeEnv->WsSession().GetFocusWindowGroup(); |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
158 |
__PRINTS( "CAdtUpdaterAppUi::IsAppInBackground - Exit" ); |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
159 |
if(activeWgId != iAdtWgId) |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
160 |
{ |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
161 |
return ETrue; |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
162 |
} |
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
163 |
return EFalse; |
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 |
|
356f28cd5ca0
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
166 |
// --------------------------------------------------------- |
66 | 167 |
// CAdtUpdaterAppUi::ToggleAppViewL |
168 |
// rest of the details are commented in the header |
|
169 |
// --------------------------------------------------------- |
|
170 |
// |
|
171 |
void CAdtUpdaterAppUi::ToggleAppViewL( TBool aForeground ) |
|
172 |
{ |
|
173 |
__PRINTS( "CCAdtUpdaterAppUi::ToggleAppViewL - Entry" ); |
|
174 |
||
175 |
// Construct en empty TApaTask object. |
|
176 |
// Giving it a reference to the Window Server session. |
|
177 |
TApaTask task( iEikonEnv->WsSession( ) ); |
|
178 |
||
179 |
// Initialise the object with the window group id of |
|
180 |
// our application (so that it represent our app). |
|
181 |
task.SetWgId( CEikonEnv::Static()->RootWin().Identifier() ); |
|
182 |
||
183 |
if( aForeground ) |
|
184 |
{ |
|
185 |
__PRINTS( "Bringing application to foreground" ); |
|
186 |
||
187 |
// Request window server to bring our application to foreground. |
|
188 |
task.BringToForeground(); |
|
189 |
} |
|
190 |
else |
|
191 |
{ |
|
192 |
__PRINTS( "Sending application to background" ); |
|
193 |
||
194 |
// Request window server to send our application to background. |
|
195 |
task.SendToBackground(); |
|
196 |
} |
|
197 |
||
198 |
__PRINTS( "CAdtUpdaterAppUi::ToggleAppViewL - Exit" ); |
|
199 |
} |
|
200 |
||
201 |
// --------------------------------------------------------- |
|
202 |
// CAdtUpdaterAppView::HideStatusPane |
|
203 |
// rest of the details are commented in the header |
|
204 |
// --------------------------------------------------------- |
|
205 |
// |
|
206 |
void CAdtUpdaterAppUi::HideStatusPane( TBool aHide ) |
|
207 |
{ |
|
208 |
__PRINTS( "CAdtUpdaterAppUi::HideStatusPane - Entry" ); |
|
209 |
||
210 |
if( aHide ) |
|
211 |
{ |
|
212 |
// Hide the status pane. |
|
213 |
CEikStatusPane* statusPane = StatusPane(); |
|
214 |
statusPane->MakeVisible( EFalse ); |
|
215 |
} |
|
216 |
||
217 |
__PRINTS( "CAdtUpdaterAppUi::HideStatusPane - Exit" ); |
|
218 |
} |
|
219 |
||
220 |
// End of file |