|
1 /* |
|
2 * Copyright (c) 2008-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: Rotate command implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 |
|
23 #include "glxcommandhandlerhideui.h" |
|
24 |
|
25 #include <glxuiutility.h> |
|
26 #include <glxlog.h> |
|
27 #include <eikmenup.h> |
|
28 |
|
29 #include "glxcommandhandlers.hrh" |
|
30 |
|
31 |
|
32 // --------------------------------------------------------------------------- |
|
33 // NewL |
|
34 // --------------------------------------------------------------------------- |
|
35 // |
|
36 EXPORT_C CGlxCommandHandlerHideUi* CGlxCommandHandlerHideUi::NewL() |
|
37 { |
|
38 CGlxCommandHandlerHideUi* self |
|
39 = new (ELeave) CGlxCommandHandlerHideUi(); |
|
40 CleanupStack::PushL(self); |
|
41 self->ConstructL(); |
|
42 CleanupStack::Pop(self); |
|
43 return self; |
|
44 } |
|
45 |
|
46 // --------------------------------------------------------------------------- |
|
47 // Constructor |
|
48 // --------------------------------------------------------------------------- |
|
49 // |
|
50 CGlxCommandHandlerHideUi::CGlxCommandHandlerHideUi():CGlxCommandHandler() |
|
51 { |
|
52 } |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // ConstructL |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 void CGlxCommandHandlerHideUi::ConstructL() |
|
59 { |
|
60 iUiUtility = CGlxUiUtility::UtilityL(); |
|
61 } |
|
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // Destructor |
|
65 // --------------------------------------------------------------------------- |
|
66 // |
|
67 CGlxCommandHandlerHideUi::~CGlxCommandHandlerHideUi() |
|
68 { |
|
69 if ( iUiUtility ) |
|
70 { |
|
71 iUiUtility->Close(); |
|
72 } |
|
73 } |
|
74 |
|
75 // --------------------------------------------------------------------------- |
|
76 // ExecuteL |
|
77 // --------------------------------------------------------------------------- |
|
78 // |
|
79 TBool CGlxCommandHandlerHideUi::ExecuteL(TInt aCommand) |
|
80 { |
|
81 GLX_LOG_INFO("CGlxCommandHandlerHideUi::ExecuteL"); |
|
82 TBool handled = EFalse; |
|
83 |
|
84 switch ( aCommand ) |
|
85 { |
|
86 case EGlxCmdStateView: |
|
87 // Moved to full screen |
|
88 iCommandAvailable = ETrue; |
|
89 break; |
|
90 |
|
91 case EGlxCmdStateBrowse: |
|
92 // Moved back to Grid view |
|
93 iCommandAvailable = EFalse; |
|
94 break; |
|
95 |
|
96 case EGlxCmdHideUI: |
|
97 { |
|
98 handled = ETrue; |
|
99 } |
|
100 break; |
|
101 |
|
102 default: |
|
103 break; |
|
104 } |
|
105 |
|
106 return handled; |
|
107 } |
|
108 |
|
109 // --------------------------------------------------------------------------- |
|
110 // DynInitMenuPaneL |
|
111 // --------------------------------------------------------------------------- |
|
112 // |
|
113 void CGlxCommandHandlerHideUi::DynInitMenuPaneL(TInt /*aResourceId*/, CEikMenuPane* aMenuPane) |
|
114 { |
|
115 if ( !iCommandAvailable && aMenuPane ) |
|
116 { |
|
117 TInt pos; |
|
118 if ( aMenuPane->MenuItemExists(EGlxCmdHideUI, pos) ) |
|
119 { |
|
120 aMenuPane->SetItemDimmed(EGlxCmdHideUI, ETrue); |
|
121 } |
|
122 } |
|
123 } |
|
124 |
|
125 // --------------------------------------------------------------------------- |
|
126 // DoActivateL |
|
127 // --------------------------------------------------------------------------- |
|
128 // |
|
129 void CGlxCommandHandlerHideUi::DoActivateL(TInt aViewId) |
|
130 { |
|
131 iViewId = aViewId; |
|
132 } |
|
133 |
|
134 // --------------------------------------------------------------------------- |
|
135 // Deactivate |
|
136 // --------------------------------------------------------------------------- |
|
137 // |
|
138 void CGlxCommandHandlerHideUi::Deactivate() |
|
139 { |
|
140 // No implementation |
|
141 } |
|
142 |
|
143 // --------------------------------------------------------------------------- |
|
144 // OfferKeyEventL |
|
145 // --------------------------------------------------------------------------- |
|
146 // |
|
147 TKeyResponse CGlxCommandHandlerHideUi::OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/) |
|
148 { |
|
149 return EKeyWasNotConsumed; |
|
150 } |
|
151 |
|
152 // --------------------------------------------------------------------------- |
|
153 // PreDynInitMenuPaneL |
|
154 // --------------------------------------------------------------------------- |
|
155 // |
|
156 void CGlxCommandHandlerHideUi::PreDynInitMenuPaneL( TInt /*aResourceId*/ ) |
|
157 { |
|
158 // No implementation |
|
159 } |
|
160 |
|
161 |
|
162 |