author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:18:30 +0300 | |
branch | RCL_3 |
changeset 102 | ba63c83f4716 |
parent 93 | b01126ce0bec |
permissions | -rw-r--r-- |
83 | 1 |
/* |
2 |
* Copyright (c) 2009 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 |
* Implementation of the container control for WidgetManager application. |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
// INCLUDE FILES |
|
20 |
#include <aknViewAppUi.h> |
|
21 |
#include <eikappui.h> |
|
22 |
#include <widgetmanagerview.rsg> |
|
23 |
#include <coemain.h> |
|
24 |
#include <eikenv.h> |
|
25 |
#include <barsread.h> |
|
26 |
#include <AknUtils.h> |
|
27 |
#include <barsread.h> |
|
28 |
#include <StringLoader.h> |
|
29 |
#include <eikenv.h> |
|
30 |
#include <AknIconArray.h> |
|
31 |
#include <aknstyluspopupmenu.h> |
|
32 |
#include <avkon.loc> |
|
33 |
#include <aknlayout.cdl.h> |
|
34 |
#include <layoutmetadata.cdl.h> |
|
35 |
#include <aknlayoutscalable_avkon.cdl.h> |
|
36 |
#include <aknlayoutscalable_apps.cdl.h> |
|
37 |
#include <AknLayout.lag> |
|
38 |
#include <AknsSkinInstance.h> |
|
39 |
#include <AknIconUtils.h> |
|
40 |
#include <AknsDrawUtils.h> |
|
41 |
#include <aknenv.h> |
|
42 |
#include <aknlists.h> |
|
43 |
#include <eikclbd.h> |
|
44 |
#include <aknsfld.h> |
|
45 |
#include <AknsBasicBackgroundControlContext.h> |
|
46 |
#include <apgcli.h> |
|
47 |
#include <widgetmanager.mbg> |
|
48 |
#include <avkon.rsg> |
|
49 |
#include <coecobs.h> |
|
50 |
#include <coecntrl.h> |
|
51 |
#include <featmgr.h> // FeatureManager |
|
52 |
#include <hlplch.h> // HlpLauncher |
|
53 |
#include <csxhelp/hmsc.hlp.hrh> |
|
54 |
#include <aisystemuids.hrh> |
|
55 |
#include <babitflags.h> |
|
56 |
||
57 |
#include "wmcommon.h" |
|
58 |
#include "wmplugin.h" |
|
59 |
#include "wmmaincontainer.h" |
|
60 |
#include "wmmaincontainerview.h" |
|
61 |
#include "wmresourceloader.h" |
|
62 |
#include "widgetmanager.hrh" |
|
63 |
#include "wmlistbox.h" |
|
64 |
#include "wmpersistentwidgetorder.h" |
|
65 |
#include "wmdetailsdlg.h" |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
66 |
#include "wmportalbutton.h" |
83 | 67 |
#include "wmwidgetloaderao.h" |
68 |
#include "wmconfiguration.h" |
|
69 |
#include "wminstaller.h" |
|
70 |
||
71 |
#include <hscontentcontroller.h> // content control api |
|
72 |
#include <hscontentinfoarray.h> // content control api |
|
73 |
||
74 |
// CONSTANTS |
|
75 |
const TInt KTextLimit = 40; // Text-limit for find-field |
|
76 |
const TInt KMinWidgets = 1; // minimum number of widgets to show findpane |
|
77 |
||
78 |
// --------------------------------------------------------- |
|
79 |
// CWmMainContainer::CWmMainContainer() |
|
80 |
// --------------------------------------------------------- |
|
81 |
// |
|
82 |
CWmMainContainer::CWmMainContainer( CWmPlugin& aWmPlugin ) : |
|
83 |
iWmPlugin( aWmPlugin ) |
|
84 |
{ |
|
85 |
iWidgetsList = NULL; |
|
86 |
iFindbox = NULL; |
|
87 |
iFindPaneIsVisible = EFalse; |
|
88 |
iBgContext = NULL; |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
89 |
iFocusMode = ENowhere; |
83 | 90 |
iClosingDown = ETrue; |
91 |
} |
|
92 |
||
93 |
// --------------------------------------------------------- |
|
94 |
// CWmMainContainer::~CWmMainContainer() |
|
95 |
// --------------------------------------------------------- |
|
96 |
// |
|
97 |
CWmMainContainer::~CWmMainContainer() |
|
98 |
{ |
|
99 |
TRAP_IGNORE(DeactivateFindPaneL(EFalse)); |
|
100 |
||
101 |
if ( iWidgetLoader ) |
|
102 |
{ |
|
103 |
iWidgetLoader->SetObserver( NULL ); |
|
104 |
delete iWidgetLoader; |
|
105 |
} |
|
106 |
||
107 |
RemoveCtrlsFromStack(); |
|
108 |
Components().ResetAndDestroy(); |
|
109 |
||
110 |
iWidgetsList = NULL; |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
111 |
iPortalButtonOne = NULL; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
112 |
iPortalButtonTwo = NULL; |
83 | 113 |
iFindbox = NULL; |
114 |
delete iBgContext; |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
115 |
delete iConfiguration; |
83 | 116 |
} |
117 |
||
118 |
// --------------------------------------------------------- |
|
119 |
// CWmMainContainer::NewL |
|
120 |
// --------------------------------------------------------- |
|
121 |
// |
|
122 |
CWmMainContainer* CWmMainContainer::NewL( |
|
123 |
const TRect& aRect, |
|
124 |
CWmPlugin& aWmPlugin ) |
|
125 |
{ |
|
126 |
CWmMainContainer* self = CWmMainContainer::NewLC( |
|
127 |
aRect, |
|
128 |
aWmPlugin ); |
|
129 |
CleanupStack::Pop( self ); |
|
130 |
return self; |
|
131 |
} |
|
132 |
||
133 |
// --------------------------------------------------------- |
|
134 |
// CWmMainContainer::NewLC |
|
135 |
// --------------------------------------------------------- |
|
136 |
// |
|
137 |
CWmMainContainer* CWmMainContainer::NewLC( |
|
138 |
const TRect& aRect, |
|
139 |
CWmPlugin& aWmPlugin ) |
|
140 |
{ |
|
141 |
CWmMainContainer* self = new (ELeave) CWmMainContainer( aWmPlugin ); |
|
142 |
CleanupStack::PushL( self ); |
|
143 |
self->ConstructL( aRect ); |
|
144 |
return self; |
|
145 |
} |
|
146 |
||
147 |
// --------------------------------------------------------- |
|
148 |
// ScreenRect |
|
149 |
// rectangle representing the screen |
|
150 |
// --------------------------------------------------------- |
|
151 |
// |
|
152 |
TRect ScreenRect() |
|
153 |
{ |
|
154 |
TRect screen; |
|
155 |
CCoeEnv* env = CCoeEnv::Static(); |
|
156 |
if ( env ) |
|
157 |
{ |
|
158 |
CWsScreenDevice* screenDevice = env->ScreenDevice(); |
|
159 |
if ( screenDevice ) |
|
160 |
screen.SetRect( TPoint(0,0), screenDevice->SizeInPixels() ); |
|
161 |
} |
|
162 |
return screen; |
|
163 |
} |
|
164 |
||
165 |
// --------------------------------------------------------- |
|
166 |
// CWmMainContainer::ConstructL |
|
167 |
// --------------------------------------------------------- |
|
168 |
// |
|
169 |
void CWmMainContainer::ConstructL( |
|
170 |
const TRect& aRect ) |
|
171 |
{ |
|
172 |
// Initialize control array |
|
173 |
InitComponentArrayL(); |
|
174 |
Components().SetControlsOwnedExternally( ETrue ); |
|
175 |
||
176 |
// create the UI |
|
177 |
CreateWindowL(); |
|
178 |
||
179 |
// background context |
|
180 |
iBgContext = CAknsBasicBackgroundControlContext::NewL( |
|
181 |
KAknsIIDQsnBgScreen, ScreenRect() , ETrue); |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
182 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
183 |
// load configuration |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
184 |
iConfiguration = CWmConfiguration::NewL( iWmPlugin.ResourceLoader() ); |
83 | 185 |
|
186 |
// set up controls |
|
187 |
InitializeControlsL( aRect ); |
|
188 |
||
189 |
// set size and activate |
|
190 |
SetRect( aRect ); |
|
191 |
ActivateL(); |
|
192 |
||
193 |
} |
|
194 |
||
195 |
// --------------------------------------------------------- |
|
196 |
// CWmMainContainer::SizeChanged |
|
197 |
// --------------------------------------------------------- |
|
198 |
// |
|
199 |
void CWmMainContainer::SizeChanged() |
|
200 |
{ |
|
201 |
CCoeControl::SizeChanged(); |
|
202 |
iBgContext->SetRect( ScreenRect() ); |
|
203 |
LayoutControls(); |
|
204 |
} |
|
205 |
||
206 |
// --------------------------------------------------------- |
|
207 |
// CWmMainContainer::LayoutControls |
|
208 |
// --------------------------------------------------------- |
|
209 |
// |
|
210 |
void CWmMainContainer::LayoutControls() |
|
211 |
{ |
|
212 |
TRect rect( Rect() ); |
|
213 |
||
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
214 |
// determine layout type |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
215 |
iLandscape = Layout_Meta_Data::IsLandscapeOrientation(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
216 |
iMirrored = Layout_Meta_Data::IsMirrored(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
217 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
218 |
// layout iPortalButtons |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
219 |
if ( iConfiguration->PortalButtonCount() == 1 ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
220 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
221 |
// one button |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
222 |
TAknWindowLineLayout btnPane = AknLayoutScalable_Apps |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
223 |
::wgtman_btn_pane( iLandscape ? 1 : 0 ).LayoutLine(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
224 |
AknLayoutUtils::LayoutControl( iPortalButtonOne, rect, btnPane ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
225 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
226 |
else |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
227 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
228 |
// two buttons |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
229 |
TInt variety = (iLandscape ? 3 : 2); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
230 |
TAknWindowLineLayout oviBtnLayout = AknLayoutScalable_Apps |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
231 |
::wgtman_btn_pane( variety ).LayoutLine(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
232 |
TAknWindowLineLayout operatorBtnLayout = AknLayoutScalable_Apps |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
233 |
::wgtman_btn_pane_cp_01( variety ).LayoutLine(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
234 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
235 |
// button placement |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
236 |
if ( iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
237 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
238 |
AknLayoutUtils::LayoutControl( iPortalButtonOne, rect, operatorBtnLayout ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
239 |
AknLayoutUtils::LayoutControl( iPortalButtonTwo, rect, oviBtnLayout ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
240 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
241 |
else |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
242 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
243 |
AknLayoutUtils::LayoutControl( iPortalButtonOne, rect, oviBtnLayout ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
244 |
AknLayoutUtils::LayoutControl( iPortalButtonTwo, rect, operatorBtnLayout ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
245 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
246 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
247 |
|
83 | 248 |
// layout iWidgetsList |
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
249 |
TAknWindowLineLayout listPane = AknLayoutScalable_Apps |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
250 |
::listscroll_wgtman_pane( iLandscape ? 1 : 0 ).LayoutLine(); |
83 | 251 |
if( iFindbox && iFindPaneIsVisible ) |
252 |
{ |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
253 |
TAknLayoutRect layoutRect; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
254 |
layoutRect.LayoutRect( rect, listPane ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
255 |
iWidgetsList->SetRect( layoutRect.Rect() ); |
83 | 256 |
HandleFindSizeChanged(); |
257 |
} |
|
258 |
else |
|
259 |
{ |
|
260 |
AknLayoutUtils::LayoutControl( iWidgetsList, rect, listPane ); |
|
261 |
} |
|
262 |
||
263 |
DrawDeferred(); |
|
264 |
} |
|
265 |
||
266 |
// --------------------------------------------------------- |
|
267 |
// CWmMainContainer::OfferKeyEventL |
|
268 |
// --------------------------------------------------------- |
|
269 |
// |
|
270 |
TKeyResponse CWmMainContainer::OfferKeyEventL( |
|
271 |
const TKeyEvent& aKeyEvent, |
|
272 |
TEventCode aType ) |
|
273 |
{ |
|
274 |
TKeyResponse keyResponse( EKeyWasNotConsumed ); |
|
275 |
||
276 |
// This is a bug fix for ou1cimx1#217716 & ou1cimx1#217667. |
|
277 |
// For some weird reason homescreen is genarating one extra EEventKey |
|
278 |
// when using bluetooth keyboard & backspace key. This if is to |
|
279 |
// ignore that event. Extra event allways has iModifiers set to |
|
280 |
// EModifierAutorepeatable, EModifierKeyboardExtend and |
|
281 |
// EModifierNumLock. |
|
282 |
if ( aType == EEventKey && |
|
283 |
aKeyEvent.iScanCode == EStdKeyBackspace && |
|
284 |
aKeyEvent.iModifiers&EModifierKeyboardExtend && |
|
285 |
aKeyEvent.iModifiers&EModifierNumLock && |
|
286 |
aKeyEvent.iModifiers&EModifierAutorepeatable ) |
|
287 |
{ |
|
288 |
return EKeyWasConsumed; |
|
289 |
} |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
290 |
|
83 | 291 |
// Handle search keyevent |
292 |
keyResponse = HandleSearchKeyEventL( aKeyEvent, aType ); |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
293 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
294 |
// Move focus between controls |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
295 |
if ( keyResponse == EKeyWasNotConsumed ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
296 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
297 |
keyResponse = MoveFocusByKeys( aKeyEvent, aType ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
298 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
299 |
|
83 | 300 |
// Handle list keyevent |
301 |
if ( keyResponse == EKeyWasNotConsumed ) |
|
302 |
{ |
|
303 |
keyResponse = HandleListKeyEventL( aKeyEvent, aType ); |
|
304 |
} |
|
305 |
||
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
306 |
// Handle buttons keyevent |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
307 |
if ( keyResponse == EKeyWasNotConsumed ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
308 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
309 |
keyResponse = HandleButtonKeyEventL( aKeyEvent, aType ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
310 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
311 |
|
83 | 312 |
// Update ui if needed |
313 |
if ( keyResponse == EKeyWasConsumed ) |
|
314 |
{ |
|
315 |
DrawDeferred(); |
|
316 |
} |
|
317 |
||
318 |
// Do not let UI framework forward the keys to child controls as |
|
319 |
// we have already done that. |
|
320 |
return EKeyWasConsumed; |
|
321 |
} |
|
322 |
||
323 |
// --------------------------------------------------------- |
|
324 |
// CWmMainContainer::HandleSearchKeyEventL |
|
325 |
// --------------------------------------------------------- |
|
326 |
// |
|
327 |
TKeyResponse CWmMainContainer::HandleSearchKeyEventL( |
|
328 |
const TKeyEvent& aKeyEvent, |
|
329 |
TEventCode aType ) |
|
330 |
{ |
|
331 |
TKeyResponse keyResponse( EKeyWasNotConsumed ); |
|
332 |
||
333 |
// open search field with alpha digit numbers |
|
334 |
if ( aType == EEventKeyDown && !iFindPaneIsVisible && |
|
335 |
aKeyEvent.iScanCode < EStdKeyF1 && |
|
336 |
TChar( aKeyEvent.iScanCode ).IsAlphaDigit() ) |
|
337 |
{ |
|
338 |
ActivateFindPaneL( EFalse ); |
|
339 |
||
340 |
if ( iFindPaneIsVisible ) |
|
341 |
{ |
|
342 |
return EKeyWasConsumed; |
|
343 |
} |
|
344 |
} |
|
345 |
||
346 |
if ( iFindPaneIsVisible && aType == EEventKey ) |
|
347 |
{ |
|
348 |
if ( aKeyEvent.iScanCode == EStdKeyNo || aKeyEvent.iCode == EKeyNo ) |
|
349 |
{ |
|
350 |
DeactivateFindPaneL(); |
|
351 |
return EKeyWasConsumed; |
|
352 |
} |
|
353 |
||
354 |
TBool needsRefresh( EFalse ); |
|
355 |
||
356 |
if ( iFindbox->TextLength() == 0 |
|
357 |
&& aKeyEvent.iScanCode == EStdKeyBackspace ) |
|
358 |
{ |
|
359 |
// if lenght is 0 and backspace is pressed AknFind will deactivate |
|
360 |
// searchbox so we don't want to pass this event to AknFind |
|
361 |
keyResponse = EKeyWasConsumed; |
|
362 |
} |
|
363 |
else |
|
364 |
{ |
|
365 |
keyResponse = AknFind::HandleFindOfferKeyEventL( |
|
366 |
aKeyEvent, aType, this, |
|
367 |
iWidgetsList, iFindbox, ETrue, needsRefresh ); |
|
368 |
} |
|
369 |
if ( needsRefresh ) |
|
370 |
{ |
|
371 |
DrawNow(); |
|
372 |
} |
|
373 |
} |
|
374 |
||
375 |
return keyResponse; |
|
376 |
} |
|
377 |
||
378 |
// --------------------------------------------------------- |
|
379 |
// CWmMainContainer::HandleListKeyEventL |
|
380 |
// --------------------------------------------------------- |
|
381 |
// |
|
382 |
TKeyResponse CWmMainContainer::HandleListKeyEventL( |
|
383 |
const TKeyEvent& aKeyEvent, |
|
384 |
TEventCode aType ) |
|
385 |
{ |
|
386 |
TKeyResponse keyResponse( EKeyWasNotConsumed ); |
|
387 |
||
388 |
// pass key event except backpace or delete key event to widgets list if focused |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
389 |
if ( iWidgetsList->IsFocused() ) |
83 | 390 |
{ |
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
391 |
if ( ( aType == EEventKey ) && ( aKeyEvent.iCode == EKeyBackspace |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
392 |
|| aKeyEvent.iCode == EKeyDelete ) ) |
83 | 393 |
{ |
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
394 |
if( CanDoUninstall() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
395 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
396 |
UninstallWidgetL(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
397 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
398 |
else |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
399 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
400 |
CWmWidgetData* data = iWidgetsList->WidgetData(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
401 |
if( data != NULL ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
402 |
iWmPlugin.ResourceLoader().InfoPopupL( |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
403 |
R_QTN_WM_UNINST_NOT_ALLOWED, data->Name() ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
404 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
405 |
keyResponse = EKeyWasConsumed; |
83 | 406 |
} |
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
407 |
else |
83 | 408 |
{ |
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
409 |
//passing to listbox handler |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
410 |
keyResponse = iWidgetsList->OfferKeyEventL( |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
411 |
aKeyEvent, aType ); |
83 | 412 |
} |
413 |
} |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
414 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
415 |
return keyResponse; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
416 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
417 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
418 |
// --------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
419 |
// CWmMainContainer::HandleButtonKeyEventL |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
420 |
// --------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
421 |
// |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
422 |
TKeyResponse CWmMainContainer::HandleButtonKeyEventL( |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
423 |
const TKeyEvent& aKeyEvent, |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
424 |
TEventCode aType ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
425 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
426 |
TKeyResponse keyResponse( EKeyWasNotConsumed ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
427 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
428 |
// pass key event to portal button if focused |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
429 |
if ( iPortalButtonOne->IsFocused() ) |
83 | 430 |
{ |
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
431 |
keyResponse = iPortalButtonOne->OfferKeyEventL( |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
432 |
aKeyEvent, aType ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
433 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
434 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
435 |
// pass key event to the other portal button if exists and focused |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
436 |
if ( iPortalButtonTwo && iPortalButtonTwo->IsFocused() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
437 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
438 |
keyResponse = iPortalButtonTwo->OfferKeyEventL( |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
439 |
aKeyEvent, aType ); |
83 | 440 |
} |
441 |
||
442 |
return keyResponse; |
|
443 |
} |
|
444 |
||
445 |
// --------------------------------------------------------- |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
446 |
// CWmMainContainer::MoveFocusByKeys |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
447 |
// --------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
448 |
// |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
449 |
TKeyResponse CWmMainContainer::MoveFocusByKeys( |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
450 |
const TKeyEvent& aKeyEvent, |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
451 |
TEventCode aType ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
452 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
453 |
TKeyResponse keyResponse( EKeyWasNotConsumed ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
454 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
455 |
if ( iWidgetsList->IsFocused() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
456 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
457 |
// ------------------------------------ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
458 |
// focus is in the WIDGETS LIST |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
459 |
// ------------------------------------ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
460 |
if ( !iLandscape && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
461 |
aKeyEvent.iScanCode == EStdKeyUpArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
462 |
iWidgetsList->CurrentItemIndex() == 0 ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
463 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
464 |
// widget list top -> up -> ovi button (portrait) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
465 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
466 |
SetFocusToPortalButton( OperatorButtonHigherPriority ( 0 ) ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
467 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
468 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
469 |
else if ( !iLandscape && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
470 |
aKeyEvent.iScanCode == EStdKeyDownArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
471 |
iWidgetsList->CurrentItemIndex() == |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
472 |
iWidgetsList->Model()->NumberOfItems() - 1 ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
473 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
474 |
// widget list bottom -> down -> ovi button (portrait) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
475 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
476 |
SetFocusToPortalButton( OperatorButtonHigherPriority ( 0 ) ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
477 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
478 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
479 |
else if ( iLandscape && !iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
480 |
aKeyEvent.iScanCode == EStdKeyRightArrow ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
481 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
482 |
// widget list -> right -> ovi button (landscape normal) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
483 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
484 |
SetFocusToPortalButton( OperatorButtonHigherPriority ( 0 ) ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
485 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
486 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
487 |
else if ( iLandscape && iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
488 |
aKeyEvent.iScanCode == EStdKeyLeftArrow ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
489 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
490 |
// widget list -> left -> ovi button (landscape mirrored) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
491 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
492 |
SetFocusToPortalButton( OperatorButtonHigherPriority ( 0 ) ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
493 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
494 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
495 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
496 |
else if ( iPortalButtonOne->IsFocused() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
497 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
498 |
// ------------------------------------ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
499 |
// focus is in the FIRST PORTAL BUTTON |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
500 |
// ------------------------------------ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
501 |
if ( !iLandscape && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
502 |
aKeyEvent.iScanCode == EStdKeyDownArrow ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
503 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
504 |
// left portal -> down -> widget list top (portrait) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
505 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
506 |
SetFocusToWidgetList( 0 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
507 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
508 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
509 |
else if ( !iLandscape && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
510 |
aKeyEvent.iScanCode == EStdKeyUpArrow ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
511 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
512 |
// left portal -> up -> widget list bottom (portrait) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
513 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
514 |
SetFocusToWidgetList( iWidgetsList->Model()->NumberOfItems()-1 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
515 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
516 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
517 |
else if ( !iLandscape && !iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
518 |
aKeyEvent.iScanCode == EStdKeyLeftArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
519 |
iConfiguration->PortalButtonCount() > 1 && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
520 |
iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
521 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
522 |
// right portal -> left -> left portal |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
523 |
// (portrait, operator button higher priority ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
524 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
525 |
SetFocusToPortalButton( 1 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
526 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
527 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
528 |
else if ( !iLandscape && !iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
529 |
aKeyEvent.iScanCode == EStdKeyRightArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
530 |
iConfiguration->PortalButtonCount() > 1 && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
531 |
!iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
532 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
533 |
// left portal -> right -> right portal (portrait normal) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
534 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
535 |
SetFocusToPortalButton( 1 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
536 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
537 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
538 |
else if ( !iLandscape && iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
539 |
aKeyEvent.iScanCode == EStdKeyRightArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
540 |
iConfiguration->PortalButtonCount() > 1 && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
541 |
iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
542 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
543 |
// right portal -> left -> left portal (portrait mirrored) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
544 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
545 |
SetFocusToPortalButton( 1 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
546 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
547 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
548 |
else if ( !iLandscape && iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
549 |
aKeyEvent.iScanCode == EStdKeyLeftArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
550 |
iConfiguration->PortalButtonCount() > 1 && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
551 |
!iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
552 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
553 |
// right portal -> left -> left portal (portrait mirrored) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
554 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
555 |
SetFocusToPortalButton( 1 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
556 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
557 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
558 |
else if ( iLandscape && !iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
559 |
aKeyEvent.iScanCode == EStdKeyLeftArrow ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
560 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
561 |
// upper portal -> left -> widget list (landscape normal) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
562 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
563 |
SetFocusToWidgetList(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
564 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
565 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
566 |
else if ( iLandscape && iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
567 |
aKeyEvent.iScanCode == EStdKeyRightArrow ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
568 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
569 |
// upper portal -> right -> widget list (landscape mirrored) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
570 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
571 |
SetFocusToWidgetList(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
572 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
573 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
574 |
else if ( iLandscape && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
575 |
aKeyEvent.iScanCode == EStdKeyUpArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
576 |
iConfiguration->PortalButtonCount() > 1 && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
577 |
iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
578 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
579 |
// lower portal -> up -> upper portal |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
580 |
// (landscape, operator button higher priority ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
581 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
582 |
SetFocusToPortalButton( 1 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
583 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
584 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
585 |
else if ( iLandscape && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
586 |
aKeyEvent.iScanCode == EStdKeyDownArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
587 |
iConfiguration->PortalButtonCount() > 1 && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
588 |
!iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
589 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
590 |
// upper portal -> down -> lower portal (landscape) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
591 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
592 |
SetFocusToPortalButton( 1 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
593 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
594 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
595 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
596 |
else if ( iPortalButtonTwo && iPortalButtonTwo->IsFocused() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
597 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
598 |
// ------------------------------------ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
599 |
// focus is in the SECOND PORTAL BUTTON |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
600 |
// ------------------------------------ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
601 |
if ( !iLandscape && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
602 |
aKeyEvent.iScanCode == EStdKeyDownArrow ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
603 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
604 |
// right portal -> down -> widget list top (portrait) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
605 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
606 |
SetFocusToWidgetList( 0 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
607 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
608 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
609 |
else if ( !iLandscape && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
610 |
aKeyEvent.iScanCode == EStdKeyUpArrow ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
611 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
612 |
// right portal -> up -> widget list bottom (portrait) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
613 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
614 |
SetFocusToWidgetList( iWidgetsList->Model()->NumberOfItems()-1 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
615 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
616 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
617 |
else if ( !iLandscape && !iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
618 |
aKeyEvent.iScanCode == EStdKeyRightArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
619 |
iConfiguration->PortalButtonCount() > 1 && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
620 |
iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
621 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
622 |
// left portal -> right -> right portal |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
623 |
// (portrait, operator button higher priority ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
624 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
625 |
SetFocusToPortalButton( 0 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
626 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
627 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
628 |
else if ( !iLandscape && !iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
629 |
aKeyEvent.iScanCode == EStdKeyLeftArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
630 |
iConfiguration->PortalButtonCount() > 1 && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
631 |
!iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
632 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
633 |
// right portal -> left -> left portal (portrait normal) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
634 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
635 |
SetFocusToPortalButton( 0 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
636 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
637 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
638 |
else if ( !iLandscape && iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
639 |
aKeyEvent.iScanCode == EStdKeyLeftArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
640 |
iConfiguration->PortalButtonCount() > 1 && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
641 |
iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
642 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
643 |
// left portal -> right -> right portal (portrait mirrored) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
644 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
645 |
SetFocusToPortalButton( 0 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
646 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
647 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
648 |
else if ( !iLandscape && iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
649 |
aKeyEvent.iScanCode == EStdKeyRightArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
650 |
iConfiguration->PortalButtonCount() > 1 && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
651 |
!iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
652 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
653 |
// left portal -> right -> right portal (portrait mirrored) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
654 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
655 |
SetFocusToPortalButton( 0 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
656 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
657 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
658 |
else if ( iLandscape && !iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
659 |
aKeyEvent.iScanCode == EStdKeyLeftArrow ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
660 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
661 |
// lower portal -> left -> widget list (landscape normal) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
662 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
663 |
SetFocusToWidgetList(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
664 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
665 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
666 |
else if ( iLandscape && iMirrored && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
667 |
aKeyEvent.iScanCode == EStdKeyRightArrow ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
668 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
669 |
// lower portal -> right -> widget list (landscape mirrored) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
670 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
671 |
SetFocusToWidgetList(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
672 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
673 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
674 |
else if ( iLandscape && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
675 |
aKeyEvent.iScanCode == EStdKeyDownArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
676 |
iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
677 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
678 |
// upper portal -> down -> lower portal |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
679 |
// ( landscape operator button higher priority ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
680 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
681 |
SetFocusToPortalButton( 0 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
682 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
683 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
684 |
else if ( iLandscape && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
685 |
aKeyEvent.iScanCode == EStdKeyUpArrow && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
686 |
!iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
687 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
688 |
// lower portal -> up -> upper portal (landscape) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
689 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
690 |
SetFocusToPortalButton( 0 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
691 |
keyResponse = EKeyWasConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
692 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
693 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
694 |
else |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
695 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
696 |
// ------------------------------------ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
697 |
// focus is NOWHERE |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
698 |
// ------------------------------------ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
699 |
if ( aKeyEvent.iScanCode == EStdKeyUpArrow || |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
700 |
aKeyEvent.iScanCode == EStdKeyDownArrow ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
701 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
702 |
// no focus -> key hit -> focus list |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
703 |
if ( aType == EEventKey ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
704 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
705 |
SetFocusToWidgetList(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
706 |
keyResponse = EKeyWasNotConsumed; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
707 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
708 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
709 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
710 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
711 |
return keyResponse; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
712 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
713 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
714 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
715 |
// --------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
716 |
// CWmMainContainer::OperatorButtonHigherPriority |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
717 |
// --------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
718 |
// |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
719 |
TInt CWmMainContainer::OperatorButtonHigherPriority( TInt aIndex ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
720 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
721 |
TInt ret = aIndex; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
722 |
if ( iConfiguration->PortalButtonsMirrored() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
723 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
724 |
if ( aIndex == 0 ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
725 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
726 |
ret = 1; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
727 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
728 |
else if ( aIndex == 1 ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
729 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
730 |
ret = 0; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
731 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
732 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
733 |
return ret; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
734 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
735 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
736 |
// --------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
737 |
// CWmMainContainer::SetFocusToPortalButton |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
738 |
// --------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
739 |
// |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
740 |
void CWmMainContainer::SetFocusToPortalButton( TInt aIndex ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
741 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
742 |
if ( aIndex != 0 && iPortalButtonTwo ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
743 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
744 |
iWidgetsList->SetFocus(EFalse); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
745 |
iPortalButtonOne->SetFocus(EFalse); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
746 |
iPortalButtonTwo->SetFocus(ETrue); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
747 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
748 |
else |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
749 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
750 |
iWidgetsList->SetFocus(EFalse); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
751 |
if ( iPortalButtonTwo ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
752 |
iPortalButtonTwo->SetFocus(EFalse); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
753 |
iPortalButtonOne->SetFocus(ETrue); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
754 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
755 |
DrawDeferred(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
756 |
UpdateFocusMode(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
757 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
758 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
759 |
// --------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
760 |
// CWmMainContainer::SetFocusToWidgetList |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
761 |
// --------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
762 |
// |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
763 |
void CWmMainContainer::SetFocusToWidgetList( TInt aIndex ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
764 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
765 |
iPortalButtonOne->SetFocus(EFalse); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
766 |
if ( iPortalButtonTwo ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
767 |
iPortalButtonTwo->SetFocus(EFalse); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
768 |
if ( aIndex >= 0 && aIndex < iWidgetsList->Model()->NumberOfItems() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
769 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
770 |
iWidgetsList->SetCurrentItemIndex( aIndex ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
771 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
772 |
iWidgetsList->SetFocus(ETrue); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
773 |
DrawDeferred(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
774 |
UpdateFocusMode(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
775 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
776 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
777 |
// --------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
778 |
// CWmMainContainer::UpdateFocusMode |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
779 |
// --------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
780 |
// |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
781 |
void CWmMainContainer::UpdateFocusMode() |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
782 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
783 |
if ( iPortalButtonOne->IsFocused() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
784 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
785 |
// PORTAL BUTTON is focused |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
786 |
iFocusMode = EPortal; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
787 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
788 |
else if ( iPortalButtonTwo && iPortalButtonTwo->IsFocused() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
789 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
790 |
// SECOND PORTAL BUTTON is focused |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
791 |
iFocusMode = EPortal; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
792 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
793 |
else if( ( iFindPaneIsVisible ) && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
794 |
( iFindbox->IsFocused() || iWidgetsList->IsFocused() ) ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
795 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
796 |
// FIND MODE |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
797 |
iFocusMode = EFind; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
798 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
799 |
else if ( iWidgetsList->IsFocused() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
800 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
801 |
// WIDGETS LIST is focused |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
802 |
iFocusMode = EList; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
803 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
804 |
else |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
805 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
806 |
// NO focus |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
807 |
iFocusMode = ENowhere; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
808 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
809 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
810 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
811 |
// --------------------------------------------------------- |
83 | 812 |
// CWmMainContainer::FindChildControlByPoint |
813 |
// --------------------------------------------------------- |
|
814 |
// |
|
815 |
CCoeControl* CWmMainContainer::FindChildControlByPoint( |
|
816 |
const TPoint& aPoint ) |
|
817 |
{ |
|
818 |
CCoeControl* theControl = NULL; |
|
819 |
CCoeControlArray::TCursor cursor = Components().Begin(); |
|
820 |
CCoeControl* c; |
|
821 |
while((c=cursor.Control<CCoeControl>()) != NULL ) |
|
822 |
{ |
|
823 |
if(c->IsVisible()) |
|
824 |
{ |
|
825 |
if ( c->Rect().Contains( aPoint ) ) theControl = c; |
|
826 |
} |
|
827 |
cursor.Next(); |
|
828 |
} |
|
829 |
return theControl; |
|
830 |
} |
|
831 |
||
832 |
// --------------------------------------------------------- |
|
833 |
// CWmMainContainer::HandlePointerEventL |
|
834 |
// --------------------------------------------------------- |
|
835 |
// |
|
836 |
void CWmMainContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) |
|
837 |
{ |
|
838 |
if ( !iClosingDown ) |
|
839 |
{ |
|
840 |
TBool eatEvent( EFalse ); |
|
841 |
TPointerEvent event( aPointerEvent ); |
|
842 |
||
843 |
if (aPointerEvent.iType == TPointerEvent::EButton1Down) |
|
844 |
{ |
|
845 |
// Check if user clicked a child control |
|
846 |
CCoeControl* control = FindChildControlByPoint( aPointerEvent.iPosition ); |
|
847 |
if ( control && !control->IsFocused() ) |
|
848 |
{ |
|
849 |
// remove focus from ALL other child controls. |
|
850 |
CCoeControlArray::TCursor cursor = Components().Begin(); |
|
851 |
CCoeControl* c; |
|
852 |
while ((c=cursor.Control<CCoeControl>()) != NULL ) |
|
853 |
{ |
|
854 |
if ( c != control && c->IsFocused() ) c->SetFocus( EFalse ); |
|
855 |
cursor.Next(); |
|
856 |
} |
|
857 |
||
858 |
// Set focus to the control that was clicked |
|
859 |
control->SetFocus( ETrue ); |
|
860 |
||
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
861 |
// update focus mode accordingly |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
862 |
UpdateFocusMode(); |
83 | 863 |
// repaint |
864 |
DrawDeferred(); |
|
865 |
} |
|
866 |
||
867 |
// stylus popup should not be opened when uninstalling. |
|
868 |
// ou1cimx1#302973 |
|
869 |
if ( control == iWidgetsList && iWidgetsList->IsFocused() ) |
|
870 |
{ |
|
871 |
TInt itemIndex = iWidgetsList->CurrentListBoxItemIndex(); |
|
872 |
TBool itemPointed = iWidgetsList->View()->XYPosToItemIndex( |
|
873 |
aPointerEvent.iPosition, |
|
874 |
itemIndex ); |
|
875 |
if ( itemIndex >= 0 && itemPointed ) |
|
876 |
{ |
|
877 |
CWmWidgetData& data = iWidgetsList->WidgetData( itemIndex ); |
|
878 |
if ( &data && data.IsUninstalling() ) |
|
879 |
{ |
|
880 |
event.iType = TPointerEvent::EButton1Up; |
|
881 |
eatEvent = ETrue; |
|
882 |
} |
|
883 |
} |
|
884 |
} |
|
885 |
||
886 |
} |
|
887 |
||
888 |
// set downkey event to base class |
|
889 |
CCoeControl::HandlePointerEventL( aPointerEvent ); |
|
890 |
||
891 |
// send key up event if selected widget is being uninstalled. |
|
892 |
// stylus popup shouldn't be displayed for this item. |
|
893 |
if ( eatEvent ) |
|
894 |
{ |
|
895 |
CCoeControl::HandlePointerEventL( event ); |
|
896 |
} |
|
897 |
} |
|
898 |
} |
|
899 |
||
900 |
// --------------------------------------------------------- |
|
901 |
// CWmMainContainer::InitializeControlsL |
|
902 |
// --------------------------------------------------------- |
|
903 |
// |
|
904 |
void CWmMainContainer::InitializeControlsL( const TRect& /*aRect*/ ) |
|
905 |
{ |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
906 |
// Create portal buttons |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
907 |
iPortalButtonOne = CWmPortalButton::NewL( this, 0 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
908 |
iPortalButtonOne->SetMopParent( this ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
909 |
AddControlL( iPortalButtonOne, EPortalOne ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
910 |
if ( iConfiguration->PortalButtonCount() > 1 ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
911 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
912 |
iPortalButtonTwo = CWmPortalButton::NewL( this, 1 ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
913 |
iPortalButtonTwo->SetMopParent( this ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
914 |
AddControlL( iPortalButtonTwo, EPortalTwo ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
915 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
916 |
|
83 | 917 |
// Create widget list box |
918 |
iWidgetsList = CWmListBox::NewL( |
|
919 |
iWmPlugin, |
|
920 |
TRect(), |
|
921 |
this ); |
|
922 |
iWidgetsList->SetMopParent( this ); |
|
923 |
AddControlL( iWidgetsList, EWidgetsList ); |
|
924 |
iWidgetsList->ActivateL(); |
|
925 |
iWidgetsList->SetListBoxObserver( this ); |
|
926 |
||
927 |
// Create scroll bar. |
|
928 |
iWidgetsList->CreateScrollBarFrameL( ETrue ); |
|
929 |
iWidgetsList->ScrollBarFrame()->SetScrollBarVisibilityL( |
|
930 |
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); |
|
931 |
iWidgetsList->UpdateScrollBarsL(); |
|
932 |
||
933 |
// search field |
|
934 |
iFindbox = CAknSearchField::NewL( *this, |
|
935 |
CAknSearchField::EAdaptiveSearch, |
|
936 |
0, KTextLimit ); |
|
937 |
AddControlL( iFindbox, EFindBox ); |
|
93
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
938 |
iFindbox->AddAdaptiveSearchTextObserverL(this); |
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
939 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
940 |
UpdateFocusMode(); |
83 | 941 |
StartLoadingWidgetsL(); |
942 |
} |
|
943 |
||
944 |
// --------------------------------------------------------- |
|
945 |
// CWmMainContainer::HandleWidgetListChanged |
|
946 |
// --------------------------------------------------------- |
|
947 |
// |
|
948 |
void CWmMainContainer::HandleWidgetListChanged() |
|
949 |
{ |
|
950 |
TRAP_IGNORE( StartLoadingWidgetsL(); ); |
|
951 |
} |
|
952 |
||
953 |
// --------------------------------------------------------- |
|
954 |
// CWmMainContainer::StartLoadingWidgetsL |
|
955 |
// --------------------------------------------------------- |
|
956 |
// |
|
957 |
void CWmMainContainer::StartLoadingWidgetsL() |
|
958 |
{ |
|
959 |
if ( !iWidgetLoader ) |
|
960 |
{ |
|
961 |
// create the widget loader AO |
|
962 |
iWidgetLoader = CWmWidgetLoaderAo::NewL( iWmPlugin, *iWidgetsList ); |
|
963 |
iWidgetLoader->SetObserver( this ); |
|
964 |
} |
|
965 |
iWidgetLoader->StartLoading(); |
|
966 |
} |
|
967 |
||
968 |
// --------------------------------------------------------- |
|
969 |
// CWmMainContainer::HandleResourceChange |
|
970 |
// --------------------------------------------------------- |
|
971 |
// |
|
972 |
void CWmMainContainer::HandleResourceChange( TInt aType ) |
|
973 |
{ |
|
974 |
CCoeControl::HandleResourceChange( aType ); |
|
975 |
||
976 |
if ( KEikDynamicLayoutVariantSwitch == aType ) |
|
977 |
{ |
|
978 |
TRect rect; |
|
979 |
AknLayoutUtils::LayoutMetricsRect( |
|
980 |
AknLayoutUtils::EMainPane, rect ); |
|
981 |
SetRect( rect ); |
|
982 |
||
983 |
// notify widgetlist |
|
984 |
iWidgetsList->HandleLayoutChanged(); |
|
985 |
} |
|
986 |
} |
|
987 |
||
988 |
||
989 |
// --------------------------------------------------------- |
|
990 |
// CWmMainContainer::MopSupplyObject |
|
991 |
// --------------------------------------------------------- |
|
992 |
// |
|
993 |
TTypeUid::Ptr CWmMainContainer::MopSupplyObject( TTypeUid aId ) |
|
994 |
{ |
|
995 |
if ( aId.iUid == MAknsControlContext::ETypeId ) |
|
996 |
{ |
|
997 |
return MAknsControlContext::SupplyMopObject( |
|
998 |
aId, iBgContext ); |
|
999 |
} |
|
1000 |
return CCoeControl::MopSupplyObject( aId ); |
|
1001 |
} |
|
1002 |
||
1003 |
// --------------------------------------------------------- |
|
1004 |
// CWmMainContainer::Draw |
|
1005 |
// --------------------------------------------------------- |
|
1006 |
// |
|
1007 |
void CWmMainContainer::Draw( const TRect& aRect ) const |
|
1008 |
{ |
|
1009 |
CWindowGc& gc = SystemGc(); |
|
1010 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
1011 |
MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); |
|
1012 |
AknsDrawUtils::Background( skin, cc, this, gc, aRect ); |
|
1013 |
} |
|
1014 |
||
1015 |
// --------------------------------------------------------- |
|
1016 |
// CWmMainContainer::AddControlL |
|
1017 |
// --------------------------------------------------------- |
|
1018 |
// |
|
1019 |
void CWmMainContainer::AddControlL( |
|
1020 |
CCoeControl* aControl, |
|
1021 |
TInt aControlId ) |
|
1022 |
{ |
|
1023 |
Components().AppendLC( aControl, aControlId ); // Ownership transfered |
|
1024 |
CleanupStack::Pop(aControl); |
|
1025 |
CAknView* view = iWmPlugin.ViewAppUi().View( |
|
1026 |
TUid::Uid(EWmMainContainerViewId) ); |
|
1027 |
if ( view ) |
|
1028 |
{ |
|
1029 |
iWmPlugin.ViewAppUi().AddToStackL( *view, aControl ); |
|
1030 |
} |
|
1031 |
else |
|
1032 |
{ |
|
1033 |
iWmPlugin.ViewAppUi().AddToStackL( aControl ); |
|
1034 |
} |
|
1035 |
aControl->MakeVisible( ETrue ); |
|
1036 |
} |
|
1037 |
||
1038 |
// --------------------------------------------------------- |
|
1039 |
// CWmMainContainer::IsLoadingWidgets |
|
1040 |
// --------------------------------------------------------- |
|
1041 |
// |
|
1042 |
TBool CWmMainContainer::IsLoadingWidgets() |
|
1043 |
{ |
|
1044 |
return ((iWidgetLoader && iWidgetLoader->IsLoading()) ? |
|
1045 |
ETrue : EFalse); |
|
1046 |
} |
|
1047 |
||
1048 |
// --------------------------------------------------------- |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1049 |
// CWmMainContainer::PortalSelected |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1050 |
// --------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1051 |
// |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1052 |
TBool CWmMainContainer::PortalSelected() |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1053 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1054 |
return ( iFocusMode == EPortal ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1055 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1056 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1057 |
// --------------------------------------------------------- |
83 | 1058 |
// CWmMainContainer::WidgetSelected |
1059 |
// --------------------------------------------------------- |
|
1060 |
// |
|
1061 |
TBool CWmMainContainer::WidgetSelected() |
|
1062 |
{ |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1063 |
return ( iFocusMode == EList ) || ( iFocusMode == EFind ); |
83 | 1064 |
} |
1065 |
||
1066 |
// --------------------------------------------------------- |
|
1067 |
// CWmMainContainer::CanDoAdd |
|
1068 |
// --------------------------------------------------------- |
|
1069 |
// |
|
1070 |
TBool CWmMainContainer::CanDoAdd() |
|
1071 |
{ |
|
1072 |
TBool retVal = EFalse; |
|
1073 |
CWmWidgetData* data = iWidgetsList->WidgetData(); |
|
1074 |
if ( WidgetSelected() && data && !data->IsUninstalling() ) |
|
1075 |
{ |
|
1076 |
if ( data->HsContentInfo().CanBeAdded() ) |
|
1077 |
retVal = ETrue; |
|
1078 |
} |
|
1079 |
return retVal; |
|
1080 |
} |
|
1081 |
||
1082 |
// --------------------------------------------------------- |
|
1083 |
// CWmMainContainer::CanDoUninstall |
|
1084 |
// --------------------------------------------------------- |
|
1085 |
// |
|
1086 |
TBool CWmMainContainer::CanDoUninstall() |
|
1087 |
{ |
|
1088 |
TBool retVal( EFalse ); |
|
1089 |
CWmWidgetData* data = iWidgetsList->WidgetData(); |
|
1090 |
if ( WidgetSelected() && data && !data->IsUninstalling() ) |
|
1091 |
{ |
|
1092 |
if ( data->WidgetType() == CWmWidgetData::ECps && |
|
1093 |
data->PublisherUid() != KNullUid && |
|
1094 |
data->WrtType() != CWmWidgetData::EUnIdentified ) |
|
1095 |
{ |
|
1096 |
retVal = ETrue; |
|
1097 |
} |
|
1098 |
} |
|
1099 |
return retVal; |
|
1100 |
} |
|
1101 |
||
1102 |
// --------------------------------------------------------- |
|
1103 |
// CWmMainContainer::CanDoLaunch |
|
1104 |
// --------------------------------------------------------- |
|
1105 |
// |
|
1106 |
TBool CWmMainContainer::CanDoLaunch() |
|
1107 |
{ |
|
1108 |
TBool retVal(EFalse); |
|
1109 |
||
1110 |
if ( WidgetSelected() ) |
|
1111 |
{ |
|
1112 |
CWmWidgetData* data = iWidgetsList->WidgetData(); |
|
1113 |
if ( data && !data->IsUninstalling() ) |
|
1114 |
{ |
|
1115 |
if ( data->WidgetType() == CWmWidgetData::ECps && |
|
1116 |
data->PublisherUid() != KNullUid ) |
|
1117 |
{ |
|
1118 |
retVal = ETrue; |
|
1119 |
} |
|
1120 |
} |
|
1121 |
} |
|
1122 |
return retVal; |
|
1123 |
} |
|
1124 |
||
1125 |
// --------------------------------------------------------- |
|
1126 |
// CWmMainContainer::CanDoFind |
|
1127 |
// --------------------------------------------------------- |
|
1128 |
// |
|
1129 |
TBool CWmMainContainer::CanDoFind() |
|
1130 |
{ |
|
1131 |
return !iFindPaneIsVisible; |
|
1132 |
} |
|
1133 |
||
1134 |
// --------------------------------------------------------- |
|
1135 |
// CWmMainContainer::CanDoSort |
|
1136 |
// --------------------------------------------------------- |
|
1137 |
// |
|
1138 |
TBool CWmMainContainer::CanDoSort() |
|
1139 |
{ |
|
1140 |
return !iFindPaneIsVisible; |
|
1141 |
} |
|
1142 |
||
1143 |
// --------------------------------------------------------- |
|
1144 |
// CWmMainContainer::CanDoDetails |
|
1145 |
// --------------------------------------------------------- |
|
1146 |
// |
|
1147 |
TBool CWmMainContainer::CanDoDetails() |
|
1148 |
{ |
|
1149 |
return ( WidgetSelected() && iWidgetsList->WidgetData() |
|
1150 |
&& !iWidgetsList->WidgetData()->IsUninstalling() ); |
|
1151 |
} |
|
1152 |
||
1153 |
// --------------------------------------------------------- |
|
1154 |
// CWmMainContainer::CanDoHelp |
|
1155 |
// --------------------------------------------------------- |
|
1156 |
// |
|
1157 |
TBool CWmMainContainer::CanDoHelp() |
|
1158 |
{ |
|
1159 |
return FeatureManager::FeatureSupported( KFeatureIdHelp ); |
|
1160 |
} |
|
1161 |
||
1162 |
// --------------------------------------------------------------------------- |
|
1163 |
// CWmMainContainer::AddWidgetToHomeScreenL |
|
1164 |
// --------------------------------------------------------------------------- |
|
1165 |
// |
|
1166 |
void CWmMainContainer::AddWidgetToHomeScreenL() |
|
1167 |
{ |
|
1168 |
CWmWidgetData* data = iWidgetsList->WidgetData(); |
|
1169 |
if ( !iClosingDown ) |
|
1170 |
{ |
|
1171 |
if ( iFindbox && iFindPaneIsVisible ) |
|
1172 |
{ |
|
1173 |
DeactivateFindPaneL(EFalse); |
|
1174 |
} |
|
1175 |
||
1176 |
if ( data && !data->IsUninstalling() ) |
|
1177 |
{ |
|
1178 |
// set add to homescreen to be executed later |
|
1179 |
iWmPlugin.SetPostponedCommandL( |
|
1180 |
CWmPlugin::EAddToHomescreen, |
|
1181 |
data->HsContentInfo() ); |
|
1182 |
||
1183 |
iWmPlugin.CloseView(); |
|
1184 |
} |
|
1185 |
} |
|
1186 |
} |
|
1187 |
||
1188 |
// --------------------------------------------------------------------------- |
|
1189 |
// CWmMainContainer::LaunchWidgetL |
|
1190 |
// --------------------------------------------------------------------------- |
|
1191 |
// |
|
1192 |
void CWmMainContainer::LaunchWidgetL() |
|
1193 |
{ |
|
1194 |
if ( CanDoLaunch() ) |
|
1195 |
{ |
|
1196 |
CWmWidgetData* data = iWidgetsList->WidgetData(); |
|
1197 |
||
1198 |
HBufC* param = KNullDesC().AllocLC(); // launch params |
|
1199 |
||
1200 |
RApaLsSession appArc; |
|
1201 |
User::LeaveIfError( appArc.Connect() ); // connect to AppArc server |
|
1202 |
CleanupClosePushL( appArc ); |
|
1203 |
TThreadId id; |
|
1204 |
User::LeaveIfError( appArc.StartDocument( |
|
1205 |
*param, data->PublisherUid(), id ) ); |
|
1206 |
||
1207 |
CleanupStack::PopAndDestroy( &appArc ); |
|
1208 |
CleanupStack::PopAndDestroy( param ); |
|
1209 |
} |
|
1210 |
} |
|
1211 |
||
1212 |
// --------------------------------------------------------------------------- |
|
1213 |
// CWmMainContainer::ActivateFindPaneL |
|
1214 |
// --------------------------------------------------------------------------- |
|
1215 |
// |
|
1216 |
void CWmMainContainer::ActivateFindPaneL( TBool aActivateAdaptive ) |
|
1217 |
{ |
|
1218 |
if ( iFindbox && !iFindPaneIsVisible && |
|
1219 |
iWidgetsList->Model()->NumberOfItems() > KMinWidgets ) |
|
1220 |
{ |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1221 |
// set focus |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1222 |
if ( iWidgetsList->ItemDrawer()->Flags() |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1223 |
& CListItemDrawer::ESingleClickDisabledHighlight ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1224 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1225 |
ResetFocus(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1226 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1227 |
else |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1228 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1229 |
iWidgetsList->SetFocus( ETrue, EDrawNow ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1230 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1231 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1232 |
|
83 | 1233 |
// set column filter flag |
1234 |
TBitFlags32 bitFlag; |
|
1235 |
bitFlag.ClearAll(); // clear all columns |
|
1236 |
bitFlag.Assign( 1,1 ); // turn on column at index one |
|
1237 |
iFindbox->SetListColumnFilterFlags( bitFlag ); |
|
1238 |
||
1239 |
// enable filtering |
|
1240 |
CAknFilteredTextListBoxModel* m = |
|
1241 |
static_cast <CAknFilteredTextListBoxModel*> ( iWidgetsList->Model() ); |
|
1242 |
if ( m ) |
|
1243 |
{ |
|
1244 |
m->CreateFilterL( iWidgetsList, iFindbox ); |
|
1245 |
if ( m->Filter() ) |
|
1246 |
{ |
|
1247 |
m->Filter()->SetParentControl( this ); |
|
1248 |
} |
|
1249 |
} |
|
1250 |
||
1251 |
iFindbox->ActivateL(); |
|
1252 |
iFindbox->ResetL(); |
|
1253 |
iFindbox->SetSearchTextL( KNullDesC ); |
|
1254 |
iFindbox->SetSkinEnabledL( ETrue ); |
|
1255 |
iFindPaneIsVisible = ETrue; |
|
1256 |
iFindbox->MakeVisible( ETrue ); |
|
1257 |
||
1258 |
// layout listbox and findbox |
|
1259 |
LayoutControls(); |
|
1260 |
||
1261 |
if ( aActivateAdaptive ) |
|
1262 |
{ |
|
1263 |
iFindbox->ShowAdaptiveSearchGrid(); |
|
1264 |
} |
|
1265 |
iFindbox->SetFocus( ETrue ); |
|
1266 |
iWidgetsList->SetFindPaneIsVisible( ETrue ); |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1267 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1268 |
// set soft key set |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1269 |
CEikButtonGroupContainer* cbaGroup = |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1270 |
CEikButtonGroupContainer::Current(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1271 |
cbaGroup->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_CANCEL__SELECT ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1272 |
cbaGroup->DrawNow(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1273 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1274 |
UpdateFocusMode(); |
83 | 1275 |
} |
1276 |
} |
|
1277 |
||
1278 |
// --------------------------------------------------------------------------- |
|
1279 |
// CWmMainContainer::DeactivateFindPaneL |
|
1280 |
// --------------------------------------------------------------------------- |
|
1281 |
// |
|
1282 |
void CWmMainContainer::DeactivateFindPaneL(TBool aLayout) |
|
1283 |
{ |
|
1284 |
if( iFindbox && iFindPaneIsVisible ) |
|
1285 |
{ |
|
1286 |
// notify search field we're shutting down |
|
1287 |
TKeyEvent keyEvent = { EKeyNo, EStdKeyNo, 0, 0 }; |
|
1288 |
iFindbox->OfferKeyEventL( keyEvent, EEventKey ); |
|
1289 |
||
1290 |
// reset findbox |
|
1291 |
iFindbox->ResetL(); |
|
1292 |
||
1293 |
// reset filter |
|
1294 |
CAknFilteredTextListBoxModel* m = |
|
1295 |
static_cast <CAknFilteredTextListBoxModel*> ( iWidgetsList->Model() ); |
|
1296 |
if ( m && m->Filter() ) |
|
1297 |
{ |
|
1298 |
m->Filter()->ResetFilteringL(); |
|
1299 |
m->RemoveFilter(); |
|
1300 |
} |
|
1301 |
||
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1302 |
//set focus |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1303 |
if ( iWidgetsList->ItemDrawer()->Flags() |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1304 |
& CListItemDrawer::ESingleClickDisabledHighlight ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1305 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1306 |
ResetFocus(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1307 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1308 |
else |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1309 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1310 |
iWidgetsList->SetFocus( ETrue, EDrawNow ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1311 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1312 |
|
83 | 1313 |
iFindbox->MakeVisible( EFalse ); |
1314 |
iFindPaneIsVisible = EFalse; |
|
1315 |
iWidgetsList->SetFindPaneIsVisible( EFalse ); |
|
1316 |
||
1317 |
||
1318 |
// set soft key set |
|
1319 |
CEikButtonGroupContainer* cbaGroup = |
|
1320 |
CEikButtonGroupContainer::Current(); |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1321 |
TInt cbaResourceId = ( AknLayoutUtils::MSKEnabled() ? |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1322 |
R_AVKON_SOFTKEYS_OPTIONS_BACK__SELECT : |
83 | 1323 |
R_AVKON_SOFTKEYS_OPTIONS_BACK ); |
1324 |
cbaGroup->SetCommandSetL( cbaResourceId ); |
|
1325 |
||
1326 |
if (aLayout) //no need to draw UI if exiting list |
|
1327 |
{ |
|
1328 |
LayoutControls(); |
|
1329 |
cbaGroup->DrawNow(); |
|
1330 |
||
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1331 |
UpdateFocusMode(); |
83 | 1332 |
DrawNow(); |
1333 |
} |
|
1334 |
} |
|
1335 |
} |
|
1336 |
||
1337 |
// --------------------------------------------------------------------------- |
|
1338 |
// CWmMainContainer::SortListAlphabeticallyL |
|
1339 |
// --------------------------------------------------------------------------- |
|
1340 |
// |
|
1341 |
void CWmMainContainer::SortListAlphabeticallyL() |
|
1342 |
{ |
|
1343 |
if ( iWidgetsList ) |
|
1344 |
{ |
|
1345 |
iWidgetsList->DoSortToVisibleArray( CWmListBox::EAlphabetical ); |
|
1346 |
iWidgetsList->DoSortToOrderData( CWmListBox::EAlphabetical ); |
|
1347 |
||
1348 |
//store changed list order |
|
1349 |
CWmPersistentWidgetOrder* widgetOrder = |
|
1350 |
CWmPersistentWidgetOrder::NewL( iWmPlugin.FileServer() ); |
|
1351 |
CleanupStack::PushL( widgetOrder ); |
|
1352 |
widgetOrder->StoreL( iWidgetsList->OrderDataArray() ); |
|
1353 |
||
1354 |
CleanupStack::PopAndDestroy( widgetOrder ); |
|
1355 |
} |
|
1356 |
} |
|
1357 |
||
1358 |
// --------------------------------------------------------------------------- |
|
1359 |
// CWmMainContainer::UninstallWidgetL |
|
1360 |
// --------------------------------------------------------------------------- |
|
1361 |
// |
|
1362 |
void CWmMainContainer::UninstallWidgetL() |
|
1363 |
{ |
|
1364 |
if ( CanDoUninstall() ) |
|
1365 |
{ |
|
1366 |
CWmWidgetData* data = iWidgetsList->WidgetData(); |
|
1367 |
if ( data ) |
|
1368 |
{ |
|
1369 |
if ( iWmPlugin.ResourceLoader().QueryPopupL( |
|
1370 |
R_QTN_WM_UNINSTALL_WIDGET_QUERY, data->Name() ) ) |
|
1371 |
{ |
|
1372 |
||
1373 |
TRAPD( err, iWmPlugin.WmInstaller().UninstallL( data ) ); |
|
1374 |
if ( err != KErrNone ) |
|
1375 |
{ |
|
1376 |
iWmPlugin.ResourceLoader().InfoPopupL( |
|
1377 |
R_QTN_WM_UNINST_PROCESS_BUSY, KNullDesC ); |
|
1378 |
} |
|
1379 |
} |
|
1380 |
} |
|
1381 |
} |
|
1382 |
} |
|
1383 |
||
1384 |
// --------------------------------------------------------------------------- |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1385 |
// CWmMainContainer::OpenPortalL |
83 | 1386 |
// --------------------------------------------------------------------------- |
1387 |
// |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1388 |
void CWmMainContainer::OpenPortalL() |
83 | 1389 |
{ |
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1390 |
if ( !iClosingDown ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1391 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1392 |
// execute whichever of the portal buttons happens to be active |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1393 |
if ( iPortalButtonOne->IsFocused() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1394 |
iPortalButtonOne->ExecuteL(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1395 |
else if ( iPortalButtonTwo && iPortalButtonTwo->IsFocused() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1396 |
iPortalButtonTwo->ExecuteL(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1397 |
else if ( !iPortalButtonTwo ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1398 |
iPortalButtonOne->ExecuteL(); |
83 | 1399 |
} |
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1400 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1401 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1402 |
// --------------------------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1403 |
// CWmMainContainer::SelectL |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1404 |
// --------------------------------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1405 |
// |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1406 |
void CWmMainContainer::SelectL() |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1407 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1408 |
if ( WidgetSelected() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1409 |
AddWidgetToHomeScreenL(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1410 |
else if ( PortalSelected() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1411 |
OpenPortalL(); |
83 | 1412 |
else |
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1413 |
SetFocusToWidgetList(); |
83 | 1414 |
} |
1415 |
||
1416 |
// --------------------------------------------------------------------------- |
|
1417 |
// CWmMainContainer::ShowHelpL |
|
1418 |
// --------------------------------------------------------------------------- |
|
1419 |
// |
|
1420 |
void CWmMainContainer::ShowHelpL() |
|
1421 |
{ |
|
1422 |
TUid fwUid = TUid::Uid( AI_UID3_AIFW_COMMON ); |
|
1423 |
// retrieve resolve host application help context |
|
1424 |
CArrayFix<TCoeHelpContext>* helpContext = |
|
1425 |
iEikonEnv->EikAppUi()->AppHelpContextL(); |
|
1426 |
||
1427 |
// add the widget manager entry into the help context |
|
1428 |
CleanupStack::PushL( helpContext ); |
|
1429 |
helpContext->InsertL( 0, TCoeHelpContext( |
|
1430 |
fwUid, KWM_HLP_WIDGET_COLLECTION ) ); |
|
1431 |
CleanupStack::Pop( helpContext ); |
|
1432 |
||
1433 |
// launch help |
|
1434 |
HlpLauncher::LaunchHelpApplicationL( |
|
1435 |
iEikonEnv->WsSession(), |
|
1436 |
helpContext ); |
|
1437 |
helpContext = 0; // HlpLauncher takes ownership of helpContext |
|
1438 |
} |
|
1439 |
||
1440 |
// --------------------------------------------------------------------------- |
|
1441 |
// CWmMainContainer::RemoveCtrlsFromStack |
|
1442 |
// --------------------------------------------------------------------------- |
|
1443 |
// |
|
1444 |
void CWmMainContainer::RemoveCtrlsFromStack() |
|
1445 |
{ |
|
1446 |
for ( TInt i=0; i < CountComponentControls(); i++ ) |
|
1447 |
{ |
|
1448 |
CCoeControl* ctl = ComponentControl( i ) ; |
|
1449 |
if ( ctl ) |
|
1450 |
{ |
|
1451 |
iWmPlugin.ViewAppUi().RemoveFromStack( ctl ); |
|
1452 |
} |
|
1453 |
} |
|
1454 |
} |
|
1455 |
||
1456 |
// --------------------------------------------------------------------------- |
|
1457 |
// CWmMainContainer::HandleListBoxEventL |
|
1458 |
// --------------------------------------------------------------------------- |
|
1459 |
// |
|
1460 |
void CWmMainContainer::HandleListBoxEventL( |
|
1461 |
CEikListBox* /*aListBox*/, TListBoxEvent aEventType ) |
|
1462 |
{ |
|
1463 |
if ( ( aEventType == EEventEnterKeyPressed || |
|
1464 |
aEventType == EEventItemSingleClicked ) |
|
1465 |
&& !iClosingDown ) |
|
1466 |
{ |
|
1467 |
AddWidgetToHomeScreenL(); |
|
1468 |
} |
|
1469 |
} |
|
1470 |
||
1471 |
// ---------------------------------------------------- |
|
1472 |
// CWmMainContainer::LaunchDetailsDialogL |
|
1473 |
// ---------------------------------------------------- |
|
1474 |
// |
|
1475 |
void CWmMainContainer::LaunchDetailsDialogL() |
|
1476 |
{ |
|
1477 |
CWmWidgetData* data = iWidgetsList->WidgetData(); |
|
1478 |
if ( data ) |
|
1479 |
{ |
|
1480 |
// Find out if HS is full |
|
1481 |
TBool hsFull = ETrue; |
|
1482 |
MHsContentController& controller = iWmPlugin.ContentController(); |
|
1483 |
CHsContentInfo* activeView = CHsContentInfo::NewLC(); |
|
1484 |
if ( controller.ActiveViewL( *activeView ) == KErrNone ) |
|
1485 |
{ |
|
1486 |
hsFull = activeView->IsFull(); |
|
1487 |
} |
|
1488 |
CleanupStack::PopAndDestroy( activeView ); |
|
1489 |
||
1490 |
CWmDetailsDlg* dlg = CWmDetailsDlg::NewL( |
|
1491 |
data->Name(), |
|
1492 |
data->Description(), |
|
1493 |
!hsFull, |
|
1494 |
data->HsContentInfo().IconPath(), |
|
1495 |
*iWidgetsList->DefaultLogo(), |
|
1496 |
*iWidgetsList->DefaultMask() |
|
1497 |
); |
|
1498 |
||
1499 |
if ( dlg && dlg->ExecuteLD() == ECbaAddToHs ) |
|
1500 |
{ |
|
1501 |
AddWidgetToHomeScreenL(); |
|
1502 |
} |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1503 |
else |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1504 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1505 |
if ( iWidgetsList->ItemDrawer()->Flags() |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1506 |
& CListItemDrawer::ESingleClickDisabledHighlight ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1507 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1508 |
ResetFocus(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1509 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1510 |
else |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1511 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1512 |
iWidgetsList->SetFocus( ETrue, EDrawNow ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1513 |
UpdateFocusMode(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1514 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1515 |
} |
83 | 1516 |
} |
1517 |
} |
|
1518 |
||
1519 |
// ---------------------------------------------------- |
|
1520 |
// CWmMainContainer::SetClosingDown |
|
1521 |
// ---------------------------------------------------- |
|
1522 |
// |
|
1523 |
void CWmMainContainer::SetClosingDown( TBool aClosingDown ) |
|
1524 |
{ |
|
1525 |
iClosingDown = aClosingDown; |
|
1526 |
} |
|
1527 |
||
1528 |
// ---------------------------------------------------- |
|
1529 |
// CWmMainContainer::ClosingDown |
|
1530 |
// ---------------------------------------------------- |
|
1531 |
// |
|
1532 |
TBool CWmMainContainer::ClosingDown() |
|
1533 |
{ |
|
1534 |
return iClosingDown; |
|
1535 |
} |
|
1536 |
||
1537 |
// ---------------------------------------------------- |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1538 |
// CWmMainContainer::Configuration |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1539 |
// ---------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1540 |
// |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1541 |
CWmConfiguration& CWmMainContainer::Configuration() |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1542 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1543 |
return *iConfiguration; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1544 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1545 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1546 |
// ---------------------------------------------------- |
83 | 1547 |
// CWmMainContainer::HandleFindSizeChanged |
1548 |
// ---------------------------------------------------- |
|
1549 |
// |
|
1550 |
void CWmMainContainer::HandleFindSizeChanged() |
|
1551 |
{ |
|
1552 |
TAknWindowLineLayout findPane = |
|
1553 |
AknLayoutScalable_Avkon::find_pane().LayoutLine(); |
|
1554 |
||
1555 |
TAknWindowLineLayout listPane; |
|
1556 |
||
1557 |
TRect listRect = iWidgetsList->Rect(); |
|
1558 |
listPane.il = listRect.iTl.iX; |
|
1559 |
listPane.it = listRect.iTl.iY; |
|
1560 |
listPane.ib = 0; |
|
1561 |
listPane.iH = TUint16( listRect.Height() - ( findPane.iH - 1 ) ); |
|
1562 |
listPane.iW = listRect.Width(); |
|
1563 |
listPane.ir = ELayoutEmpty; |
|
1564 |
||
1565 |
// set findpane width equal to listwidth |
|
1566 |
findPane.iW = listPane.iW; |
|
1567 |
||
1568 |
TRect rect = Rect(); |
|
1569 |
AknLayoutUtils::LayoutControl( iFindbox, rect, findPane ); |
|
1570 |
AknLayoutUtils::LayoutControl( iWidgetsList, rect, listPane ); |
|
1571 |
||
1572 |
iWidgetsList->DrawNow(); |
|
1573 |
} |
|
1574 |
||
1575 |
// ---------------------------------------------------- |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1576 |
// CWmMainContainer::ProcessForegroundEvent |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1577 |
// ---------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1578 |
// |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1579 |
void CWmMainContainer::ProcessForegroundEvent( TBool aForeground ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1580 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1581 |
if ( iFindbox && iFindPaneIsVisible && |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1582 |
iFindbox->IsFocused() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1583 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1584 |
// keep focus & do nothing |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1585 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1586 |
else if ( aForeground ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1587 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1588 |
// set init state when wm comes to foreground. |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1589 |
// remove focus from all controls when activating view. |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1590 |
ResetFocus( EDrawNow ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1591 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1592 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1593 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1594 |
// ---------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1595 |
// CWmMainContainer::ResetFocus |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1596 |
// ---------------------------------------------------- |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1597 |
// |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1598 |
void CWmMainContainer::ResetFocus( TDrawNow aDrawNow ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1599 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1600 |
CCoeControl* control = NULL; |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1601 |
CCoeControlArray::TCursor cursor = Components().Begin(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1602 |
while( ( control = cursor.Control<CCoeControl>() ) != NULL ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1603 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1604 |
if( control->IsVisible() && control->IsFocused() ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1605 |
{ |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1606 |
control->SetFocus( EFalse, aDrawNow ); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1607 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1608 |
cursor.Next(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1609 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1610 |
UpdateFocusMode(); |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1611 |
} |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1612 |
|
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1613 |
// ---------------------------------------------------- |
83 | 1614 |
// CWmMainContainer::WmListBox |
1615 |
// ---------------------------------------------------- |
|
1616 |
// |
|
1617 |
CWmListBox& CWmMainContainer::WmListBox() |
|
1618 |
{ |
|
1619 |
return *iWidgetsList; |
|
1620 |
} |
|
1621 |
||
1622 |
// ---------------------------------------------------- |
|
1623 |
// CWmMainContainer::FocusChanged |
|
1624 |
// ---------------------------------------------------- |
|
1625 |
// |
|
1626 |
void CWmMainContainer::FocusChanged( TDrawNow aDrawNow ) |
|
1627 |
{ |
|
1628 |
CCoeControl::FocusChanged( aDrawNow ); |
|
1629 |
||
1630 |
if ( iFindbox && iFindPaneIsVisible && |
|
1631 |
!iFindbox->IsFocused() && IsFocused() ) |
|
1632 |
{ |
|
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1633 |
// reset focus to find pane if its lost ( ou1cimx1#308019 ) |
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1634 |
ResetFocus(); |
83 | 1635 |
iFindbox->SetFocus( ETrue ); |
102
ba63c83f4716
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
93
diff
changeset
|
1636 |
UpdateFocusMode(); |
83 | 1637 |
} |
1638 |
} |
|
1639 |
||
1640 |
// ---------------------------------------------------- |
|
1641 |
// CWmMainContainer::AdaptiveSearchTextChanged |
|
1642 |
// ---------------------------------------------------- |
|
1643 |
// |
|
1644 |
void CWmMainContainer::AdaptiveSearchTextChanged( CAknSearchField* /*aSearchField*/ ) |
|
1645 |
{ |
|
1646 |
// fix for ou1cimx1#376818. aknfind will call drawDeferred for lisbox. |
|
1647 |
// We need to be sure that button area is also drawn. |
|
1648 |
DrawDeferred(); |
|
1649 |
} |
|
1650 |
||
1651 |
||
1652 |
// ---------------------------------------------------- |
|
1653 |
// CWmMainContainer::LoadDone |
|
1654 |
// ---------------------------------------------------- |
|
1655 |
// |
|
1656 |
void CWmMainContainer::LoadDoneL( TBool aWidgetListChanged ) |
|
1657 |
{ |
|
1658 |
if ( aWidgetListChanged && iFindbox && iFindPaneIsVisible ) |
|
1659 |
{ |
|
1660 |
CAknFilteredTextListBoxModel* m = |
|
1661 |
static_cast <CAknFilteredTextListBoxModel*> ( iWidgetsList->Model() ); |
|
1662 |
if ( m && m->Filter() ) |
|
1663 |
{ |
|
1664 |
m->Filter()->HandleItemArrayChangeL(); |
|
1665 |
} |
|
1666 |
} |
|
1667 |
} |
|
1668 |
||
1669 |
// End of File |
|
1670 |