1 /* |
|
2 * Copyright (c) 2005 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: LandmarksUi Content File - |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 // INCLUDE FILES |
|
25 #include "LmUiRefAppDocument.h" |
|
26 #include "LmUiRefAppUi.h" |
|
27 #include <lmuirefapp.rsg> |
|
28 #include "lmuirefapp.hrh" |
|
29 #include <avkon.hrh> |
|
30 #include <aknViewAppUi.h> |
|
31 #include "LmUiRefAppView.h" |
|
32 #include <AknsUtils.h> |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 // ================= MEMBER FUNCTIONS ======================= |
|
38 // |
|
39 // ---------------------------------------------------------- |
|
40 // CLmUiRefAppUi::ConstructL() |
|
41 // Symbian 2nd phase constructor can leave. |
|
42 // ---------------------------------------------------------- |
|
43 // |
|
44 void CLmUiRefAppUi::ConstructL() |
|
45 { |
|
46 //BaseConstructL(EAknEnableSkin); |
|
47 BaseConstructL( EAknEnableSkin | EAknEnableMSK); |
|
48 CLmUiRefAppView* lmView = CLmUiRefAppView::NewLC(); |
|
49 AddViewL(lmView); // Transfer Ownership |
|
50 CleanupStack::Pop(); |
|
51 SetDefaultViewL(*lmView); |
|
52 } |
|
53 |
|
54 // ---------------------------------------------------- |
|
55 // CLmUiRefAppUi::~CLmUiRefAppUi:() |
|
56 // Destructor Frees reserved resources |
|
57 // ---------------------------------------------------- |
|
58 // |
|
59 CLmUiRefAppUi::~CLmUiRefAppUi() |
|
60 { |
|
61 |
|
62 } |
|
63 |
|
64 //------------------------------------------------------------------------------ |
|
65 // CLmUiRefAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) |
|
66 // This function is called by the EIKON framework just before it displays |
|
67 // a menu pane. Its default implementation is empty, and by overriding it, |
|
68 // the application can set the state of menu items dynamically according |
|
69 // to the state of application data. |
|
70 //------------------------------------------------------------------------------ |
|
71 // |
|
72 void CLmUiRefAppUi::DynInitMenuPaneL( |
|
73 TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/) |
|
74 { |
|
75 } |
|
76 |
|
77 // ---------------------------------------------------- |
|
78 // CLmUiRefAppUi::HandleKeyEventL( |
|
79 // const TKeyEvent& aKeyEvent,TEventCode /*aType*/) |
|
80 // Handles key events. It is called by HandleWsEventL() |
|
81 // when a key press event occurs |
|
82 // ---------------------------------------------------- |
|
83 // |
|
84 TKeyResponse CLmUiRefAppUi::HandleKeyEventL( |
|
85 const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/) |
|
86 { |
|
87 return EKeyWasNotConsumed; |
|
88 } |
|
89 |
|
90 // ---------------------------------------------------- |
|
91 // CLmkAppUi::Document |
|
92 // ---------------------------------------------------- |
|
93 // |
|
94 CLmUiRefAppDocument& CLmUiRefAppUi::Document() const |
|
95 { |
|
96 // Explicit cast: the document must always be of type CLmkDocument |
|
97 CLmUiRefAppDocument* document = |
|
98 static_cast<CLmUiRefAppDocument*>( CEikAppUi::Document() ); |
|
99 |
|
100 return *document; |
|
101 } |
|
102 |
|
103 |
|
104 // ---------------------------------------------------- |
|
105 // CLmUiRefAppUi::HandleCommandL(TInt aCommand) |
|
106 // Handles commands defined in resource files |
|
107 // ---------------------------------------------------- |
|
108 // |
|
109 void CLmUiRefAppUi::HandleCommandL(TInt aCommand) |
|
110 { |
|
111 switch ( aCommand ) |
|
112 { |
|
113 // these all are same: exit |
|
114 case EAknSoftkeyBack: |
|
115 case EAknSoftkeyExit: |
|
116 case EEikCmdExit: |
|
117 { |
|
118 Exit(); |
|
119 break; |
|
120 } |
|
121 default: |
|
122 break; |
|
123 } |
|
124 } |
|
125 |
|
126 // End of File |
|