1.1 --- a/epoc32/include/mw/aknindicatorcontainer.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/aknindicatorcontainer.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,458 @@
1.4 -aknindicatorcontainer.h
1.5 +/*
1.6 +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: A default control in the status pane's small indicator pane.
1.19 +* Editor indicators uses also same control in the navigation
1.20 +* pane and in queries.
1.21 +*
1.22 +*/
1.23 +
1.24 +
1.25 +#ifndef AKNINDICATORCONTAINER_H
1.26 +#define AKNINDICATORCONTAINER_H
1.27 +
1.28 +// INCLUDES
1.29 +#include <akncontrol.h>
1.30 +#include <eikspane.h>
1.31 +
1.32 +class CIncallStatusBubble;
1.33 +class CAknIndicator;
1.34 +class CAknIndicatorContainerExtension;
1.35 +class CAknPictographInterface;
1.36 +class MAknIndicatorObserver;
1.37 +
1.38 +/**
1.39 + * The default control in the status pane's small indicator pane.
1.40 + * This container is also used for the status indicators in navi pane and
1.41 + * for editor indicators in queries.
1.42 + */
1.43 +class CAknIndicatorContainer : public CAknControl, public MEikStatusPaneObserver
1.44 + {
1.45 +friend class CAknIndicatorContainerExtension;
1.46 +friend class CAknIndicatorDataObserver;
1.47 +public:
1.48 +
1.49 + /**
1.50 + * Layout orientations of the indicator container.
1.51 + * These are used to specify how the indicators are laid
1.52 + * out inside the indicator container.
1.53 + */
1.54 + enum TLayoutOrientation
1.55 + {
1.56 + EVertical, ///< Indicators are arranged vertically.
1.57 + EHorizontal ///< Indicators are arranged horizontally.
1.58 + };
1.59 +
1.60 + /** Alignment of the indicators. */
1.61 + enum TIndicatorAlignment
1.62 + {
1.63 + ELeft, ///< Indicators are aligned on the left side.
1.64 + ERight ///< Indicators are aligned on the right side.
1.65 + };
1.66 +
1.67 + /**
1.68 + * Context of the indicator container.
1.69 + * These are used to specify what type of status indicators
1.70 + * the indicator container contains.
1.71 + */
1.72 + enum TIndicatorContext
1.73 + {
1.74 + EUniversalIndicators = 0, ///< Universal status indicators.
1.75 + ENaviPaneEditorIndicators, ///< Editor indicators shown in navi pane.
1.76 + EQueryEditorIndicators, ///< Editor indicators shown in queries.
1.77 + EFindIndicators ///< Search field indicators.
1.78 + };
1.79 +
1.80 + /**
1.81 + * Position of a indicator.
1.82 + * These are used for invidual indicators to coarsely specify
1.83 + * where they are positioned inside the indicator container.
1.84 + */
1.85 + enum TIndicatorPosition
1.86 + {
1.87 + ELeftSide, ///< Indicator positioned on the left side.
1.88 + ERightSide, ///< Indicator positioned on the right side.
1.89 + EMiddle ///< Indicator positioned in the middle.
1.90 + };
1.91 +
1.92 + /** Additional flags that can be used for custom indicators. */
1.93 + enum TCustomIndicatorFlags
1.94 + {
1.95 + EMultiColorIndicator = 0x1, ///< Indicator is multi-colored.
1.96 + EIndicatorPositionInverted = 0x2 ///< Indicator's position is inverted.
1.97 + };
1.98 +
1.99 + /** Layout modes of indicator container. */
1.100 + enum TLayoutMode
1.101 + {
1.102 + ELayoutModeUsual, ///< Used for universal indicators when not in idle.
1.103 + ELayoutModeWide ///< Used for navi pane indicators and universal indicators in idle.
1.104 + };
1.105 +
1.106 +public:
1.107 +
1.108 + /**
1.109 + * Default constructor.
1.110 + * Creates an @c EUniversalIndicators object.
1.111 + */
1.112 + IMPORT_C CAknIndicatorContainer();
1.113 +
1.114 + /**
1.115 + * Constructor. Creates @c EUniversalIndicators, @c ENaviPaneEditorIndicators
1.116 + * or @c EQueryEditorIndicators object.
1.117 + *
1.118 + * @param aIndicatorContext Indicator container context.
1.119 + */
1.120 + IMPORT_C CAknIndicatorContainer( TInt aIndicatorContext );
1.121 +
1.122 + /**
1.123 + * Destructor.
1.124 + */
1.125 + IMPORT_C ~CAknIndicatorContainer();
1.126 +
1.127 + /**
1.128 + * Second-phase constructor.
1.129 + */
1.130 + IMPORT_C void ConstructL();
1.131 +
1.132 + /**
1.133 + * Sets indicator state. The state can be one of the following:
1.134 + * - @c EAknIndicatorStateOff
1.135 + *
1.136 + * - @c EAknIndicatorStateOn
1.137 + *
1.138 + * - @c EAknIndicatorStateAnimate
1.139 + *
1.140 + * Editor indicators do not support animation.
1.141 + *
1.142 + * @param aIndicatorId ID of the indicator to be modified.
1.143 + * @param aState A state to be set to the indicator.
1.144 + * @param aDrawNow A flag to indicate if the indicator
1.145 + * is redrawn with this call.
1.146 + */
1.147 + IMPORT_C void SetIndicatorState( TUid aIndicatorId,
1.148 + TInt aState,
1.149 + TBool aDrawNow = ETrue );
1.150 +
1.151 + /**
1.152 + * Return the current state of an indicator.
1.153 + *
1.154 + * @param aIndicatorId ID of the indicator.
1.155 + * @return Current state of the indicator.
1.156 + */
1.157 + IMPORT_C TInt IndicatorState( TUid aIndicatorId );
1.158 +
1.159 + /**
1.160 + * Sets value to the message length indicator
1.161 + * (@c EAknNaviPaneEditorIndicatorMessageLength).
1.162 + *
1.163 + * @param aIndicatorId ID of the indicator to be modified.
1.164 + * @param aString Value of the indicator.
1.165 + */
1.166 + IMPORT_C void SetIndicatorValueL( TUid aIndicatorId, const TDesC& aString );
1.167 +
1.168 + /**
1.169 + * Sets value to the incall status bubble indicator on the
1.170 + * top of the status pane.
1.171 + *
1.172 + * @param aFlags Mode of the bubble.
1.173 + */
1.174 + IMPORT_C void SetIncallBubbleFlags( const TInt& aFlags );
1.175 +
1.176 + /**
1.177 + * Constructs the object from resource.
1.178 + *
1.179 + * @param aReader Resource reader.
1.180 + */
1.181 + IMPORT_C void ConstructFromResourceL( TResourceReader& aReader );
1.182 +
1.183 + /**
1.184 + * Returns the context of the indicator container.
1.185 + *
1.186 + * @return Context of the indicator container.
1.187 + */
1.188 + IMPORT_C TInt IndicatorContext() const;
1.189 +
1.190 +
1.191 +public: // From base class @c MEikStatusPaneObserver.
1.192 +
1.193 + /**
1.194 + * The @c MEikStatusPaneObserver interface allows a status pane observer
1.195 + * to pick up changes in the size or position of the status pane.
1.196 + * Such events will be as a result of layout changes which
1.197 + * cause an actual change in the status pane rectangle.
1.198 + */
1.199 + IMPORT_C void HandleStatusPaneSizeChange();
1.200 +
1.201 +public: // From base class @c CCoeControl.
1.202 +
1.203 + /**
1.204 + * Handles pointer events.
1.205 + *
1.206 + * @param aPointerEvent The pointer event.
1.207 + */
1.208 + IMPORT_C void HandlePointerEventL( const TPointerEvent& aPointerEvent );
1.209 +
1.210 +protected: // From base class @c CCoeControl.
1.211 +
1.212 + /**
1.213 + * Handles a change to the control's resources of type @c aType
1.214 + * which are shared across the environment, e.g. color scheme change.
1.215 + * Responds fade events and fades incall status bubble window group.
1.216 + *
1.217 + * @param aType Event type.
1.218 + */
1.219 + IMPORT_C virtual void HandleResourceChange( TInt aType );
1.220 +
1.221 + /**
1.222 + * Handles size change events.
1.223 + */
1.224 + IMPORT_C virtual void SizeChanged();
1.225 +
1.226 + /**
1.227 + * Handles position change events.
1.228 + */
1.229 + IMPORT_C virtual void PositionChanged();
1.230 +
1.231 + /**
1.232 + * Returns number of controls inside the context pane control.
1.233 + *
1.234 + * @return Amount of component controls.
1.235 + */
1.236 + IMPORT_C virtual TInt CountComponentControls() const;
1.237 +
1.238 + /**
1.239 + * Returns a control determined by control index.
1.240 + *
1.241 + * @param aIndex Index of a control to be returned.
1.242 + * @return Pointer to control
1.243 + */
1.244 + IMPORT_C virtual CCoeControl* ComponentControl( TInt aIndex ) const;
1.245 +
1.246 +private: // From base class @c CCoeControl.
1.247 +
1.248 + IMPORT_C virtual void Draw(const TRect& aRect) const;
1.249 +
1.250 +private: // From base class @c CAknControl.
1.251 +
1.252 + IMPORT_C void* ExtensionInterface( TUid aInterface );
1.253 +
1.254 +private:
1.255 +
1.256 + virtual void Reserved_1();
1.257 + void PrioritizeIndicatorsL();
1.258 +
1.259 + static TInt TickerCallback( TAny* aThis );
1.260 + TInt DoTick();
1.261 +
1.262 + void IncallBubbleSizeChanged( TBool aAllowIdleStateBubble );
1.263 +
1.264 + void SizeChangedInSmallStatusPane();
1.265 +
1.266 + void SizeChangedInNormalStatusPane();
1.267 +
1.268 + void SizeChangedInStaconPane();
1.269 +
1.270 + void SizeChangedInFlatStatusPane();
1.271 +
1.272 + void SizeChangedInExtendedStatusPane();
1.273 +
1.274 + void SizeChangedInIdleExtendedStatusPane();
1.275 +
1.276 + void SizeChangedInIdleVertical();
1.277 +
1.278 + void SetContainerWindowNonFading( TBool aNonFading );
1.279 +
1.280 + void SetupIndicatorLayoutModes();
1.281 +
1.282 + TInt SelectIndicatorLayoutMode();
1.283 +
1.284 + void CreateIndicatorFromPaneResourceL( TUid aUid,
1.285 + TInt aIndicatorPaneResourceId,
1.286 + TInt aCustomIndicatorFlags );
1.287 +
1.288 + TBool IndicatorExists( TUid aUid ) const;
1.289 +
1.290 + void CreateIncallBubbleL();
1.291 +
1.292 + TBool UpdateSmallLayoutL();
1.293 +
1.294 + void SetIncallBubbleDisabled( TBool aDisabled );
1.295 +
1.296 + void ResetAnimTicker( TBool bForeground );
1.297 +
1.298 +public:
1.299 +
1.300 + /**
1.301 + * Sets value to the progress bar indicator
1.302 + * (@c EAknNaviPaneEditorIndicatorProgressBar).
1.303 + * Panics if the specified indicator is not a progress bar indicator.
1.304 + *
1.305 + * @since 2.1
1.306 + * @param aIndicatorId ID of the indicator to be modified.
1.307 + * @param aValue Current progress of the task that bar describes.
1.308 + * @param aMaxValue Progress value when task is finished.
1.309 + *
1.310 + */
1.311 + IMPORT_C void SetIndicatorValue( TUid aIndicatorId,
1.312 + TInt aValue,
1.313 + TInt aMaxValue );
1.314 +
1.315 + /**
1.316 + * Redraws those indicators that are visible and contain pictographs.
1.317 + */
1.318 + void DrawPictographArea();
1.319 +
1.320 + /**
1.321 + * Returns the pictograph interface owned by the indicator container,
1.322 + * or @c NULL if pictographs are not supported.
1.323 + */
1.324 + CAknPictographInterface* PictographInterface() const;
1.325 +
1.326 +
1.327 + /**
1.328 + * Sets whether incall bubble is shown also on the top of the idle
1.329 + * status pane. Normally it is shown only in usual statuspane layouts,
1.330 + * but with this method it can be set to shown also in idle.
1.331 + *
1.332 + * NOTE: This method works only if indicatorcontainer is used as container
1.333 + * for universal indicators.
1.334 + *
1.335 + * @param aAllowed If true incall bubble is shown also in idle statuspane.
1.336 + * Otherwise bubble is shown only in usual statuspane
1.337 + * layouts.
1.338 + */
1.339 + IMPORT_C void SetIncallBubbleAllowedInIdle( TBool aAllowed );
1.340 +
1.341 + /**
1.342 + * Sets whether incall bubble is shown on the top of the usual status pane.
1.343 + * Normally it is shown in usual statuspane layouts, but with this
1.344 + * method it can prevent it to be shown.
1.345 + *
1.346 + * NOTE: This method works only if indicatorcontainer is used as
1.347 + * container for universal indicators.
1.348 + *
1.349 + * @param aAllowed If true incall bubble is shown in usual statuspane.
1.350 + */
1.351 + IMPORT_C void SetIncallBubbleAllowedInUsual( TBool aAllowed );
1.352 +
1.353 +
1.354 + /**
1.355 + * Sets observer for given indicator.
1.356 + *
1.357 + * @param aIndicatorObserver Observer of the indicator.
1.358 + * @param aIndicatorUid UID of indicator to be observed.
1.359 + */
1.360 + IMPORT_C void SetIndicatorObserver( MAknIndicatorObserver* aIndicatorObserver,
1.361 + TUid aIndicatorUid );
1.362 +
1.363 + /**
1.364 + * Creates a custom indicator.
1.365 + * Indicators created with this method can be used in addition
1.366 + * to default indicators.
1.367 + *
1.368 + * @since 3.1
1.369 + *
1.370 + * @param aIndicatorResourceId Resource ID of INDICATOR struct to be used
1.371 + * in costructing indicator.
1.372 + * UID in the resource is ignored, a dynamic
1.373 + * UID is given to indicator and returned
1.374 + * to caller.
1.375 + * @param aCustomIndicatorFlags Flags that can be used to set additional
1.376 + * indicator properties.
1.377 + * - @c EMultiColorIndicator:
1.378 + * Indicator is shown as multicolor
1.379 + * (default is 2-color).
1.380 + * - @c EIndicatorPositionInverted:
1.381 + * Indicator is aligned to the opposite
1.382 + * side than default (default is right
1.383 + * side). Note that this flag does not
1.384 + * quarantee exact location for the
1.385 + * indicator, indicators are shown in
1.386 + * priority order and location may vary
1.387 + * and look different in different layouts.
1.388 + *
1.389 + * @return UID of the new indicator.
1.390 + *
1.391 + */
1.392 + IMPORT_C TUid CreateIndicatorFromResourceL( TInt aIndicatorResourceId,
1.393 + TInt aCustomIndicatorFlags );
1.394 +
1.395 +
1.396 + /**
1.397 + * Replaces the icon of the given indicator.
1.398 + *
1.399 + * @since 3.1
1.400 + * @param aIndicator UID of the indicator.
1.401 + * @param aState State which icon is replaced (@c EAknIndicatorStateOn
1.402 + * or @c EAknIndicatorStateAnimate)
1.403 + * @param aLayoutMode Layout mode of the icon to be replaced
1.404 + * (@c ELayoutModeUsual or @c ELayoutModeWide)
1.405 + * @param aIconBitmap Bitmap of the new icon. Ownership is transferred to
1.406 + * @c CAknIndicatorContainer.
1.407 + * @param aIconMask Mask of the new icon. Ownership is transferred to
1.408 + * @c CAknIndicatorContainer.
1.409 + * @param aIconIndex If parameter aState is @c EAknIndicatorStateAnimate,
1.410 + * then this parameter must contain the index of the
1.411 + * icon to be replaced in the animation sequence.
1.412 + * Old icon must exist for given index so that the
1.413 + * number of animation frames does not change.
1.414 + */
1.415 + IMPORT_C void ReplaceIndicatorIconL( TUid aIndicator,
1.416 + TInt aState,
1.417 + TInt aLayoutMode,
1.418 + CFbsBitmap* aIconBitmap,
1.419 + CFbsBitmap* aIconMask,
1.420 + TInt aIconIndex = 0 );
1.421 +
1.422 +private:
1.423 +
1.424 + /** Array of the indicators. */
1.425 + typedef CArrayPtrFlat<CAknIndicator> CAknIndicatorQueue;
1.426 + CAknIndicatorQueue* iIndicators;
1.427 +
1.428 + /** Layout orientations. */
1.429 + TLayoutOrientation iLayoutOrientation;
1.430 + TLayoutOrientation iPreviousLayoutOrientation;
1.431 +
1.432 + /** Alignment of the indicators. */
1.433 + TIndicatorAlignment iAlignment;
1.434 +
1.435 + /** Number of indicators shown. */
1.436 + TInt iIndicatorsShown;
1.437 +
1.438 + /** Number of animated indicators shown. */
1.439 + TInt iAnimatedIndicatorsShown;
1.440 +
1.441 + /** Extension class. */
1.442 + CAknIndicatorContainerExtension* iExtension;
1.443 +
1.444 + /** Context of the indicators. */
1.445 + TInt iIndicatorContext;
1.446 +
1.447 + /** Indicator animation timer. */
1.448 + CPeriodic* iTicker;
1.449 +
1.450 + /** Reserved for future use. */
1.451 + TBool iSpare2;
1.452 +
1.453 + /** Synchronization value used in the indicator animations. */
1.454 + TInt iSynchronizingValue;
1.455 +
1.456 + /** Small incall status bubble. */
1.457 + CIncallStatusBubble* iIncallBubble;
1.458 + };
1.459 +
1.460 +#endif // AKNINDICATORCONTAINER_H
1.461 +
1.462 +// End of File