williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: File contains the concrete touch pane class.
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
#ifndef AKNTOUCHPANE_H
|
williamr@2
|
21 |
#define AKNTOUCHPANE_H
|
williamr@2
|
22 |
|
williamr@2
|
23 |
#include <coecntrl.h>
|
williamr@2
|
24 |
#include <babitflags.h>
|
williamr@4
|
25 |
#include <AknWsEventObserver.h>
|
williamr@2
|
26 |
|
williamr@2
|
27 |
class CAknAppUi;
|
williamr@2
|
28 |
class CAknButton;
|
williamr@2
|
29 |
class MAknTouchPaneObserver;
|
williamr@2
|
30 |
class CAknsBasicBackgroundControlContext;
|
williamr@2
|
31 |
class CAknsFrameBackgroundControlContext;
|
williamr@2
|
32 |
class MAknFepPenSupportInterface;
|
williamr@2
|
33 |
class TAknTouchPaneItem;
|
williamr@2
|
34 |
|
williamr@2
|
35 |
// have been deprecated
|
williamr@2
|
36 |
|
williamr@2
|
37 |
/**
|
williamr@2
|
38 |
* CAknTouchPane.
|
williamr@2
|
39 |
*
|
williamr@2
|
40 |
* @lib eikcoctl.lib
|
williamr@2
|
41 |
* @since S60 5.0
|
williamr@2
|
42 |
*/
|
williamr@2
|
43 |
NONSHARABLE_CLASS( CAknTouchPane ) : public CCoeControl,
|
williamr@2
|
44 |
public MCoeControlObserver,
|
williamr@2
|
45 |
public MCoeControlBackground,
|
williamr@2
|
46 |
public MAknWsEventObserver
|
williamr@2
|
47 |
{
|
williamr@2
|
48 |
|
williamr@2
|
49 |
public:
|
williamr@2
|
50 |
|
williamr@2
|
51 |
/** Touch pane visibility mode. */
|
williamr@2
|
52 |
enum TVisibilityMode
|
williamr@2
|
53 |
{
|
williamr@2
|
54 |
/** The visiblity is automatically updated whenever the visibility
|
williamr@2
|
55 |
or resource ID of status pane is changed. The touch pane is set
|
williamr@2
|
56 |
visible only when compatible status pane is visible. */
|
williamr@2
|
57 |
EAutomaticVisibilityChanges = 1,
|
williamr@2
|
58 |
/** The visibility is not automatically changed, and user can set
|
williamr@2
|
59 |
the visibility with @c MakeVisible() method. */
|
williamr@2
|
60 |
EManualVisibilityChanges = 2
|
williamr@2
|
61 |
};
|
williamr@2
|
62 |
|
williamr@2
|
63 |
/**
|
williamr@2
|
64 |
* Two-phased constructor.
|
williamr@2
|
65 |
*/
|
williamr@2
|
66 |
IMPORT_C static CAknTouchPane* NewL();
|
williamr@2
|
67 |
|
williamr@2
|
68 |
/**
|
williamr@2
|
69 |
* Two-phased constructor. Construct the touch pane from the specified
|
williamr@2
|
70 |
* resource.
|
williamr@2
|
71 |
* @param aResourceId Resource ID specifying the resource.
|
williamr@2
|
72 |
*/
|
williamr@2
|
73 |
IMPORT_C static CAknTouchPane* NewL( TInt aResourceId );
|
williamr@2
|
74 |
|
williamr@2
|
75 |
/**
|
williamr@2
|
76 |
* Destructor.
|
williamr@2
|
77 |
*/
|
williamr@2
|
78 |
~CAknTouchPane();
|
williamr@2
|
79 |
|
williamr@2
|
80 |
/**
|
williamr@2
|
81 |
* Reduces the given rectangle from the side that overlaps with
|
williamr@2
|
82 |
* touch pane.
|
williamr@2
|
83 |
* @param aBoundingRect Rectangle to be modified.
|
williamr@2
|
84 |
*/
|
williamr@2
|
85 |
IMPORT_C void ReduceRect( TRect& aBoundingRect ) const;
|
williamr@2
|
86 |
|
williamr@2
|
87 |
/**
|
williamr@2
|
88 |
* Sets the touch pane's observer.
|
williamr@2
|
89 |
* @param aObserver Observer.
|
williamr@2
|
90 |
*/
|
williamr@2
|
91 |
IMPORT_C void SetObserver( MAknTouchPaneObserver* aObserver );
|
williamr@2
|
92 |
|
williamr@2
|
93 |
/**
|
williamr@2
|
94 |
* Sets the visibility mode. By default, the automatic visibility changes
|
williamr@2
|
95 |
* are enabled, which means that the touch pane visibility is updated
|
williamr@2
|
96 |
* whenever the visibility or resource ID of status pane is changed.
|
williamr@2
|
97 |
* @param aMode Visibility mode.
|
williamr@2
|
98 |
*/
|
williamr@2
|
99 |
IMPORT_C void SetVisibilityMode( TVisibilityMode aMode );
|
williamr@2
|
100 |
|
williamr@2
|
101 |
/**
|
williamr@2
|
102 |
* Allows input method activation. This method is called by the FEP to
|
williamr@2
|
103 |
* set the input method icon dimmed, when input method activation is
|
williamr@2
|
104 |
* not allowed, and to not dimmed, when input method activation is
|
williamr@2
|
105 |
* allowed.
|
williamr@2
|
106 |
* @param aValue ETrue to allow input method activation, EFalse to
|
williamr@2
|
107 |
* disallow it.
|
williamr@2
|
108 |
*/
|
williamr@2
|
109 |
IMPORT_C void AllowInputMethodActivation( TBool aValue );
|
williamr@2
|
110 |
|
williamr@2
|
111 |
/**
|
williamr@2
|
112 |
* Changes the state of the input method icon. This method is called by
|
williamr@2
|
113 |
* the FEP, when the touch input window is opened or closed.
|
williamr@2
|
114 |
* @param aActivated ETrue to change the state of the icon to activated
|
williamr@2
|
115 |
* (pressed down), EFalse to change it back to normal state.
|
williamr@2
|
116 |
*/
|
williamr@2
|
117 |
IMPORT_C void SetInputMethodIconActivated( TBool aActivated );
|
williamr@2
|
118 |
|
williamr@2
|
119 |
/**
|
williamr@2
|
120 |
* Refreshes touch pane icons. This method is called by the framework,
|
williamr@2
|
121 |
* whenever application gains foreground or new application view is
|
williamr@2
|
122 |
* activated. Applications should call this, when touch pane has to
|
williamr@2
|
123 |
* change the state of some of its icons, for example, when the help
|
williamr@2
|
124 |
* context of application changes so that the dimming of help icon
|
williamr@2
|
125 |
* has to be switched.
|
williamr@2
|
126 |
*/
|
williamr@2
|
127 |
IMPORT_C void RefreshL();
|
williamr@2
|
128 |
|
williamr@2
|
129 |
/**
|
williamr@2
|
130 |
* Sets the interface, which is used by the touch pane to activate
|
williamr@2
|
131 |
* and to deactivate input method window. Recurring calls will replace
|
williamr@2
|
132 |
* the previously used interface with the new one. The ownership of
|
williamr@2
|
133 |
* the interface is not transferred.
|
williamr@2
|
134 |
* @param aFepPenSupportInterface Interface to FEP, which can be used
|
williamr@2
|
135 |
* to activate and deactivate input method window.
|
williamr@2
|
136 |
*/
|
williamr@2
|
137 |
IMPORT_C void SetFepPenSupportInterface(
|
williamr@2
|
138 |
MAknFepPenSupportInterface* aFepPenSupportInterface );
|
williamr@2
|
139 |
|
williamr@2
|
140 |
/**
|
williamr@2
|
141 |
* Handles status pane size change.
|
williamr@2
|
142 |
* This method is called from status pane whenever it changes its size
|
williamr@2
|
143 |
* as a result of resource change or visibility change.
|
williamr@2
|
144 |
*/
|
williamr@2
|
145 |
void HandleStatusPaneSizeChange( TInt aInitialResourceId,
|
williamr@2
|
146 |
TInt aLastRequestedResourceId );
|
williamr@2
|
147 |
|
williamr@2
|
148 |
// from base classes
|
williamr@2
|
149 |
|
williamr@2
|
150 |
/**
|
williamr@2
|
151 |
* From CCoeControl. Returns number of controls inside the control.
|
williamr@2
|
152 |
* @return Number of component controls.
|
williamr@2
|
153 |
*/
|
williamr@2
|
154 |
IMPORT_C TInt CountComponentControls() const;
|
williamr@2
|
155 |
|
williamr@2
|
156 |
/**
|
williamr@2
|
157 |
* From CCoeControl. Returns a control determined by control index.
|
williamr@2
|
158 |
* @param anIndex Index of a control to be returned.
|
williamr@2
|
159 |
* @return Pointer to control.
|
williamr@2
|
160 |
*/
|
williamr@2
|
161 |
IMPORT_C CCoeControl* ComponentControl( TInt aIndex ) const;
|
williamr@2
|
162 |
|
williamr@2
|
163 |
/**
|
williamr@2
|
164 |
* From MCoeControlBackground. Draw the background for a given control.
|
williamr@2
|
165 |
* The method is intented to be called by the component controls fo touch
|
williamr@2
|
166 |
* pane to draw their backgrounds.
|
williamr@2
|
167 |
* @param aGc Graphics context used for drawing.
|
williamr@2
|
168 |
* @param aControl The control being drawn.
|
williamr@2
|
169 |
* @param aRect The area to be redrawn.
|
williamr@2
|
170 |
*/
|
williamr@2
|
171 |
IMPORT_C void Draw( CWindowGc& aGc, const CCoeControl& aControl,
|
williamr@2
|
172 |
const TRect& aRect ) const;
|
williamr@2
|
173 |
|
williamr@2
|
174 |
/**
|
williamr@2
|
175 |
* From MCoeControlObserver. Handles an event from an observed control.
|
williamr@2
|
176 |
* @param aControl The control that sent the event.
|
williamr@2
|
177 |
* @param aEventType The event type.
|
williamr@2
|
178 |
*/
|
williamr@2
|
179 |
IMPORT_C void HandleControlEventL( CCoeControl *aControl,
|
williamr@2
|
180 |
TCoeEvent aEventType );
|
williamr@2
|
181 |
|
williamr@2
|
182 |
/**
|
williamr@2
|
183 |
* From CCoeControl. Handles a change to the control's resources.
|
williamr@2
|
184 |
* @param aType A message UID value.
|
williamr@2
|
185 |
*/
|
williamr@2
|
186 |
IMPORT_C void HandleResourceChange( TInt aType );
|
williamr@2
|
187 |
|
williamr@2
|
188 |
/**
|
williamr@2
|
189 |
* From CCoeControl. Sets the control visible or invisible.
|
williamr@2
|
190 |
* @param aVisible ETrue to make the control visible, EFalse to
|
williamr@2
|
191 |
* to make control invisible.
|
williamr@2
|
192 |
*/
|
williamr@2
|
193 |
IMPORT_C void MakeVisible( TBool aVisible );
|
williamr@2
|
194 |
|
williamr@2
|
195 |
/**
|
williamr@2
|
196 |
* From CCoeControl. Handles key events.
|
williamr@2
|
197 |
* @param aKeyEvent The key event.
|
williamr@2
|
198 |
* @param aType The type of key event.
|
williamr@2
|
199 |
* @return Indicates whether or not the key event was used by this
|
williamr@2
|
200 |
* control.
|
williamr@2
|
201 |
*/
|
williamr@2
|
202 |
IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
|
williamr@2
|
203 |
TEventCode aType );
|
williamr@2
|
204 |
|
williamr@2
|
205 |
/**
|
williamr@2
|
206 |
* From MAknWsEventObserver. Handles window server events.
|
williamr@2
|
207 |
*/
|
williamr@2
|
208 |
void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination );
|
williamr@2
|
209 |
|
williamr@2
|
210 |
protected:
|
williamr@2
|
211 |
|
williamr@2
|
212 |
// from base classes
|
williamr@2
|
213 |
|
williamr@2
|
214 |
/**
|
williamr@2
|
215 |
* From CCoeControl. Handles pointer events.
|
williamr@2
|
216 |
*/
|
williamr@2
|
217 |
IMPORT_C void HandlePointerEventL( const TPointerEvent &aPointerEvent );
|
williamr@2
|
218 |
|
williamr@2
|
219 |
/**
|
williamr@2
|
220 |
* From CCoeControl. Responds to changes in the position of a control.
|
williamr@2
|
221 |
*/
|
williamr@2
|
222 |
IMPORT_C void PositionChanged();
|
williamr@2
|
223 |
|
williamr@2
|
224 |
/**
|
williamr@2
|
225 |
* From CCoeControl. Sets the size and position of the components.
|
williamr@2
|
226 |
*/
|
williamr@2
|
227 |
IMPORT_C void SizeChanged();
|
williamr@2
|
228 |
|
williamr@2
|
229 |
private:
|
williamr@2
|
230 |
|
williamr@2
|
231 |
/**
|
williamr@2
|
232 |
* C++ default constructor.
|
williamr@2
|
233 |
*/
|
williamr@2
|
234 |
CAknTouchPane();
|
williamr@2
|
235 |
|
williamr@2
|
236 |
/**
|
williamr@2
|
237 |
* Symbian 2nd phase constructor.
|
williamr@2
|
238 |
*/
|
williamr@2
|
239 |
void ConstructL( RArray<TAknTouchPaneItem>& aItems );
|
williamr@2
|
240 |
|
williamr@2
|
241 |
// Activates application shell.
|
williamr@2
|
242 |
void ActivateApplicationShellL();
|
williamr@2
|
243 |
// Activates application swapper.
|
williamr@2
|
244 |
void ActivateFastSwapL() const;
|
williamr@2
|
245 |
// Activated idle view.
|
williamr@2
|
246 |
void ActivateIdleViewL() const;
|
williamr@2
|
247 |
// Rotates the screen.
|
williamr@2
|
248 |
void RotateScreenL() const;
|
williamr@2
|
249 |
// Activates/deactivates stylus input.
|
williamr@2
|
250 |
void ActivateStylusInputL( TBool aActivate ) const;
|
williamr@2
|
251 |
// Activates/deactivates popup toolbar.
|
williamr@2
|
252 |
void ActivateToolbarL( TBool aActivate ) const;
|
williamr@2
|
253 |
// Activates/deactivate help.
|
williamr@2
|
254 |
void ActivateHelpL( TBool aActivate );
|
williamr@2
|
255 |
// Activates/deactivates dialler.
|
williamr@2
|
256 |
void ActivateDiallerL( TBool aActivate );
|
williamr@2
|
257 |
// Activates/deactivates contacts.
|
williamr@2
|
258 |
void ActivateContactsL( TBool aActivate );
|
williamr@2
|
259 |
|
williamr@2
|
260 |
// Creates the specified touch pane component.
|
williamr@2
|
261 |
CAknButton* ConstructDefaultComponentL( TInt aId );
|
williamr@2
|
262 |
// Notifies the observer of a change in touch pane's size or position.
|
williamr@2
|
263 |
void ReportSizeChange() const;
|
williamr@2
|
264 |
// Sets the required properties for control to be touch pane's component.
|
williamr@2
|
265 |
void SetDefaultPropertiesL( CCoeControl* aControl );
|
williamr@2
|
266 |
// Sets the size and position of touch pane's window from layout data.
|
williamr@2
|
267 |
void SetWindowLayout();
|
williamr@2
|
268 |
// Registers the positions of component controls.
|
williamr@2
|
269 |
void RegisterControlPositions() const;
|
williamr@2
|
270 |
// Removes the registered positions of component controls.
|
williamr@2
|
271 |
void DeregisterControlPositions() const;
|
williamr@2
|
272 |
// Updates buttons.
|
williamr@2
|
273 |
void DoRefresh();
|
williamr@2
|
274 |
|
williamr@2
|
275 |
// from base classes
|
williamr@2
|
276 |
|
williamr@2
|
277 |
/**
|
williamr@2
|
278 |
* From CCoeControl. Draws the control.
|
williamr@2
|
279 |
*/
|
williamr@2
|
280 |
void Draw( const TRect& aRect ) const;
|
williamr@2
|
281 |
|
williamr@2
|
282 |
private: // Data
|
williamr@2
|
283 |
|
williamr@2
|
284 |
CAknAppUi* iAppUi; // not owned
|
williamr@2
|
285 |
|
williamr@2
|
286 |
// Component controls
|
williamr@2
|
287 |
CAknButton* iShellIcon;
|
williamr@2
|
288 |
CAknButton* iSwapperIcon;
|
williamr@2
|
289 |
CAknButton* iIdleViewIcon;
|
williamr@2
|
290 |
CAknButton* iDiallerIcon;
|
williamr@2
|
291 |
CAknButton* iRotateIcon;
|
williamr@2
|
292 |
CAknButton* iHelpIcon;
|
williamr@2
|
293 |
CAknButton* iInputMethodIcon;
|
williamr@2
|
294 |
CAknButton* iToolbarIcon;
|
williamr@2
|
295 |
CAknButton* iContactsIcon;
|
williamr@2
|
296 |
|
williamr@2
|
297 |
// Touch pane's observer
|
williamr@2
|
298 |
MAknTouchPaneObserver* iObserver; // not owned
|
williamr@2
|
299 |
|
williamr@2
|
300 |
// Background control context
|
williamr@2
|
301 |
CAknsBasicBackgroundControlContext* iBgContext;
|
williamr@2
|
302 |
|
williamr@2
|
303 |
// Frame control context
|
williamr@2
|
304 |
CAknsFrameBackgroundControlContext* iFrameContext;
|
williamr@2
|
305 |
|
williamr@2
|
306 |
// Interface for activating/deactivating input method
|
williamr@2
|
307 |
MAknFepPenSupportInterface* iFepPenSupportInterface; // not owned
|
williamr@2
|
308 |
|
williamr@2
|
309 |
// UID of the application owning the touch pane
|
williamr@2
|
310 |
TUid iUid;
|
williamr@2
|
311 |
|
williamr@2
|
312 |
// Flags
|
williamr@2
|
313 |
TBitFlags32 iFlags;
|
williamr@2
|
314 |
|
williamr@2
|
315 |
};
|
williamr@2
|
316 |
|
williamr@2
|
317 |
#endif // AKNTOUCHPANE_H
|
williamr@2
|
318 |
|
williamr@2
|
319 |
// End of File
|