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: Container control for touch controls.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef C_BUBBLECTOUCHPANE_H
|
|
20 |
#define C_BUBBLECTOUCHPANE_H
|
|
21 |
|
|
22 |
#include <coecntrl.h>
|
|
23 |
#include "BMTouchPaneInterface.h"
|
|
24 |
|
|
25 |
class CBubbleTouchPaneButton;
|
|
26 |
class CAknButton;
|
|
27 |
class TResourceReader;
|
|
28 |
|
|
29 |
/**
|
|
30 |
* Container control for touch buttons.
|
|
31 |
*
|
|
32 |
*
|
|
33 |
* @lib bubblemanager.lib
|
|
34 |
* @since S60 v5.0
|
|
35 |
*/
|
|
36 |
class CBubbleTouchPane : public CCoeControl,
|
|
37 |
public MBubbleTouchPaneInterface,
|
|
38 |
public MCoeControlObserver
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
|
|
42 |
/**
|
|
43 |
* Two phase constructor.
|
|
44 |
* @return New instance
|
|
45 |
*/
|
|
46 |
static CBubbleTouchPane* NewL();
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Destructor.
|
|
50 |
*/
|
|
51 |
virtual ~CBubbleTouchPane();
|
|
52 |
|
|
53 |
/**
|
|
54 |
* To be called when skin is changed and icons
|
|
55 |
* should be reloaded from skin server.
|
|
56 |
*/
|
|
57 |
void HandleResourceChange( TInt aType );
|
|
58 |
|
|
59 |
/**
|
|
60 |
* To be called when BubbleManager is within start and end
|
|
61 |
* changes block. TouchPane doesn't draw itself during
|
|
62 |
* update.
|
|
63 |
* @param aUpdating ETrue when ui update is in progress
|
|
64 |
* otherwise EFalse.
|
|
65 |
*/
|
|
66 |
void SetUpdating( TBool aUpdating );
|
|
67 |
|
|
68 |
protected: // From MBubbleTouchPaneInterface.
|
|
69 |
|
|
70 |
/**
|
|
71 |
* From MBubbleTouchPaneInterface.
|
|
72 |
*/
|
|
73 |
TInt SetButtonSet( TInt aResourceId );
|
|
74 |
|
|
75 |
/**
|
|
76 |
* From MBubbleTouchPaneInterface.
|
|
77 |
*/
|
|
78 |
void SetButtonState( TInt aCommand );
|
|
79 |
|
|
80 |
/**
|
|
81 |
* From MBubbleTouchPaneInterface.
|
|
82 |
*/
|
|
83 |
void SetButtonDimmed( TInt aCommand, TBool aDimmed );
|
|
84 |
|
|
85 |
/**
|
|
86 |
* From MBubbleTouchPaneInterface.
|
|
87 |
*/
|
|
88 |
TInt NumberOfButtonsInPane() const;
|
|
89 |
|
|
90 |
/**
|
|
91 |
* From MBubbleTouchPaneInterface.
|
|
92 |
*/
|
|
93 |
TInt ButtonCommandId( TInt aButtonIndex ) const;
|
|
94 |
|
|
95 |
/**
|
|
96 |
* From MBubbleTouchPaneInterface.
|
|
97 |
*/
|
|
98 |
TInt ReplaceButton( TInt aButtonIndex, TInt aResourceId );
|
|
99 |
|
|
100 |
/**
|
|
101 |
* From MBubbleTouchPaneInterface.
|
|
102 |
*/
|
|
103 |
TBool ButtonHasState( TInt aButtonIndex, TInt aCommand ) const;
|
|
104 |
|
|
105 |
/**
|
|
106 |
* From MBubbleTouchPaneInterface.
|
|
107 |
*/
|
|
108 |
void SetIconProvider(
|
|
109 |
MBubbleTouchPaneIconProvider* aIconProvider );
|
|
110 |
|
|
111 |
protected: // From CCoeControl
|
|
112 |
|
|
113 |
/**
|
|
114 |
* From CCoeControl.
|
|
115 |
*/
|
|
116 |
void SizeChanged();
|
|
117 |
|
|
118 |
/**
|
|
119 |
* From CCoeControl.
|
|
120 |
*/
|
|
121 |
TInt CountComponentControls() const;
|
|
122 |
|
|
123 |
/**
|
|
124 |
* From CCoeControl.
|
|
125 |
*/
|
|
126 |
CCoeControl* ComponentControl( TInt aIndex ) const;
|
|
127 |
|
|
128 |
/**
|
|
129 |
* From CCoeControl.
|
|
130 |
*/
|
|
131 |
void HandlePointerEventL( const TPointerEvent& aPointerEvent );
|
|
132 |
|
|
133 |
protected: // MCoeControlObserver
|
|
134 |
|
|
135 |
/**
|
|
136 |
* From MCoeControlObserver.
|
|
137 |
*/
|
|
138 |
void HandleControlEventL(CCoeControl *aControl, TCoeEvent aEventType);
|
|
139 |
|
|
140 |
private:
|
|
141 |
|
|
142 |
/**
|
|
143 |
* Handles callback.
|
|
144 |
*/
|
|
145 |
static TInt IdleCallback( TAny* aThis );
|
|
146 |
|
|
147 |
/**
|
|
148 |
* Resets and destroyes touch pane buttons.
|
|
149 |
*/
|
|
150 |
void DoDeleteButtonsInIdle();
|
|
151 |
|
|
152 |
/**
|
|
153 |
* Creates buttons.
|
|
154 |
*/
|
|
155 |
void LoadButtonsFromResourceL( TResourceReader& aReader );
|
|
156 |
|
|
157 |
/**
|
|
158 |
* Sets used button resource.
|
|
159 |
*/
|
|
160 |
void SetButtonSetL( TInt aResourceId );
|
|
161 |
|
|
162 |
/**
|
|
163 |
* Replaces button with other.
|
|
164 |
*/
|
|
165 |
void ReplaceButtonL( TInt aButtonIndex, TInt aResourceId );
|
|
166 |
|
|
167 |
/**
|
|
168 |
* Set used button layout.
|
|
169 |
* @param aButtonIndex Button index.
|
|
170 |
* @param aColumn Column index.
|
|
171 |
* @param aRow Row index.
|
|
172 |
*/
|
|
173 |
void SetButtonLayout( TInt aButtonIndex, TInt aColumn, TInt aRow );
|
|
174 |
|
|
175 |
private:
|
|
176 |
|
|
177 |
/**
|
|
178 |
* C++ default constructor.
|
|
179 |
*/
|
|
180 |
CBubbleTouchPane();
|
|
181 |
|
|
182 |
/**
|
|
183 |
* Symbian OS default constructor.
|
|
184 |
*/
|
|
185 |
void ConstructL();
|
|
186 |
|
|
187 |
|
|
188 |
private: // data
|
|
189 |
|
|
190 |
// Array of buttons.
|
|
191 |
RPointerArray<CBubbleTouchPaneButton> iButtons;
|
|
192 |
|
|
193 |
// Owned.
|
|
194 |
CIdle* iIdleProcessor;
|
|
195 |
|
|
196 |
// Async delete information.
|
|
197 |
TBool iDeleteButtonsAsync;
|
|
198 |
|
|
199 |
// Button set id.
|
|
200 |
TInt iCurrentButtonSetId;
|
|
201 |
|
|
202 |
// Array of buttons to be deleted.
|
|
203 |
RPointerArray<CBubbleTouchPaneButton> iButtonsToBeDeleted;
|
|
204 |
|
|
205 |
// Icon provider.
|
|
206 |
MBubbleTouchPaneIconProvider* iIconProvider;
|
|
207 |
|
|
208 |
// UI updating status flag.
|
|
209 |
TBool iUpdating;
|
|
210 |
};
|
|
211 |
|
|
212 |
#endif // C_BUBBLECTOUCHPANE_H
|