34
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2007 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: App ui
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// System includes
|
|
19 |
#include <centralrepository.h>
|
|
20 |
#include <avkon.rsg>
|
|
21 |
#include <e32property.h>
|
|
22 |
#include <activeidle2domainpskeys.h>
|
|
23 |
#include <AknDlgShut.h>
|
|
24 |
#include <aknview.h>
|
|
25 |
#include <apacmdln.h>
|
|
26 |
#include <LogsUiCmdStarter.h>
|
|
27 |
#include <aknconsts.h>
|
|
28 |
#include <akntitle.h>
|
|
29 |
#include <StringLoader.h>
|
|
30 |
#include <csxhelp/hmsc.hlp.hrh>
|
|
31 |
|
|
32 |
// User includes
|
|
33 |
#include <hspublisherinfo.h>
|
|
34 |
#include <aifwdefs.h>
|
|
35 |
#include <activeidle2domaincrkeys.h>
|
|
36 |
#include <aifweventhandler.h>
|
|
37 |
#include <aifwstatehandler.h>
|
|
38 |
#include <ai3xmlui.rsg>
|
|
39 |
|
|
40 |
#include "appui.h"
|
|
41 |
#include "application.h"
|
|
42 |
#include "xmluicontroller.h"
|
|
43 |
#include "aixuikoneventhandler.h"
|
|
44 |
#include "aixmluiconstants.h"
|
|
45 |
#include "contentrenderer.h"
|
|
46 |
|
|
47 |
#include "aicontentmodel.h"
|
|
48 |
#include "aiuiidleintegration.h"
|
|
49 |
#include "xmluicontrollerpanic.h"
|
|
50 |
|
|
51 |
#include "xndomnode.h"
|
|
52 |
#include "xnproperty.h"
|
|
53 |
#include "xnuiengineappif.h"
|
|
54 |
#include "onlineofflinehelper.h"
|
|
55 |
#include "ainativeuiplugins.h"
|
|
56 |
|
|
57 |
#include "debug.h"
|
|
58 |
|
|
59 |
// Constants
|
|
60 |
// EAiDeviceStatusContentNetworkIdentity content id
|
|
61 |
_LIT( KNetworkIdentity, "NetworkIdentity" );
|
|
62 |
const TUid KVoiceUiUID = { 0x101F8543 };
|
|
63 |
|
|
64 |
using namespace AiXmlUiController;
|
|
65 |
|
|
66 |
// ======== MEMBER FUNCTIONS ========
|
|
67 |
|
|
68 |
// ----------------------------------------------------------------------------
|
|
69 |
// CAppUi::CAppUi
|
|
70 |
// ----------------------------------------------------------------------------
|
|
71 |
//
|
|
72 |
CAppUi::CAppUi( CXmlUiController& aUiCtl, TUid aAppUid )
|
|
73 |
: CXnAppUiAdapter( aAppUid ), iUiCtl( aUiCtl )
|
|
74 |
{
|
|
75 |
}
|
|
76 |
|
|
77 |
// ----------------------------------------------------------------------------
|
|
78 |
// CAppUi::ConstructL()
|
|
79 |
// ----------------------------------------------------------------------------
|
|
80 |
//
|
|
81 |
void CAppUi::ConstructL()
|
|
82 |
{
|
|
83 |
__TICK( "CAppUi::ConstructL" );
|
|
84 |
|
|
85 |
iUiCtl.SetAppUi( *this );
|
|
86 |
|
|
87 |
iCoeEnv->DisableExitChecks( ETrue );
|
|
88 |
|
|
89 |
TRAPD( err, DoConstructL() );
|
|
90 |
|
|
91 |
if ( err )
|
|
92 |
{
|
|
93 |
__TICK( "CAppUi::ConstructL - failed" );
|
|
94 |
|
|
95 |
// HandleUiShutdown must be called here
|
|
96 |
// to free all control environment dependent framework objects
|
|
97 |
iUiCtl.FwEventHandler()->HandleUiShutdown( iUiCtl );
|
|
98 |
}
|
|
99 |
|
|
100 |
User::LeaveIfError( err );
|
|
101 |
|
|
102 |
__TICK( "CAppUi::ConstructL - done" );
|
|
103 |
}
|
|
104 |
|
|
105 |
// ----------------------------------------------------------------------------
|
|
106 |
// CAppUi::DoConstructL()
|
|
107 |
// ----------------------------------------------------------------------------
|
|
108 |
//
|
|
109 |
void CAppUi::DoConstructL()
|
|
110 |
{
|
|
111 |
iUiCtl.NotifyAppEnvReadyL();
|
|
112 |
|
|
113 |
// Always reset the phoneforward P&S key on startup just in case
|
|
114 |
RProperty::Set( KPSUidAiInformation,
|
|
115 |
KActiveIdleForwardNumericKeysToPhone, EPSAiForwardNumericKeysToPhone );
|
|
116 |
|
|
117 |
// Initialize with empty title pane so it's not shown on startup.
|
|
118 |
__HEAP("XML UI: Init - Construct App UI")
|
|
119 |
|
|
120 |
__TIME("XML UI: CXnAppUiAdapter::ConstructL",
|
|
121 |
CXnAppUiAdapter::ConstructL() );
|
|
122 |
|
|
123 |
CAknAppUiBase::SetKeyEventFlags( CAknAppUiBase::EDisableSendKeyShort |
|
|
124 |
CAknAppUiBase::EDisableSendKeyLong );
|
|
125 |
|
|
126 |
iEditModeTitle = StringLoader::LoadL( R_QTN_HS_TITLE_EDITMODE );
|
|
127 |
|
|
128 |
// Register for XML UI view activation & deactivation
|
|
129 |
AddViewActivationObserverL( this );
|
|
130 |
|
|
131 |
__TIME("XML UI: Construct Content Renderer",
|
|
132 |
iContentRenderer = CContentRenderer::NewL( *this );
|
|
133 |
)
|
|
134 |
__HEAP("XML UI: Construct Content Renderer");
|
|
135 |
|
|
136 |
TXnUiEngineAppIf* uiEngine( UiEngineL() );
|
|
137 |
__ASSERT_ALWAYS( uiEngine, Panic(ECriticalPointerNull) );
|
|
138 |
|
|
139 |
iUiCtl.SetObserver( *iContentRenderer );
|
|
140 |
|
|
141 |
iContentRenderer->SetEventHandler( *iUiCtl.FwEventHandler() );
|
|
142 |
|
|
143 |
iEventHandler = iUiCtl.CreateXuikonEventHandlerL( *iContentRenderer );
|
|
144 |
|
|
145 |
TAiIdleKeySoundConfig keySoundConfig;
|
|
146 |
keySoundConfig.iKeySounds = KeySounds();
|
|
147 |
keySoundConfig.iContextResId = R_XUI_DEFAULT_SKEY_LIST;
|
|
148 |
|
|
149 |
iHelper = COnlineOfflineHelper::NewL( iUiCtl );
|
|
150 |
|
|
151 |
iIdleIntegration = CAiUiIdleIntegration::NewL
|
|
152 |
( *iEikonEnv, keySoundConfig, iUiCtl.FwEventHandler() );
|
|
153 |
|
|
154 |
__TICK( "CAppUi::ConstructL - done" );
|
|
155 |
}
|
|
156 |
|
|
157 |
// ----------------------------------------------------------------------------
|
|
158 |
// CAppUi::NewL()
|
|
159 |
// ----------------------------------------------------------------------------
|
|
160 |
//
|
|
161 |
CAppUi* CAppUi::NewL( CXmlUiController& aUiCtl )
|
|
162 |
{
|
|
163 |
CAppUi* self = new ( ELeave ) CAppUi( aUiCtl, KUidXmlUiApp );
|
|
164 |
|
|
165 |
// ConstructL is called by the UI framework
|
|
166 |
|
|
167 |
return self;
|
|
168 |
}
|
|
169 |
|
|
170 |
// ----------------------------------------------------------------------------
|
|
171 |
// CAppUi::~CAppUi()
|
|
172 |
// ----------------------------------------------------------------------------
|
|
173 |
//
|
|
174 |
CAppUi::~CAppUi()
|
|
175 |
{
|
|
176 |
delete iEditModeTitle;
|
|
177 |
delete iKeyTimer;
|
|
178 |
delete iHelper;
|
|
179 |
delete iEventHandler;
|
|
180 |
delete iContentRenderer;
|
|
181 |
delete iIdleIntegration;
|
|
182 |
}
|
|
183 |
|
|
184 |
// ----------------------------------------------------------------------------
|
|
185 |
// CAppUi::ActivateUi()
|
|
186 |
// ----------------------------------------------------------------------------
|
|
187 |
//
|
|
188 |
void CAppUi::ActivateUi()
|
|
189 |
{
|
|
190 |
__PRINTS( "*** CAppUi::ActivateUi - done" );
|
|
191 |
}
|
|
192 |
|
|
193 |
// ----------------------------------------------------------------------------
|
|
194 |
// CAppUi::HandleUiReadyEventL()
|
|
195 |
// ----------------------------------------------------------------------------
|
|
196 |
//
|
|
197 |
void CAppUi::HandleUiReadyEventL()
|
|
198 |
{
|
|
199 |
__PRINTS( "*** CAppUi::HandleUiReadyEventL" );
|
|
200 |
|
|
201 |
iUiCtl.FwEventHandler()->HandleUiReadyEventL( iUiCtl );
|
|
202 |
|
|
203 |
__PRINTS( "*** CAppUi::HandleUiReadyEventL - done" );
|
|
204 |
}
|
|
205 |
|
|
206 |
// ----------------------------------------------------------------------------
|
|
207 |
// CAppUi::PublisherInfo()
|
|
208 |
// ----------------------------------------------------------------------------
|
|
209 |
//
|
|
210 |
TInt CAppUi::PublisherInfo( CXnNodeAppIf& aNode, THsPublisherInfo& aInfo )
|
|
211 |
{
|
|
212 |
TRAPD( err, iUiCtl.PublisherInfoL( aNode, aInfo ) );
|
|
213 |
|
|
214 |
return err;
|
|
215 |
}
|
|
216 |
|
|
217 |
// ----------------------------------------------------------------------------
|
|
218 |
// CAppUi::PrepareToExit()
|
|
219 |
// ----------------------------------------------------------------------------
|
|
220 |
//
|
|
221 |
void CAppUi::PrepareToExit()
|
|
222 |
{
|
|
223 |
RemoveViewActivationObserver( this );
|
|
224 |
|
|
225 |
iUiCtl.FwEventHandler()->HandleUiShutdown( iUiCtl );
|
|
226 |
|
|
227 |
CXnAppUiAdapter::PrepareToExit();
|
|
228 |
}
|
|
229 |
|
|
230 |
// ----------------------------------------------------------------------------
|
|
231 |
// CAppUi::HandleCommandL()
|
|
232 |
// ----------------------------------------------------------------------------
|
|
233 |
//
|
|
234 |
void CAppUi::HandleCommandL(TInt aCommand)
|
|
235 |
{
|
|
236 |
switch( aCommand )
|
|
237 |
{
|
|
238 |
case EEikCmdExit:
|
|
239 |
{
|
|
240 |
Exit();
|
|
241 |
break;
|
|
242 |
}
|
|
243 |
case EAknSoftkeyExit:
|
|
244 |
case EAknCmdExit:
|
|
245 |
{
|
|
246 |
#ifdef _DEBUG
|
|
247 |
|
|
248 |
Exit();
|
|
249 |
break;
|
|
250 |
#endif // _DEBUG
|
|
251 |
}
|
|
252 |
default:
|
|
253 |
{
|
|
254 |
break;
|
|
255 |
}
|
|
256 |
}
|
|
257 |
}
|
|
258 |
|
|
259 |
// ----------------------------------------------------------------------------
|
|
260 |
// CAppUi::HandleWsEventL()
|
|
261 |
// ----------------------------------------------------------------------------
|
|
262 |
//
|
|
263 |
void CAppUi::HandleWsEventL( const TWsEvent& aEvent,
|
|
264 |
CCoeControl* aDestination )
|
|
265 |
{
|
|
266 |
if( aEvent.Type() == KAknUidValueEndKeyCloseEvent )
|
|
267 |
{
|
|
268 |
// End key close event, run dialog shutter
|
|
269 |
// to dismiss open dialogs
|
|
270 |
if ( IsDisplayingMenuOrDialog() )
|
|
271 |
{
|
|
272 |
AknDialogShutter::ShutDialogsL(
|
|
273 |
*static_cast< CEikonEnv* >( CCoeEnv::Static() ) );
|
|
274 |
}
|
|
275 |
else
|
|
276 |
{
|
|
277 |
TKeyEvent key;
|
|
278 |
|
|
279 |
key.iScanCode = EStdKeyNo;
|
|
280 |
key.iCode = EKeyNull;
|
|
281 |
key.iModifiers = 0;
|
|
282 |
key.iRepeats = 0;
|
|
283 |
|
|
284 |
iCoeEnv->SimulateKeyEventL( key, EEventKey );
|
|
285 |
}
|
|
286 |
}
|
|
287 |
|
|
288 |
if( aEvent.Type() == EEventKeyDown )
|
|
289 |
{
|
|
290 |
if( aEvent.Key()->iScanCode == EStdKeyYes )
|
|
291 |
{
|
|
292 |
// Send key was pushed and long press recognition is started
|
|
293 |
StartKeyTimerL();
|
|
294 |
}
|
|
295 |
}
|
|
296 |
|
|
297 |
if( aEvent.Type() == EEventKeyUp )
|
|
298 |
{
|
|
299 |
if( aEvent.Key()->iScanCode == EStdKeyYes )
|
|
300 |
{
|
|
301 |
if( iKeyTimer && iKeyTimer->IsActive() )
|
|
302 |
{
|
|
303 |
// up event is coming before long press of Send key is recognized
|
|
304 |
// Start dialled calls
|
|
305 |
StopKeyTimer();
|
|
306 |
LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView() );
|
|
307 |
}
|
|
308 |
}
|
|
309 |
}
|
|
310 |
|
|
311 |
if( iIdleIntegration )
|
|
312 |
{
|
|
313 |
// Forward window server events first to idle integration library
|
|
314 |
iIdleIntegration->HandleWsEventL( aEvent, aDestination );
|
|
315 |
}
|
|
316 |
|
|
317 |
// Call base class to let the UI framework handle the event
|
|
318 |
// Don't trap here, because there could be leaves which need to
|
|
319 |
// handled by base classes/UI framework like KLeaveExit, KErrNoMemory etc.
|
|
320 |
CXnAppUiAdapter::HandleWsEventL( aEvent, aDestination );
|
|
321 |
}
|
|
322 |
|
|
323 |
// ----------------------------------------------------------------------------
|
|
324 |
// CAppUi::HandleXuikonEventL()
|
|
325 |
// ----------------------------------------------------------------------------
|
|
326 |
//
|
|
327 |
void CAppUi::HandleXuikonEventL( CXnNodeAppIf& aOrigin,
|
|
328 |
CXnNodeAppIf& aTrigger,
|
|
329 |
CXnDomNode& aTriggerDefinition,
|
|
330 |
CXnDomNode& aEvent )
|
|
331 |
{
|
|
332 |
__PRINTS("*** UC: Init - Event Management ***");
|
|
333 |
|
|
334 |
if( iEventHandler )
|
|
335 |
{
|
|
336 |
__TIME("UC: Event Management",
|
|
337 |
iEventHandler->HandleXuikonEventL( aOrigin,
|
|
338 |
aTrigger, aTriggerDefinition, aEvent ) );
|
|
339 |
}
|
|
340 |
__PRINTS("*** UI: Done - Event Management");
|
|
341 |
}
|
|
342 |
|
|
343 |
// ----------------------------------------------------------------------------
|
|
344 |
// CAppUi::HandleEventL()
|
|
345 |
// ----------------------------------------------------------------------------
|
|
346 |
//
|
|
347 |
void CAppUi::HandleEventL( const TDesC& aEvent, CXnNodeAppIf& aDestination )
|
|
348 |
{
|
|
349 |
THsPublisherInfo info;
|
|
350 |
|
|
351 |
TInt ret( PublisherInfo( aDestination, info ) );
|
|
352 |
|
|
353 |
if ( ret == KErrNone )
|
|
354 |
{
|
|
355 |
iUiCtl.FwEventHandler()->HandlePluginEventL( info, aEvent );
|
|
356 |
}
|
|
357 |
}
|
|
358 |
|
|
359 |
// ----------------------------------------------------------------------------
|
|
360 |
// CAppUi::LoadPublisher()
|
|
361 |
// ----------------------------------------------------------------------------
|
|
362 |
//
|
|
363 |
void CAppUi::LoadPublisher( const TAiFwPublisherInfo& aPublisher )
|
|
364 |
{
|
|
365 |
if ( aPublisher.Info().Uid() == KDeviceStatusPluginUid )
|
|
366 |
{
|
|
367 |
// Update device status info
|
|
368 |
iDeviceStatusInfo = aPublisher.Info();
|
|
369 |
}
|
|
370 |
|
|
371 |
iUiCtl.FwStateHandler()->LoadPlugin( aPublisher );
|
|
372 |
}
|
|
373 |
|
|
374 |
// ----------------------------------------------------------------------------
|
|
375 |
// CAppUi::DestroyPublisher()
|
|
376 |
// ----------------------------------------------------------------------------
|
|
377 |
//
|
|
378 |
void CAppUi::DestroyPublisher( const TAiFwPublisherInfo& aPublisher )
|
|
379 |
{
|
|
380 |
iUiCtl.FwStateHandler()->DestroyPlugin( aPublisher );
|
|
381 |
}
|
|
382 |
|
|
383 |
// ----------------------------------------------------------------------------
|
|
384 |
// CAppUi::DynInitMenuItemL()
|
|
385 |
// ----------------------------------------------------------------------------
|
|
386 |
//
|
|
387 |
TBool CAppUi::DynInitMenuItemL( const TDesC& aItemType,
|
|
388 |
RPointerArray< CXnNodeAppIf >* aList )
|
|
389 |
{
|
|
390 |
_LIT( KOnline, "hs_online" );
|
|
391 |
_LIT( KOffline, "hs_offline" );
|
|
392 |
|
|
393 |
TBool retval( EFalse );
|
|
394 |
|
|
395 |
if( aItemType == KOnline )
|
|
396 |
{
|
|
397 |
return iHelper->ShowOnlineItem();
|
|
398 |
}
|
|
399 |
else if( aItemType == KOffline )
|
|
400 |
{
|
|
401 |
return iHelper->ShowOfflineItem();
|
|
402 |
}
|
|
403 |
else if( aList )
|
|
404 |
{
|
|
405 |
RPointerArray< CXnNodeAppIf >& list( *aList );
|
|
406 |
|
|
407 |
for( TInt i = 0; !retval && i < list.Count(); i++ )
|
|
408 |
{
|
|
409 |
THsPublisherInfo info;
|
|
410 |
|
|
411 |
iUiCtl.PublisherInfoL( *list[i], info );
|
|
412 |
|
|
413 |
retval = iUiCtl.FwEventHandler()->HasMenuItemL( info, aItemType );
|
|
414 |
}
|
|
415 |
}
|
|
416 |
|
|
417 |
return retval;
|
|
418 |
}
|
|
419 |
|
|
420 |
// ----------------------------------------------------------------------------
|
|
421 |
// CAppUi::SetOnlineStateL()
|
|
422 |
// Called always when user changed HS online/offline status from option menu.
|
|
423 |
// ----------------------------------------------------------------------------
|
|
424 |
//
|
|
425 |
void CAppUi::SetOnlineStateL( TBool aOnline )
|
|
426 |
{
|
|
427 |
iHelper->ProcessOnlineStateL( aOnline );
|
|
428 |
}
|
|
429 |
|
|
430 |
// ----------------------------------------------------------------------------
|
|
431 |
// CAppUi::UiController()
|
|
432 |
// ----------------------------------------------------------------------------
|
|
433 |
//
|
|
434 |
CXmlUiController& CAppUi::UiController() const
|
|
435 |
{
|
|
436 |
return iUiCtl;
|
|
437 |
}
|
|
438 |
|
|
439 |
// ----------------------------------------------------------------------------
|
|
440 |
// CAppUi::Helper()
|
|
441 |
// ----------------------------------------------------------------------------
|
|
442 |
//
|
|
443 |
COnlineOfflineHelper* CAppUi::Helper() const
|
|
444 |
{
|
|
445 |
return iHelper;
|
|
446 |
}
|
|
447 |
|
|
448 |
// ----------------------------------------------------------------------------
|
|
449 |
// CAppUi::HandleEnterEditModeL()
|
|
450 |
// ----------------------------------------------------------------------------
|
|
451 |
//
|
|
452 |
void CAppUi::HandleEnterEditModeL( TBool aEnter )
|
|
453 |
{
|
|
454 |
if ( iInEditMode != aEnter )
|
|
455 |
{
|
|
456 |
TVwsViewId activeViewId;
|
|
457 |
TInt err( GetActiveViewId( activeViewId ) );
|
|
458 |
|
|
459 |
if ( aEnter )
|
|
460 |
{
|
|
461 |
iUiCtl.FwEventHandler()->SuspendContent(
|
|
462 |
iDeviceStatusInfo, KNetworkIdentity );
|
|
463 |
|
|
464 |
if ( !err && View().ViewId() == activeViewId )
|
|
465 |
{
|
|
466 |
SetTitlePaneTextL( *iEditModeTitle );
|
|
467 |
}
|
|
468 |
}
|
|
469 |
else
|
|
470 |
{
|
|
471 |
if ( !err && View().ViewId() == activeViewId )
|
|
472 |
{
|
|
473 |
SetTitlePaneTextL( KNullDesC );
|
|
474 |
}
|
|
475 |
|
|
476 |
iUiCtl.FwEventHandler()->RefreshContent(
|
|
477 |
iDeviceStatusInfo, KNetworkIdentity );
|
|
478 |
}
|
|
479 |
|
|
480 |
iInEditMode = aEnter;
|
|
481 |
}
|
|
482 |
}
|
|
483 |
|
|
484 |
// ----------------------------------------------------------------------------
|
|
485 |
// CAppUi::HandleViewActivation()
|
|
486 |
// ----------------------------------------------------------------------------
|
|
487 |
//
|
|
488 |
void CAppUi::HandleViewActivation( const TVwsViewId& aNewlyActivatedViewId,
|
|
489 |
const TVwsViewId& aViewIdToBeDeactivated )
|
|
490 |
{
|
|
491 |
TVwsViewId activeViewId;
|
|
492 |
|
|
493 |
TInt err( GetActiveViewId( activeViewId ) );
|
|
494 |
|
|
495 |
if ( err == KErrNotFound )
|
|
496 |
{
|
|
497 |
return;
|
|
498 |
}
|
|
499 |
|
|
500 |
// Get Xml Ui view id
|
|
501 |
TVwsViewId xmlViewId( View().ViewId() );
|
|
502 |
|
|
503 |
if ( xmlViewId == aNewlyActivatedViewId && activeViewId != xmlViewId )
|
|
504 |
{
|
|
505 |
if ( iInEditMode )
|
|
506 |
{
|
|
507 |
TRAP_IGNORE( SetTitlePaneTextL( *iEditModeTitle ) );
|
|
508 |
}
|
|
509 |
else
|
|
510 |
{
|
|
511 |
// Xml Ui view became active
|
|
512 |
iUiCtl.FwEventHandler()->RefreshContent(
|
|
513 |
iDeviceStatusInfo, KNetworkIdentity );
|
|
514 |
}
|
|
515 |
}
|
|
516 |
else if ( xmlViewId == aViewIdToBeDeactivated && activeViewId == xmlViewId )
|
|
517 |
{
|
|
518 |
if ( iInEditMode )
|
|
519 |
{
|
|
520 |
//TRAP_IGNORE( SetTitlePaneTextL( KNullDesC ) );
|
|
521 |
}
|
|
522 |
else
|
|
523 |
{
|
|
524 |
// Xml Ui view became inactive
|
|
525 |
iUiCtl.FwEventHandler()->SuspendContent(
|
|
526 |
iDeviceStatusInfo, KNetworkIdentity );
|
|
527 |
}
|
|
528 |
}
|
|
529 |
}
|
|
530 |
|
|
531 |
// ----------------------------------------------------------------------------
|
|
532 |
// CAppUi::StartKeyTimerL()
|
|
533 |
// Starts long press recognizer of Send key.
|
|
534 |
// ----------------------------------------------------------------------------
|
|
535 |
//
|
|
536 |
void CAppUi::StartKeyTimerL()
|
|
537 |
{
|
|
538 |
if ( !iKeyTimer )
|
|
539 |
{
|
|
540 |
iKeyTimer = CPeriodic::NewL( CActive::EPriorityStandard );
|
|
541 |
}
|
|
542 |
else if ( iKeyTimer->IsActive() )
|
|
543 |
{
|
|
544 |
iKeyTimer->Cancel();
|
|
545 |
}
|
|
546 |
iKeyTimer->Start( KAknKeyboardRepeatInitialDelay,
|
|
547 |
KAknKeyboardRepeatInitialDelay,
|
|
548 |
TCallBack ( ReportLongPressL, this ) );
|
|
549 |
}
|
|
550 |
|
|
551 |
// ----------------------------------------------------------------------------
|
|
552 |
// CAppUi::StopKeyTimer()
|
|
553 |
// Stops Send key long press recognizer.
|
|
554 |
// ----------------------------------------------------------------------------
|
|
555 |
//
|
|
556 |
void CAppUi::StopKeyTimer()
|
|
557 |
{
|
|
558 |
if ( iKeyTimer && iKeyTimer->IsActive() )
|
|
559 |
{
|
|
560 |
iKeyTimer->Cancel();
|
|
561 |
}
|
|
562 |
}
|
|
563 |
|
|
564 |
// ----------------------------------------------------------------------------
|
|
565 |
// CAppUi::HandleViewActivation()
|
|
566 |
// Launches Voice command application after long Send key is pressed.
|
|
567 |
// ----------------------------------------------------------------------------
|
|
568 |
//
|
|
569 |
void CAppUi::LaunchVoiceCommandL()
|
|
570 |
{
|
|
571 |
TApaTaskList apaTaskList( iCoeEnv->WsSession() );
|
|
572 |
TApaTask apaTask = apaTaskList.FindApp( KVoiceUiUID );
|
|
573 |
|
|
574 |
if ( apaTask.Exists() )
|
|
575 |
{
|
|
576 |
apaTask.BringToForeground();
|
|
577 |
}
|
|
578 |
else
|
|
579 |
{
|
|
580 |
RApaLsSession apaLsSession;
|
|
581 |
User::LeaveIfError( apaLsSession.Connect() );
|
|
582 |
CleanupClosePushL( apaLsSession );
|
|
583 |
|
|
584 |
TApaAppInfo appInfo;
|
|
585 |
|
|
586 |
if( apaLsSession.GetAppInfo( appInfo, KVoiceUiUID ) == KErrNone )
|
|
587 |
{
|
|
588 |
CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
|
|
589 |
cmdLine->SetExecutableNameL( appInfo.iFullName );
|
|
590 |
cmdLine->SetCommandL( EApaCommandRun );
|
|
591 |
User::LeaveIfError( apaLsSession.StartApp( *cmdLine ) );
|
|
592 |
CleanupStack::PopAndDestroy( cmdLine );
|
|
593 |
}
|
|
594 |
CleanupStack::PopAndDestroy( &apaLsSession );
|
|
595 |
}
|
|
596 |
}
|
|
597 |
|
|
598 |
// ----------------------------------------------------------------------------
|
|
599 |
// CAppUi::ReportLongPressL()
|
|
600 |
// Callback function for long press timer of the Send key.
|
|
601 |
// ----------------------------------------------------------------------------
|
|
602 |
//
|
|
603 |
TInt CAppUi::ReportLongPressL( TAny* aThis )
|
|
604 |
{
|
|
605 |
CAppUi* self = reinterpret_cast <CAppUi* > ( aThis );
|
|
606 |
|
|
607 |
self->StopKeyTimer();
|
|
608 |
|
|
609 |
if ( iAvkonAppUi->IsForeground() )
|
|
610 |
{
|
|
611 |
self->LaunchVoiceCommandL();
|
|
612 |
}
|
|
613 |
|
|
614 |
return 1; // CPeriodic ignores return value
|
|
615 |
}
|
|
616 |
|
|
617 |
// ----------------------------------------------------------------------------
|
|
618 |
// CAppUi::SetTitlePaneTextL()
|
|
619 |
//
|
|
620 |
// ----------------------------------------------------------------------------
|
|
621 |
//
|
|
622 |
void CAppUi::SetTitlePaneTextL( const TDesC& aText )
|
|
623 |
{
|
|
624 |
CEikStatusPane* sp( StatusPane() );
|
|
625 |
if ( !sp ) { return; }
|
|
626 |
|
|
627 |
// make sure status pane is transparent.
|
|
628 |
//sp->EnableTransparent( ETrue );
|
|
629 |
|
|
630 |
TUid titlePaneUid( TUid::Uid( EEikStatusPaneUidTitle ) );
|
|
631 |
|
|
632 |
CEikStatusPaneBase::TPaneCapabilities subPaneTitle(
|
|
633 |
sp->PaneCapabilities( titlePaneUid ) );
|
|
634 |
|
|
635 |
if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
|
|
636 |
{
|
|
637 |
CAknTitlePane* title =
|
|
638 |
static_cast< CAknTitlePane* >( sp->ControlL( titlePaneUid ) );
|
|
639 |
|
|
640 |
if ( title )
|
|
641 |
{
|
|
642 |
title->SetTextL( aText );
|
|
643 |
title->DrawNow();
|
|
644 |
}
|
|
645 |
}
|
|
646 |
|
|
647 |
// redraw statuspane
|
|
648 |
//sp->DrawNow();
|
|
649 |
}
|
|
650 |
|
|
651 |
// -----------------------------------------------------------------------------
|
|
652 |
// CAppUi::HelpContextL
|
|
653 |
// Returns the help context
|
|
654 |
// -----------------------------------------------------------------------------
|
|
655 |
//
|
|
656 |
CArrayFix<TCoeHelpContext>* CAppUi::HelpContextL() const
|
|
657 |
{
|
|
658 |
TUid fwUid = TUid::Uid( AI_UID3_AIFW_COMMON );
|
|
659 |
TCoeContextName helpString;
|
|
660 |
if( iUiCtl.UiEngineL()->IsEditMode())
|
|
661 |
{
|
|
662 |
helpString.Copy( KSET_HLP_HOME_SCREEN_EDIT );
|
|
663 |
}
|
|
664 |
else
|
|
665 |
{
|
|
666 |
helpString.Copy( KSET_HLP_HOME_SCREEN );
|
|
667 |
}
|
|
668 |
|
|
669 |
CArrayFixFlat<TCoeHelpContext>* array =
|
|
670 |
new( ELeave ) CArrayFixFlat<TCoeHelpContext>( 1 );
|
|
671 |
CleanupStack::PushL( array );
|
|
672 |
array->AppendL( TCoeHelpContext( fwUid, helpString ) );
|
|
673 |
CleanupStack::Pop( array );
|
|
674 |
return array;
|
|
675 |
}
|
|
676 |
|
|
677 |
// End of File.
|