1 /* |
|
2 * Copyright (c) 2002 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: Application UI class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "CProfileAppUi.h" |
|
21 |
|
22 #include <hlplch.h> |
|
23 #include <CProfileEngineHandler.h> |
|
24 |
|
25 #include "CProfileMainView.h" |
|
26 #include "CProfileSettingsView.h" |
|
27 #include "ProfileApp.hrh" |
|
28 |
|
29 // ============================ MEMBER FUNCTIONS =============================== |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CProfileAppUi::CProfileAppUi |
|
33 // C++ constructor can NOT contain any code, that might leave. |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 CProfileAppUi::CProfileAppUi( |
|
37 CProfileEngineHandler& aEngineHandler, |
|
38 CProfileIndexHandler& aIndexHandler ) |
|
39 : iEngineHandler( aEngineHandler ), |
|
40 iIndexHandler( aIndexHandler ) |
|
41 { |
|
42 } |
|
43 |
|
44 // Destructor |
|
45 CProfileAppUi::~CProfileAppUi() |
|
46 { |
|
47 } |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CProfileAppUi::ConstructL |
|
51 // Symbian 2nd phase constructor can leave. |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 void CProfileAppUi::ConstructL() |
|
55 { |
|
56 BaseConstructL( EAknEnableSkin | EAknEnableMSK |EAknSingleClickCompatible); |
|
57 |
|
58 CProfileMainView* mainView = |
|
59 CProfileMainView::NewLC( iEngineHandler, iIndexHandler ); |
|
60 AddViewL( mainView ); // transfer ownership to CAknViewAppUi |
|
61 SetDefaultViewL( *mainView ); |
|
62 CleanupStack::Pop( mainView); |
|
63 iMainView = mainView; |
|
64 |
|
65 CProfileSettingsView* settingsView = |
|
66 CProfileSettingsView::NewLC( |
|
67 iEngineHandler, iIndexHandler); |
|
68 AddViewL( settingsView ); // transfer ownership to CAknViewAppUi |
|
69 CleanupStack::Pop( settingsView ); // iSettingsView |
|
70 iSettingsView = settingsView; |
|
71 } |
|
72 |
|
73 // ----------------------------------------------------------------------------- |
|
74 // CProfileAppUi::HandleCommandL |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 void CProfileAppUi::HandleCommandL( TInt aCommand ) |
|
78 { |
|
79 switch( aCommand ) |
|
80 { |
|
81 case EAknSoftkeyBack: // Back from Settings view |
|
82 { |
|
83 if ( iView == iMainView ) |
|
84 { |
|
85 Exit(); // Back from Settings view |
|
86 break; |
|
87 } |
|
88 ActivateLocalViewL( iMainView->Id() ); |
|
89 break; |
|
90 } |
|
91 case EProfileCmdPersonalise: // Personalise from Main view |
|
92 { |
|
93 ActivateLocalViewL( iSettingsView->Id() ); |
|
94 break; |
|
95 } |
|
96 // FALLTHROUGH for PC Lint |
|
97 // Exit from options menu and exit from right softkey do the same thing. |
|
98 case EEikCmdExit: |
|
99 case EAknSoftkeyExit: |
|
100 { |
|
101 Exit(); |
|
102 break; |
|
103 } |
|
104 case EAknCmdHelp: |
|
105 { |
|
106 HlpLauncher::LaunchHelpApplicationL( |
|
107 iEikonEnv->WsSession(), AppHelpContextL() ); |
|
108 break; |
|
109 } |
|
110 default: |
|
111 { |
|
112 break; |
|
113 } |
|
114 } |
|
115 } |
|
116 |
|
117 // End of File |
|