author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:31:22 +0300 | |
branch | RCL_3 |
changeset 81 | c26cc2a7c548 |
parent 62 | 5266b1f337bd |
permissions | -rw-r--r-- |
62 | 1 |
/* |
2 |
* Copyright (c) 2007-2008 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: Handles the updating dialer, toolbar buttons. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef CPHONETOOLBARCONTROLLER_H |
|
20 |
#define CPHONETOOLBARCONTROLLER_H |
|
21 |
||
22 |
#include <e32base.h> |
|
23 |
#include <akntoolbarobserver.h> |
|
24 |
||
25 |
class CAknToolbar; |
|
26 |
class CCoeEnv; |
|
27 |
class TPhoneCommandParam; |
|
28 |
class CAknButton; |
|
29 |
class TAknsItemID; |
|
30 |
class TPhoneCommandParam; |
|
31 |
||
32 |
||
33 |
/** |
|
34 |
* Toolbar controller, updates toolbar buttons |
|
35 |
* |
|
36 |
* @lib PhoneUIView.lib |
|
37 |
* @since S60 v5.0 |
|
38 |
*/ |
|
39 |
NONSHARABLE_CLASS( CPhoneToolbarController ): |
|
40 |
public CBase, public MAknToolbarObserver |
|
41 |
{ |
|
42 |
public: |
|
43 |
/** |
|
44 |
* Two-phased constructor. |
|
45 |
* @param aCoeEnv |
|
46 |
* @param aMenuController |
|
47 |
*/ |
|
48 |
static CPhoneToolbarController* NewL( CCoeEnv& aCoeEnv); |
|
49 |
/** |
|
50 |
* Destructor. |
|
51 |
*/ |
|
52 |
virtual ~CPhoneToolbarController(); |
|
53 |
||
54 |
/** |
|
55 |
* Updates toolbar buttons. |
|
56 |
*/ |
|
57 |
void UpdateToolbar(); |
|
58 |
||
59 |
||
60 |
||
61 |
/** |
|
62 |
* Enables toolbar |
|
63 |
*/ |
|
64 |
void ShowToolbar(); |
|
65 |
||
66 |
/** |
|
67 |
* Disables toolbar |
|
68 |
*/ |
|
69 |
void HideToolbar(); |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
70 |
|
62 | 71 |
void SetMuteFlag( TPhoneCommandParam* aCommandParam ); |
72 |
||
73 |
void SetIhfFlag( TPhoneCommandParam* aCommandParam ); |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
74 |
|
62 | 75 |
void SetWiredAccFlag( TPhoneCommandParam* aCommandParam ); |
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
76 |
|
62 | 77 |
void SetCallInProgressFlag( TPhoneCommandParam* aCommandParam ); |
78 |
||
79 |
/** |
|
80 |
* Dims (greys out) or undims all toolbar items. |
|
81 |
* |
|
82 |
* @param aDimmed Use ETrue to dim this toolbar item or EFalse to |
|
83 |
* un-dim this toolbar item. |
|
84 |
*/ |
|
85 |
void DimToolbar( const TBool aDimmed ); |
|
86 |
||
87 |
/** |
|
88 |
* Dims (greys out) or undims a toolbar item. |
|
89 |
* |
|
90 |
* @param aCommandId The command (as defined in an .hrh file) |
|
91 |
* associated with this toolbar item. This identifies the toolbar |
|
92 |
* item, whose text is to be dimmed or un-dimmed. |
|
93 |
* @param aDimmed Use ETrue to dim this toolbar item or EFalse to |
|
94 |
* un-dim this toolbar item. |
|
95 |
*/ |
|
96 |
void SetToolbarButtonDimmed( const TInt aCommandId, |
|
97 |
const TBool aDimmed ); |
|
98 |
||
99 |
public: // from MAknToolbarObserver |
|
100 |
/** |
|
101 |
* From base class MAknToolbarObserver |
|
102 |
* Handles toolbar events for a certain toolbar item. |
|
103 |
* |
|
104 |
* @param aCommand The command ID of some toolbar item. |
|
105 |
*/ |
|
106 |
void OfferToolbarEventL( TInt aCommand ); |
|
107 |
||
108 |
/** |
|
109 |
* From base class MAknToolbarObserver |
|
110 |
* Should be used to set the properties of some toolbar components |
|
111 |
* before it is drawn. |
|
112 |
* |
|
113 |
* @param aResourceId The resource ID for particular toolbar |
|
114 |
* @param aToolbar The toolbar object pointer |
|
115 |
*/ |
|
116 |
void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); |
|
117 |
||
118 |
protected: |
|
119 |
/** |
|
120 |
* Constructor. |
|
121 |
* |
|
122 |
* @param aCoeEnv |
|
123 |
*/ |
|
124 |
CPhoneToolbarController( CCoeEnv& aCoeEnv ); |
|
125 |
||
126 |
private: |
|
127 |
||
128 |
/** |
|
129 |
* Creates CAknButton with given parameters and leaves it to |
|
130 |
* CleanupStack. |
|
131 |
* |
|
132 |
* @param aNormalIconId |
|
133 |
* @param aNormalMaskId |
|
134 |
* @param aTooltipText |
|
135 |
* @param aSkinIconId |
|
136 |
* @param aCommand |
|
137 |
*/ |
|
138 |
CAknButton* CreateButtonLC( TInt aNormalIconId, |
|
139 |
TInt aNormalMaskId, |
|
140 |
const TDesC& aTooltipText, |
|
141 |
const TAknsItemID& aSkinIconId, |
|
142 |
TInt aCommand ); |
|
143 |
||
144 |
||
145 |
/** |
|
146 |
* Symbian 2nd phase constructor. |
|
147 |
* |
|
148 |
*/ |
|
149 |
void ConstructL(); |
|
150 |
||
151 |
/** |
|
152 |
* Searches the tooltip text for the button using the |
|
153 |
* the given command id. |
|
154 |
* |
|
155 |
* @param aCommandId the command id |
|
156 |
* @param aText the searched tooltip text |
|
157 |
*/ |
|
158 |
void GetTooltipTextL( TInt aCommandId, HBufC*& aText ); |
|
159 |
||
160 |
TAknsItemID GetSkinIdL( TInt aCommandId ); |
|
161 |
||
162 |
||
163 |
private: // data |
|
164 |
/** |
|
165 |
* AknToolbar. |
|
166 |
* Not own. |
|
167 |
*/ |
|
168 |
CAknToolbar* iToolbar; |
|
169 |
||
170 |
/** |
|
171 |
* CoeEnv |
|
172 |
*/ |
|
173 |
CCoeEnv& iCoeEnv; |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
174 |
|
62 | 175 |
TBool iMuteFlag; |
176 |
||
177 |
TBool iIhfFlag; |
|
178 |
||
179 |
TBool iWiredAccFlag; |
|
180 |
||
181 |
TBool iCallInProgress; |
|
182 |
||
183 |
// Dim activate IHF button |
|
184 |
TBool iDimActivateIhf; |
|
185 |
||
186 |
}; |
|
187 |
||
188 |
#endif // CPHONETOOLBARCONTROLLER_H |