1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/akntouchpane.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,319 @@
1.4 +/*
1.5 +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: File contains the concrete touch pane class.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +#ifndef AKNTOUCHPANE_H
1.24 +#define AKNTOUCHPANE_H
1.25 +
1.26 +#include <coecntrl.h>
1.27 +#include <babitflags.h>
1.28 +#include <aknwseventobserver.h>
1.29 +
1.30 +class CAknAppUi;
1.31 +class CAknButton;
1.32 +class MAknTouchPaneObserver;
1.33 +class CAknsBasicBackgroundControlContext;
1.34 +class CAknsFrameBackgroundControlContext;
1.35 +class MAknFepPenSupportInterface;
1.36 +class TAknTouchPaneItem;
1.37 +
1.38 +// have been deprecated
1.39 +
1.40 +/**
1.41 +* CAknTouchPane.
1.42 +*
1.43 +* @lib eikcoctl.lib
1.44 +* @since S60 5.0
1.45 +*/
1.46 +NONSHARABLE_CLASS( CAknTouchPane ) : public CCoeControl,
1.47 + public MCoeControlObserver,
1.48 + public MCoeControlBackground,
1.49 + public MAknWsEventObserver
1.50 + {
1.51 +
1.52 +public:
1.53 +
1.54 + /** Touch pane visibility mode. */
1.55 + enum TVisibilityMode
1.56 + {
1.57 + /** The visiblity is automatically updated whenever the visibility
1.58 + or resource ID of status pane is changed. The touch pane is set
1.59 + visible only when compatible status pane is visible. */
1.60 + EAutomaticVisibilityChanges = 1,
1.61 + /** The visibility is not automatically changed, and user can set
1.62 + the visibility with @c MakeVisible() method. */
1.63 + EManualVisibilityChanges = 2
1.64 + };
1.65 +
1.66 + /**
1.67 + * Two-phased constructor.
1.68 + */
1.69 + IMPORT_C static CAknTouchPane* NewL();
1.70 +
1.71 + /**
1.72 + * Two-phased constructor. Construct the touch pane from the specified
1.73 + * resource.
1.74 + * @param aResourceId Resource ID specifying the resource.
1.75 + */
1.76 + IMPORT_C static CAknTouchPane* NewL( TInt aResourceId );
1.77 +
1.78 + /**
1.79 + * Destructor.
1.80 + */
1.81 + ~CAknTouchPane();
1.82 +
1.83 + /**
1.84 + * Reduces the given rectangle from the side that overlaps with
1.85 + * touch pane.
1.86 + * @param aBoundingRect Rectangle to be modified.
1.87 + */
1.88 + IMPORT_C void ReduceRect( TRect& aBoundingRect ) const;
1.89 +
1.90 + /**
1.91 + * Sets the touch pane's observer.
1.92 + * @param aObserver Observer.
1.93 + */
1.94 + IMPORT_C void SetObserver( MAknTouchPaneObserver* aObserver );
1.95 +
1.96 + /**
1.97 + * Sets the visibility mode. By default, the automatic visibility changes
1.98 + * are enabled, which means that the touch pane visibility is updated
1.99 + * whenever the visibility or resource ID of status pane is changed.
1.100 + * @param aMode Visibility mode.
1.101 + */
1.102 + IMPORT_C void SetVisibilityMode( TVisibilityMode aMode );
1.103 +
1.104 + /**
1.105 + * Allows input method activation. This method is called by the FEP to
1.106 + * set the input method icon dimmed, when input method activation is
1.107 + * not allowed, and to not dimmed, when input method activation is
1.108 + * allowed.
1.109 + * @param aValue ETrue to allow input method activation, EFalse to
1.110 + * disallow it.
1.111 + */
1.112 + IMPORT_C void AllowInputMethodActivation( TBool aValue );
1.113 +
1.114 + /**
1.115 + * Changes the state of the input method icon. This method is called by
1.116 + * the FEP, when the touch input window is opened or closed.
1.117 + * @param aActivated ETrue to change the state of the icon to activated
1.118 + * (pressed down), EFalse to change it back to normal state.
1.119 + */
1.120 + IMPORT_C void SetInputMethodIconActivated( TBool aActivated );
1.121 +
1.122 + /**
1.123 + * Refreshes touch pane icons. This method is called by the framework,
1.124 + * whenever application gains foreground or new application view is
1.125 + * activated. Applications should call this, when touch pane has to
1.126 + * change the state of some of its icons, for example, when the help
1.127 + * context of application changes so that the dimming of help icon
1.128 + * has to be switched.
1.129 + */
1.130 + IMPORT_C void RefreshL();
1.131 +
1.132 + /**
1.133 + * Sets the interface, which is used by the touch pane to activate
1.134 + * and to deactivate input method window. Recurring calls will replace
1.135 + * the previously used interface with the new one. The ownership of
1.136 + * the interface is not transferred.
1.137 + * @param aFepPenSupportInterface Interface to FEP, which can be used
1.138 + * to activate and deactivate input method window.
1.139 + */
1.140 + IMPORT_C void SetFepPenSupportInterface(
1.141 + MAknFepPenSupportInterface* aFepPenSupportInterface );
1.142 +
1.143 + /**
1.144 + * Handles status pane size change.
1.145 + * This method is called from status pane whenever it changes its size
1.146 + * as a result of resource change or visibility change.
1.147 + */
1.148 + void HandleStatusPaneSizeChange( TInt aInitialResourceId,
1.149 + TInt aLastRequestedResourceId );
1.150 +
1.151 +// from base classes
1.152 +
1.153 + /**
1.154 + * From CCoeControl. Returns number of controls inside the control.
1.155 + * @return Number of component controls.
1.156 + */
1.157 + IMPORT_C TInt CountComponentControls() const;
1.158 +
1.159 + /**
1.160 + * From CCoeControl. Returns a control determined by control index.
1.161 + * @param anIndex Index of a control to be returned.
1.162 + * @return Pointer to control.
1.163 + */
1.164 + IMPORT_C CCoeControl* ComponentControl( TInt aIndex ) const;
1.165 +
1.166 + /**
1.167 + * From MCoeControlBackground. Draw the background for a given control.
1.168 + * The method is intented to be called by the component controls fo touch
1.169 + * pane to draw their backgrounds.
1.170 + * @param aGc Graphics context used for drawing.
1.171 + * @param aControl The control being drawn.
1.172 + * @param aRect The area to be redrawn.
1.173 + */
1.174 + IMPORT_C void Draw( CWindowGc& aGc, const CCoeControl& aControl,
1.175 + const TRect& aRect ) const;
1.176 +
1.177 + /**
1.178 + * From MCoeControlObserver. Handles an event from an observed control.
1.179 + * @param aControl The control that sent the event.
1.180 + * @param aEventType The event type.
1.181 + */
1.182 + IMPORT_C void HandleControlEventL( CCoeControl *aControl,
1.183 + TCoeEvent aEventType );
1.184 +
1.185 + /**
1.186 + * From CCoeControl. Handles a change to the control's resources.
1.187 + * @param aType A message UID value.
1.188 + */
1.189 + IMPORT_C void HandleResourceChange( TInt aType );
1.190 +
1.191 + /**
1.192 + * From CCoeControl. Sets the control visible or invisible.
1.193 + * @param aVisible ETrue to make the control visible, EFalse to
1.194 + * to make control invisible.
1.195 + */
1.196 + IMPORT_C void MakeVisible( TBool aVisible );
1.197 +
1.198 + /**
1.199 + * From CCoeControl. Handles key events.
1.200 + * @param aKeyEvent The key event.
1.201 + * @param aType The type of key event.
1.202 + * @return Indicates whether or not the key event was used by this
1.203 + * control.
1.204 + */
1.205 + IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
1.206 + TEventCode aType );
1.207 +
1.208 + /**
1.209 + * From MAknWsEventObserver. Handles window server events.
1.210 + */
1.211 + void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination );
1.212 +
1.213 +protected:
1.214 +
1.215 +// from base classes
1.216 +
1.217 + /**
1.218 + * From CCoeControl. Handles pointer events.
1.219 + */
1.220 + IMPORT_C void HandlePointerEventL( const TPointerEvent &aPointerEvent );
1.221 +
1.222 + /**
1.223 + * From CCoeControl. Responds to changes in the position of a control.
1.224 + */
1.225 + IMPORT_C void PositionChanged();
1.226 +
1.227 + /**
1.228 + * From CCoeControl. Sets the size and position of the components.
1.229 + */
1.230 + IMPORT_C void SizeChanged();
1.231 +
1.232 +private:
1.233 +
1.234 + /**
1.235 + * C++ default constructor.
1.236 + */
1.237 + CAknTouchPane();
1.238 +
1.239 + /**
1.240 + * Symbian 2nd phase constructor.
1.241 + */
1.242 + void ConstructL( RArray<TAknTouchPaneItem>& aItems );
1.243 +
1.244 + // Activates application shell.
1.245 + void ActivateApplicationShellL();
1.246 + // Activates application swapper.
1.247 + void ActivateFastSwapL() const;
1.248 + // Activated idle view.
1.249 + void ActivateIdleViewL() const;
1.250 + // Rotates the screen.
1.251 + void RotateScreenL() const;
1.252 + // Activates/deactivates stylus input.
1.253 + void ActivateStylusInputL( TBool aActivate ) const;
1.254 + // Activates/deactivates popup toolbar.
1.255 + void ActivateToolbarL( TBool aActivate ) const;
1.256 + // Activates/deactivate help.
1.257 + void ActivateHelpL( TBool aActivate );
1.258 + // Activates/deactivates dialler.
1.259 + void ActivateDiallerL( TBool aActivate );
1.260 + // Activates/deactivates contacts.
1.261 + void ActivateContactsL( TBool aActivate );
1.262 +
1.263 + // Creates the specified touch pane component.
1.264 + CAknButton* ConstructDefaultComponentL( TInt aId );
1.265 + // Notifies the observer of a change in touch pane's size or position.
1.266 + void ReportSizeChange() const;
1.267 + // Sets the required properties for control to be touch pane's component.
1.268 + void SetDefaultPropertiesL( CCoeControl* aControl );
1.269 + // Sets the size and position of touch pane's window from layout data.
1.270 + void SetWindowLayout();
1.271 + // Registers the positions of component controls.
1.272 + void RegisterControlPositions() const;
1.273 + // Removes the registered positions of component controls.
1.274 + void DeregisterControlPositions() const;
1.275 + // Updates buttons.
1.276 + void DoRefresh();
1.277 +
1.278 +// from base classes
1.279 +
1.280 + /**
1.281 + * From CCoeControl. Draws the control.
1.282 + */
1.283 + void Draw( const TRect& aRect ) const;
1.284 +
1.285 +private: // Data
1.286 +
1.287 + CAknAppUi* iAppUi; // not owned
1.288 +
1.289 + // Component controls
1.290 + CAknButton* iShellIcon;
1.291 + CAknButton* iSwapperIcon;
1.292 + CAknButton* iIdleViewIcon;
1.293 + CAknButton* iDiallerIcon;
1.294 + CAknButton* iRotateIcon;
1.295 + CAknButton* iHelpIcon;
1.296 + CAknButton* iInputMethodIcon;
1.297 + CAknButton* iToolbarIcon;
1.298 + CAknButton* iContactsIcon;
1.299 +
1.300 + // Touch pane's observer
1.301 + MAknTouchPaneObserver* iObserver; // not owned
1.302 +
1.303 + // Background control context
1.304 + CAknsBasicBackgroundControlContext* iBgContext;
1.305 +
1.306 + // Frame control context
1.307 + CAknsFrameBackgroundControlContext* iFrameContext;
1.308 +
1.309 + // Interface for activating/deactivating input method
1.310 + MAknFepPenSupportInterface* iFepPenSupportInterface; // not owned
1.311 +
1.312 + // UID of the application owning the touch pane
1.313 + TUid iUid;
1.314 +
1.315 + // Flags
1.316 + TBitFlags32 iFlags;
1.317 +
1.318 + };
1.319 +
1.320 +#endif // AKNTOUCHPANE_H
1.321 +
1.322 +// End of File