|
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: Screenfurniture interface. Used to show/hide UI or |
|
15 * enable/disable induvidual screenfurniture items. Contains |
|
16 * softkeys, toolbar and the title statuspane as part of it. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef C_GLXSCREENFURNITURE_H |
|
24 #define C_GLXSCREENFURNITURE_H |
|
25 |
|
26 #include "glxuiutility.h" |
|
27 |
|
28 #include <akntoolbar.h> |
|
29 #include <akntoolbarobserver.h> |
|
30 #include <aknbutton.h> |
|
31 |
|
32 /** |
|
33 * CGlxScreenFurniture |
|
34 * |
|
35 * ScreenFurniture is responsible for handling the floating toolbar for |
|
36 * non-touch |
|
37 * |
|
38 * @lib glxuiutils.lib |
|
39 */ |
|
40 NONSHARABLE_CLASS( CGlxScreenFurniture ): public CBase, |
|
41 public MAknToolbarObserver |
|
42 { |
|
43 |
|
44 public: |
|
45 /** |
|
46 * Two-phased constructor |
|
47 * @param aParentUtility Instance of CGlxUiUtility used to create this |
|
48 * @return Constructed object |
|
49 */ |
|
50 IMPORT_C static CGlxScreenFurniture* NewL( CGlxUiUtility& aParentUtility ); |
|
51 |
|
52 /** |
|
53 * Two-phased constructor |
|
54 * @param aParentUtility Instance of CGlxUiUtility used to create this |
|
55 * @return Constructed object |
|
56 */ |
|
57 IMPORT_C static CGlxScreenFurniture* NewLC( CGlxUiUtility& aParentUtility ); |
|
58 |
|
59 /** |
|
60 * Set the ID of the currently active view. Call this in DoActivateL(). |
|
61 * @param aViewId The view that is trying to control the screen furniture |
|
62 */ |
|
63 IMPORT_C void SetActiveView( TInt aViewId); |
|
64 |
|
65 /** |
|
66 * Lets the screen furniture know that a view has been deactivated. |
|
67 * If no other views are Active, the screen furniture will turn itself off. |
|
68 * Call this in DoDeactivate(). |
|
69 * @param aViewId The view that is trying to control the screen furniture |
|
70 */ |
|
71 IMPORT_C void ViewDeactivated( TInt aViewId); |
|
72 |
|
73 /** |
|
74 * To set the toolbar visibility |
|
75 * @param aVisible Whether toolbar should be visible or not. |
|
76 * @param aFocus Whether focus is required by default |
|
77 */ |
|
78 IMPORT_C void SetToolbarVisibility(TBool aVisible); |
|
79 |
|
80 /** |
|
81 * To set the item specific visibility |
|
82 * @param aCommand The command that should be shown or hidden |
|
83 * @param aVisible ETrue if item needs to be shown else EFalse |
|
84 */ |
|
85 IMPORT_C void SetToolbarItemVisibility( TInt aCommand, TBool aVisible ); |
|
86 |
|
87 /** |
|
88 * To set the command dimmed |
|
89 * @param aCommand The command that should be dimmed |
|
90 * @param aDimmed ETrue if command needs to be dimmed. |
|
91 */ |
|
92 IMPORT_C void SetToolbarItemDimmed( TInt aCommand, TBool aDimmed ); |
|
93 |
|
94 /** |
|
95 * To set the focus of the toolbar |
|
96 * @param aCommand The command that should be focused. |
|
97 */ |
|
98 IMPORT_C void SetFocusL( TInt aCommand ); |
|
99 |
|
100 /** |
|
101 * Set the toolbar position w.r.t the screen area * |
|
102 */ |
|
103 IMPORT_C void SetToolbarPosition(); |
|
104 |
|
105 /** |
|
106 * Sets the tooltip position of each toolbar item. |
|
107 * @param aCommand Command Id |
|
108 * @param aPos Position of the tooltip to be set. |
|
109 EPositionTop = 1, Tool tip alignment vertically to top |
|
110 EPositionBottom, Tool tip alignment vertically to bottom |
|
111 EPositionLeft, Tool tip alignment horizontally to left |
|
112 EPositionRight, Tool tip alignment horizontally to right |
|
113 */ |
|
114 IMPORT_C void SetTooltipL( TInt aCommand, |
|
115 CAknButton::TTooltipPosition aToolTipPos, const TDesC& aToolTipText = KNullDesC); |
|
116 |
|
117 /** |
|
118 * This will be called for changing softkeys(MSK and RSK) and providing commands to them |
|
119 */ |
|
120 IMPORT_C void ModifySoftkeyIdL(CEikButtonGroupContainer::TCommandPosition aPosition, TInt aCommandId, TInt aResourceId, const TDesC& aText= KNullDesC ); |
|
121 |
|
122 /** |
|
123 * Destructor |
|
124 */ |
|
125 ~CGlxScreenFurniture(); |
|
126 |
|
127 private: |
|
128 /** |
|
129 * Default constructor |
|
130 */ |
|
131 CGlxScreenFurniture( CGlxUiUtility& aParentUtility ); |
|
132 |
|
133 /** |
|
134 * ConstructL |
|
135 */ |
|
136 void ConstructL(); |
|
137 |
|
138 private: //From MAknToolbarObserver |
|
139 void OfferToolbarEventL( TInt aCommand ); |
|
140 void SetToolbarObserver(MAknToolbarObserver* aObserver); |
|
141 |
|
142 private: |
|
143 /// The ID of the view currently using the screen furniture |
|
144 TInt iActiveView; |
|
145 |
|
146 // Resource offset |
|
147 TInt iResourceOffset; |
|
148 |
|
149 /// Parent UiUtility reference |
|
150 CGlxUiUtility& iParentUtility; |
|
151 |
|
152 /// Avkon floating toolbar with focus (Owned) |
|
153 CAknToolbar* iToolbar; |
|
154 }; |
|
155 |
|
156 #endif /*C_GLXSCREENFURNITUREIMPL_H*/ |