1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/eikspane.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,844 @@
1.4 +/*
1.5 +* Copyright (c) 2002-2010 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 "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: EIKON Status Pane control.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef __EIKSPANE_H__
1.23 +#define __EIKSPANE_H__
1.24 +
1.25 +#include <eikspmod.h>
1.26 +#include <coecntrl.h>
1.27 +#include <coecobs.h>
1.28 +
1.29 +class CCoeBrushAndPenContext;
1.30 +class CEikStatusPaneContainer;
1.31 +class CEikStatusPaneBaseExtension;
1.32 +class CAknStatuspaneClearer;
1.33 +class CAknDelayedForegroundObserver;
1.34 +class CAknStatusPaneDataSubscriber;
1.35 +class TAknsItemID;
1.36 +
1.37 +/**
1.38 +* Status pane flag indicating that a sub-pane exists
1.39 +* in the status pane.
1.40 +*/
1.41 +const TInt KStatusPaneCapsPresentBit = 1;
1.42 +
1.43 +/**
1.44 +* Status pane flag indicating that a sub-pane is owned
1.45 +* by the application side status pane.
1.46 +*/
1.47 +const TInt KStatusPaneCapsAppOwnedBit = 2;
1.48 +
1.49 +/**
1.50 +* Status pane flag indicating that a sub-pane is part of
1.51 +* a specific status pane layout.
1.52 +*/
1.53 +const TInt KStatusPaneCapsInCurrentLayoutBit = 4;
1.54 +
1.55 +/**
1.56 + * The @c MEikStatusPaneObserver interface allows a status pane observer to
1.57 + * pick up changes in the size or position of the status pane. Such events
1.58 + * will be as a result of layout changes which cause an actual change in the
1.59 + * status pane rectangle.
1.60 + */
1.61 +class MEikStatusPaneObserver
1.62 + {
1.63 +public:
1.64 + virtual void HandleStatusPaneSizeChange() = 0;
1.65 + };
1.66 +
1.67 +/**
1.68 + * The base class for status panes.
1.69 + */
1.70 +class CEikStatusPaneBase : public CBase
1.71 + {
1.72 +
1.73 +public:
1.74 +
1.75 + /**
1.76 + * Describes the capabilities of a subpane.
1.77 + */
1.78 + class TPaneCapabilities
1.79 + {
1.80 +
1.81 + public:
1.82 +
1.83 + /**
1.84 + * Constructor.
1.85 + */
1.86 + TPaneCapabilities();
1.87 +
1.88 + /**
1.89 + * Tests whether the subpane exists in the status pane.
1.90 + *
1.91 + * @return @c ETrue if the subpane exists and can be used by the
1.92 + * application, even if the subpane is not visible.
1.93 + */
1.94 + inline TBool IsPresent() const;
1.95 +
1.96 + /**
1.97 + * Tests whether the pane is owned by the application or the server.
1.98 + * Applications can only interact directly with application owned
1.99 + * subpanes.
1.100 + *
1.101 + * @return @c ETrue if the subpane is owned by the application.
1.102 + */
1.103 + inline TBool IsAppOwned() const;
1.104 +
1.105 + /**
1.106 + * Tests if this pane is part of the current status pane layout.
1.107 + *
1.108 + * @return @c ETrue if pane is part of the current status pane layout.
1.109 + */
1.110 + inline TBool IsInCurrentLayout() const;
1.111 +
1.112 + private:
1.113 +
1.114 + inline void SetPresent();
1.115 + inline void SetAppOwned();
1.116 + inline void SetInCurrentLayout();
1.117 +
1.118 + private:
1.119 +
1.120 + TInt iFlags;
1.121 +
1.122 + private:
1.123 +
1.124 + friend class CEikStatusPaneBase;
1.125 + };
1.126 +
1.127 +public:
1.128 +
1.129 + /**
1.130 + * Destructor.
1.131 + */
1.132 + IMPORT_C ~CEikStatusPaneBase();
1.133 +
1.134 + /**
1.135 + * Gets a pointer to the thread's currently active status pane
1.136 + * without transferring ownership.
1.137 + *
1.138 + * @return Pointer to currently active status pane.
1.139 + * Returns @c NULL if no such pane exists.
1.140 + */
1.141 + IMPORT_C static CEikStatusPaneBase* Current();
1.142 +
1.143 + /**
1.144 + * Sets the status pane observer.
1.145 + *
1.146 + * @param aObserver Pointer to status pane observer.
1.147 + */
1.148 + inline void SetObserver( MEikStatusPaneObserver* aObserver );
1.149 +
1.150 + /**
1.151 + * Modifies the bounding rectangle so that it lies next to the
1.152 + * status pane rectangle.
1.153 + *
1.154 + * The status pane always places itself along the edge of the screen, so
1.155 + * that it is consistent across applications and the server. It is
1.156 + * assumed that the given bounding rectangle does not extend beyond
1.157 + * the screen area.
1.158 + *
1.159 + * @param[in,out] aBoundingRect The bounding rectangle.
1.160 + */
1.161 + IMPORT_C void ReduceRect( TRect& aBoundingRect ) const;
1.162 +
1.163 + /**
1.164 + * Adds and removes pane rectangles from @c aRegion.
1.165 + *
1.166 + * @param aRegion The two-dimensional area from where
1.167 + * rectangles are removed from or where
1.168 + * rectangles are added to.
1.169 + * @param aIncludeAppPanes If @c ETrue, app panes are added, otherwise
1.170 + * removed.
1.171 + * @param aIncludeServerPanes If @c ETrue, server panes are added,
1.172 + * otherwise removed.
1.173 + */
1.174 + IMPORT_C void GetShapeL( TRegion& aRegion,
1.175 + TBool aIncludeAppPanes,
1.176 + TBool aIncludeServerPanes ) const;
1.177 +
1.178 + /**
1.179 + * Switches to the specified status pane layout.
1.180 + *
1.181 + * The actual layout to which this method switches may not be the
1.182 + * same as specified in @c aLayoutResourceId parameter.
1.183 + * Eg. if landscape mode status pane layout is set with this method,
1.184 + * while in portrait mode, it's mapped to the corresponding layout
1.185 + * in the portrait mode. This should be noted when using
1.186 + * @c CEikStatusPaneBase::CurrentLayoutResId().
1.187 + *
1.188 + * From release 3.2 on the old status pane layouts are also mapped
1.189 + * to the new layouts, ie.
1.190 + * @c R_AVKON_STATUS_PANE_LAYOUT_USUAL ->
1.191 + * @c R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT
1.192 + *
1.193 + * @c R_AVKON_STATUS_PANE_LAYOUT_IDLE ->
1.194 + * @c R_AVKON_STATUS_PANE_LAYOUT_IDLE_EXT
1.195 + *
1.196 + * @param aLayoutResourceId Layout resource ID. This must be one of the
1.197 + * layouts identified in the status pane
1.198 + * resource structures, otherwise the function
1.199 + * leaves @c KErrNotFound.
1.200 + * @see avkon.rsg
1.201 + *
1.202 + * @leave KErrNotFound The specified layout does not exist in the
1.203 + * status pane resource structures.
1.204 + */
1.205 + IMPORT_C virtual void SwitchLayoutL( TInt aLayoutResourceId );
1.206 +
1.207 + /**
1.208 + * Sets the visibility of the status pane and it's contents.
1.209 + *
1.210 + * @param aVisible If @c ETrue the status pane and it's contents are set
1.211 + * visible.
1.212 + */
1.213 + IMPORT_C virtual void MakeVisible( TBool aVisible );
1.214 +
1.215 + /**
1.216 + * Sets the status pane and it's contents to dimmed state.
1.217 + *
1.218 + * @param aDimmed If @c ETrue the status pane and it's contents are
1.219 + * set to dimmed state.
1.220 + */
1.221 + IMPORT_C virtual void SetDimmed( TBool aDimmed );
1.222 +
1.223 + /**
1.224 + * Not implemented.
1.225 + *
1.226 + * @param aFaded Not used.
1.227 + */
1.228 + IMPORT_C virtual void SetFaded( TBool aFaded );
1.229 +
1.230 + /**
1.231 + * Handles changes in resources which are shared across the environment.
1.232 + * This function responds to the changes in resources by propagating them
1.233 + * to sub-parts of the status pane.
1.234 + *
1.235 + * @param aType A message type.
1.236 + */
1.237 + IMPORT_C virtual void HandleResourceChange( TInt aType );
1.238 +
1.239 + /**
1.240 + * Returns always @c ETrue.
1.241 + *
1.242 + * @return @c ETrue.
1.243 + */
1.244 + IMPORT_C virtual TBool OkToChangeStatusPaneNow();
1.245 +
1.246 + /**
1.247 + * Sets all the visual flags at once
1.248 + * (@c KEikStatusPaneBaseVisibleBit and
1.249 + * @c KEikStatusPaneBaseDimmedBit).
1.250 + *
1.251 + * @param aFlags Flags to be set.
1.252 + */
1.253 + IMPORT_C void SetFlags( TInt aFlags );
1.254 +
1.255 + /**
1.256 + * Gets status pane settings.
1.257 + *
1.258 + * @return Flags used by status pane base class.
1.259 + */
1.260 + IMPORT_C TInt Flags() const;
1.261 +
1.262 + /**
1.263 + * Gets the visibility of the status pane.
1.264 + *
1.265 + * @return @c ETrue if the status pane is visible.
1.266 + */
1.267 + IMPORT_C TBool IsVisible() const;
1.268 +
1.269 + /**
1.270 + * Gets the dimmed state of the status pane.
1.271 + *
1.272 + * @return @c ETrue if the status pane is dimmed.
1.273 + */
1.274 + IMPORT_C TBool IsDimmed() const;
1.275 +
1.276 + /**
1.277 + * Gets the fade status of the status pane.
1.278 + *
1.279 + * @return @c ETrue if status pane is faded.
1.280 + */
1.281 + IMPORT_C TBool IsFaded() const;
1.282 +
1.283 + /**
1.284 + * Gets the capabilities of a sub-pane in the status pane.
1.285 + *
1.286 + * @param aPaneId Sub-pane ID.
1.287 + *
1.288 + * @return Capabilities of the pane.
1.289 + */
1.290 + IMPORT_C TPaneCapabilities PaneCapabilities( TPaneId aPaneId ) const;
1.291 +
1.292 + /**
1.293 + * Provides the screen rectangle of a sub-pane.
1.294 + * This can be used to set the size of a new control which you want
1.295 + * to place in the status pane.
1.296 + *
1.297 + * @param aPaneId Sub-pane ID.
1.298 + *
1.299 + * @return The sub-pane rectangle.
1.300 + *
1.301 + * @leave KErrNotFound The sub-pane ID is not valid.
1.302 + */
1.303 + IMPORT_C TRect PaneRectL( TPaneId aPaneId ) const;
1.304 +
1.305 + /**
1.306 + * Provides the control currently inside a sub-pane.
1.307 + * This gives the application direct access to the contents of a pane.
1.308 + *
1.309 + * @param aPaneId Sub-pane ID.
1.310 + *
1.311 + * @return Pointer to the control instance inside the sub-pane.
1.312 + *
1.313 + * @leave KErrNotFound The sub-pane ID is not valid.
1.314 + */
1.315 + IMPORT_C CCoeControl* ControlL( TPaneId aPaneId ) const;
1.316 +
1.317 + /**
1.318 + * Swaps the control currently inside a sub-pane.
1.319 + * The new control must be a fully constructed control.
1.320 + * It will be placed inside the status pane, and the current
1.321 + * content will be returned to the caller.
1.322 + *
1.323 + * @param aPaneId ID of the sub-pane.
1.324 + * @param aNewControl A fully constructed control to
1.325 + * place at @c aPaneId.
1.326 + *
1.327 + * @return The control which was at @c aPaneId.
1.328 + *
1.329 + * @leave KErrNotFound This can occur before ownership of the new
1.330 + * control is taken, if the subpane ID is not valid.
1.331 + */
1.332 + IMPORT_C CCoeControl* SwapControlL( TPaneId aPaneId,
1.333 + CCoeControl* aNewControl );
1.334 +
1.335 + /**
1.336 + * Provides access to the container control of a sub-pane.
1.337 + * You will need access to the container of a sub pane if you want
1.338 + * to swap in a new control. The container control should be set as the
1.339 + * parent window of the new control.
1.340 + * It also provides a fast way to get the rectangle of the sub-pane
1.341 + * (@see PaneRect()).
1.342 + *
1.343 + * @param aPaneId ID of the sub-pane.
1.344 + *
1.345 + * @return Pointer to the new container control for the sub-pane.
1.346 + *
1.347 + * @leave KErrNotFound The sub-pane ID is not valid.
1.348 + */
1.349 + IMPORT_C CCoeControl* ContainerControlL( TPaneId aPaneId ) const;
1.350 +
1.351 + /**
1.352 + * Provides access to a server-side window group.
1.353 + *
1.354 + * @return Pointer to the window group.
1.355 + */
1.356 + inline RWindowGroup* WindowGroup() const;
1.357 +
1.358 + /**
1.359 + * Draws the control.
1.360 + */
1.361 + IMPORT_C void DrawNow();
1.362 +
1.363 + /**
1.364 + * Gets the resource ID of the current layout.
1.365 + *
1.366 + * @return The resource ID of the current layout.
1.367 + * @see avkon.rsg
1.368 + */
1.369 + IMPORT_C TInt CurrentLayoutResId() const;
1.370 +
1.371 + /**
1.372 + * Status pane drawing commands.
1.373 + */
1.374 + enum TDrawCmd
1.375 + {
1.376 + /** Do not draw. */
1.377 + ENoDraw,
1.378 +
1.379 + /** Draw immediately. */
1.380 + EDrawNow,
1.381 +
1.382 + /** Draw with low priority. */
1.383 + EDrawDeferred
1.384 + };
1.385 +
1.386 + /**
1.387 + * Sets the skin background ID of sub-panes which
1.388 + * are in the CBA area.
1.389 + * @internal This method is not exported.
1.390 + *
1.391 + * @param aBgID The skin background ID to be set.
1.392 + * @param aDrawCmd Whether the status pane is drawn
1.393 + * when updating the background context,
1.394 + * (@see @c TDrawCmd).
1.395 + */
1.396 + void SetCbaAreaBackgroundID( const TAknsItemID& aBgID,
1.397 + CEikStatusPaneBase::TDrawCmd aDrawCmd );
1.398 +
1.399 + /**
1.400 + * Returns the current skin background ID of the sub-panes
1.401 + * which are in the CBA area.
1.402 + * @internal This method is not exported.
1.403 + *
1.404 + * @return The skin background ID.
1.405 + */
1.406 + TAknsItemID CbaAreaBackgroundID();
1.407 +
1.408 +protected:
1.409 +
1.410 + /**
1.411 + * C++ default constructor.
1.412 + *
1.413 + * @param aEikEnv An environment for creating controls and utility
1.414 + * functions for manipulating them.
1.415 + * @param aParent Pointer to the parent window group.
1.416 + */
1.417 + IMPORT_C CEikStatusPaneBase( CEikonEnv& aEikEnv, RWindowGroup* aParent );
1.418 +
1.419 + /**
1.420 + * Initializes the status pane with standard values.
1.421 + *
1.422 + * @param aCoreResId ID of the status pane resource.
1.423 + */
1.424 + IMPORT_C void BaseConstructL( TInt aCoreResId );
1.425 +
1.426 + /**
1.427 + * Creates a new model for the status pane.
1.428 + *
1.429 + * @param aCoreResId ID of the status pane resource.
1.430 + *
1.431 + * @return Pointer to the new status pane model instance.
1.432 + */
1.433 + virtual CEikStatusPaneModelBase* CreateModelL( TInt aCoreResId ) const = 0;
1.434 +
1.435 + /**
1.436 + * Creates the sub-panes to the status pane.
1.437 + */
1.438 + void CreatePanesL();
1.439 +
1.440 + /**
1.441 + * Creates a sub-pane.
1.442 + *
1.443 + * @param[in] aPaneInit Initial values for the sub-pane.
1.444 + */
1.445 + void CreatePaneL( const TEikStatusPaneInit& aPaneInit );
1.446 +
1.447 + /**
1.448 + * Gets a container of a specified sub-pane.
1.449 + *
1.450 + * @param aPaneId The sub-pane ID.
1.451 + *
1.452 + * @return Pointer to the container of the sub-pane with a given ID.
1.453 + */
1.454 + CEikStatusPaneContainer* Find( TPaneId aPaneId ) const;
1.455 +
1.456 + /**
1.457 + * Can be used to determine whether or not the status pane is on
1.458 + * application side or server side.
1.459 + *
1.460 + * @return @c ETrue if the status pane resides in the application side,
1.461 + * @c EFalse if it's on the server side.
1.462 + */
1.463 + virtual TBool IsApp() const = 0;
1.464 +
1.465 + /**
1.466 + * Gets the rectangle of the status pane.
1.467 + *
1.468 + * @return The rectangle used by the status pane.
1.469 + */
1.470 + inline TRect Rect() const;
1.471 +
1.472 + /**
1.473 + * Calls @c CCoeControl's @c DrawNow() or @c DrawDeferred() to draw the
1.474 + * status pane. If @c aDraw is @c ENoDraw status pane is not drawed.
1.475 + *
1.476 + * @param aDraw Status pane drawing command.
1.477 + */
1.478 + void DoDrawNow( TDrawCmd aDraw );
1.479 +
1.480 + /**
1.481 + * Gets the status pane clearer.
1.482 + *
1.483 + * @return Pointer to the status pane clearer instance.
1.484 + */
1.485 + CAknStatuspaneClearer* Clearer();
1.486 +
1.487 + /**
1.488 + * Disables the status pane clearer.
1.489 + *
1.490 + * @param aDisabled Disabled if @c ETrue.
1.491 + */
1.492 + IMPORT_C void DisableClearer( TBool aDisabled );
1.493 +
1.494 + /**
1.495 + * Prepares the status pane for the application exit.
1.496 + * Clears the status pane.
1.497 + */
1.498 + IMPORT_C void CommonPrepareForAppExit();
1.499 +
1.500 +private:
1.501 +
1.502 + void DoSwitchLayoutL( TInt aLayoutResourceId, TDrawCmd aDraw );
1.503 + void ApplyLayoutL( CEikStatusPaneLayout* aLayout, TDrawCmd aDraw );
1.504 + void SetAllInvisible();
1.505 + void SetNotNeededInvisible();
1.506 +
1.507 +public:
1.508 +
1.509 + /**
1.510 + * Notifies the command button area and status pane observer about the
1.511 + * status pane size change. If the status pane is an embedded application,
1.512 + * also this application is notified.
1.513 + */
1.514 + void ReportSizeChange();
1.515 +
1.516 +private:
1.517 +
1.518 + class TSetRectAndVisibility : public MEikStatusPaneLayoutTreeVisitor
1.519 + {
1.520 + public:
1.521 +
1.522 + TSetRectAndVisibility( TBool aIsApp, CEikStatusPaneBase* aStatusPane );
1.523 + void VisitL( CEikStatusPaneLayoutTree* aNode );
1.524 +
1.525 + private:
1.526 +
1.527 + TBool iIsApp;
1.528 + CEikStatusPaneBase* iStatusPane;
1.529 + };
1.530 +
1.531 + friend class TSetRectAndVisibility;
1.532 +
1.533 +private:
1.534 +
1.535 + void SetLastUsedResourceId( TInt aResourceId );
1.536 + TInt LastUsedResourceId();
1.537 + TInt ReadInitialUsedResourceIdL( TInt aCoreResId );
1.538 + TInt InitialUsedResourceId();
1.539 + TRect LargestBoundingRect( TRegion& aWholeRegion,
1.540 + TRegion& aRemovedRegion ) const;
1.541 + void SetCombinedPaneVisibilityL( TBool aVisible );
1.542 +
1.543 +protected:
1.544 +
1.545 + /**
1.546 + * Gets the status pane data subscriber.
1.547 + *
1.548 + * @return Pointer to the status pane data subscriber.
1.549 + */
1.550 + CAknStatusPaneDataSubscriber* DataSubscriber() const;
1.551 +
1.552 + /**
1.553 + * Sets the initial status pane resource ID to an extension class
1.554 + * @c CEikStatusPaneBaseExtension.
1.555 + *
1.556 + * @param aResourceId The initial status pane resource ID.
1.557 + */
1.558 + void SetInitialUsedResourceId( TInt aResourceId );
1.559 +
1.560 + /**
1.561 + * Optimizes the status pane region which cleared during
1.562 + * status pane layout change.
1.563 + *
1.564 + * @param aOldResourceId Old status pane resource ID.
1.565 + * @param aNewResourceId New status pane resource ID.
1.566 + * @param[in,out] aRegion Status pane region.
1.567 + * On return contains only
1.568 + * the region that needs to be cleared.
1.569 + */
1.570 + void OptimizeClearerWindowShape( TInt aOldResourceId,
1.571 + TInt aNewResourceId,
1.572 + TRegion& aRegion );
1.573 +
1.574 + /**
1.575 + * Sets redraw storing state of the window.
1.576 + *
1.577 + * @param aWindow The window whose redraw storing state is to be set.
1.578 + * @param aOn @c ETrue to turn redraw storing on.
1.579 + */
1.580 + void SetStoreHandler( RWindow* aWindow, TBool aOn );
1.581 +
1.582 +protected:
1.583 +
1.584 + /**
1.585 + * An environment for creating controls and utility functions for
1.586 + * manipulating them.
1.587 + */
1.588 + CEikonEnv& iEikEnv;
1.589 +
1.590 + /**
1.591 + * Status pane model class. <br>
1.592 + * Own.
1.593 + */
1.594 + CEikStatusPaneModelBase* iModel;
1.595 +
1.596 + /**
1.597 + * Flags for the status pane.
1.598 + */
1.599 + TInt iFlags;
1.600 +
1.601 +protected:
1.602 +
1.603 + typedef CArrayPtrFlat<CEikStatusPaneContainer> CContainerControls;
1.604 + CContainerControls* iControls;
1.605 +
1.606 +private:
1.607 +
1.608 + MEikStatusPaneObserver* iObserver;
1.609 + RWindowGroup* iParentWindowGroup;
1.610 + CEikStatusPaneBaseExtension* iExtension;
1.611 + };
1.612 +
1.613 +/**
1.614 + * Application side status pane class.
1.615 + *
1.616 + * @c CEikStatusPane is the interface through which applications use the
1.617 + * status pane. This class synchronises the status pane layout with the
1.618 + * server side status pane object. To do this, the @c ApplyCurrentSettingsL()
1.619 + * method must be called whenever the owner application switches to the
1.620 + * foreground.
1.621 + */
1.622 +NONSHARABLE_CLASS( CEikStatusPane ) : public CEikStatusPaneBase,
1.623 + public MCoeForegroundObserver
1.624 + {
1.625 +public:
1.626 +
1.627 + /**
1.628 + * Two-phased constructor.
1.629 + *
1.630 + * @param aEikEnv An environment for creating controls
1.631 + * and utility functions for
1.632 + * manipulating them.
1.633 + * @param aParent Pointer to the parent window group.
1.634 + * @param aCoreStatusPaneModelResId Status pane core resource ID.
1.635 + * @param aAppStatusPaneModelResId Resource ID of the application's
1.636 + * status pane.
1.637 + *
1.638 + * @return Pointer to the created @c CEikStatusPane object.
1.639 + */
1.640 + IMPORT_C static CEikStatusPane* NewL(
1.641 + CEikonEnv& aEikEnv,
1.642 + RWindowGroup* aParent,
1.643 + TInt aCoreStatusPaneModelResId,
1.644 + TInt aAppStatusPaneModelResId = EEikStatusPaneUseDefaults );
1.645 +
1.646 + /**
1.647 + * Destructor.
1.648 + */
1.649 + IMPORT_C ~CEikStatusPane();
1.650 +
1.651 + /**
1.652 + * Synchronises the server status pane layout with the
1.653 + * application status pane.
1.654 + */
1.655 + IMPORT_C void ApplyCurrentSettingsL();
1.656 +
1.657 + /**
1.658 + * Prepares the status pane for the application exit.
1.659 + * Clears the status pane.
1.660 + */
1.661 + IMPORT_C void PrepareForAppExit();
1.662 +
1.663 + /**
1.664 + * Sets the visiblility of the status pane and its contents.
1.665 + * From @c CEikStatusPaneBase.
1.666 + *
1.667 + * @param aVisible If @c ETrue the status pane and its
1.668 + * contents are set visible.
1.669 + */
1.670 + IMPORT_C virtual void MakeVisible( TBool aVisible );
1.671 +
1.672 + /**
1.673 + * Sets the status pane and its contents to dimmed state.
1.674 + * From @c CEikStatusPaneBase.
1.675 + *
1.676 + * @param aDimmed If @c ETrue the status pane and its
1.677 + * contents are set to dimmed state.
1.678 + */
1.679 + IMPORT_C virtual void SetDimmed( TBool aDimmed );
1.680 +
1.681 + /**
1.682 + * Not implemented.
1.683 + * From @c CEikStatusPaneBase.
1.684 + *
1.685 + * @param aFaded Not used.
1.686 + */
1.687 + IMPORT_C virtual void SetFaded( TBool aFaded );
1.688 +
1.689 + /**
1.690 + * Handles changes in resources which are shared across the environment.
1.691 + * This function responds to the changes in resources by propagating them
1.692 + * to sub-parts of the status pane.
1.693 + * From @c CEikStatusPaneBase.
1.694 + *
1.695 + * @param aType A message type.
1.696 + */
1.697 + IMPORT_C virtual void HandleResourceChange( TInt aType );
1.698 +
1.699 + /**
1.700 + * Returns always @c ETrue.
1.701 + * From @c CEikStatusPaneBase.
1.702 + *
1.703 + * @return @c ETrue.
1.704 + */
1.705 + IMPORT_C virtual TBool OkToChangeStatusPaneNow();
1.706 +
1.707 +private:
1.708 +
1.709 + /**
1.710 + * Default C++ constructor.
1.711 + *
1.712 + * @param aEikEnv An environment for creating controls
1.713 + * and utility functions for
1.714 + * manipulating them.
1.715 + * @param aParent Pointer to the parent window group.
1.716 + * @param aAppStatusPaneModelResId Resource ID of the application's
1.717 + * status pane.
1.718 + */
1.719 + CEikStatusPane( CEikonEnv& aEikEnv,
1.720 + RWindowGroup* aParent,
1.721 + TInt aAppStatusPaneModelId );
1.722 +
1.723 + /**
1.724 + * Second-phase constructor.
1.725 + *
1.726 + * @param aCoreStatusPaneModelResId Status pane core resource ID.
1.727 + */
1.728 + void ConstructL( TInt aCoreStatusPaneModelResId );
1.729 +
1.730 + /**
1.731 + * Creates the application side status pane model.
1.732 + *
1.733 + * @param aCoreResId Status pane core resource ID.
1.734 + */
1.735 + virtual CEikStatusPaneModelBase* CreateModelL( TInt aCoreResId ) const;
1.736 +
1.737 + /**
1.738 + * Can be used to determine whether or not the status pane is on
1.739 + * application side or server side.
1.740 + *
1.741 + * @return @c ETrue
1.742 + */
1.743 + TBool IsApp() const;
1.744 +
1.745 + /**
1.746 + * Applies the current status pane flags.
1.747 + */
1.748 + void ApplyCurrentFlags();
1.749 +
1.750 + /**
1.751 + * Hides all the sub-panes owned by the application
1.752 + * side status pane.
1.753 + */
1.754 + void HideAppPanes( TBool aHide );
1.755 +
1.756 +private: // From base class @c MCoeForegroundObserver.
1.757 +
1.758 + /**
1.759 + * Handles foreground gain events.
1.760 + */
1.761 + void HandleGainingForeground();
1.762 +
1.763 + /**
1.764 + * Handles foreground lose events.
1.765 + */
1.766 + void HandleLosingForeground();
1.767 +
1.768 +private:
1.769 +
1.770 + /**
1.771 + * Reads the initial status pane layout from the status pane resources.
1.772 + *
1.773 + * @param aCoreResId Status pane core resource ID.
1.774 + * @param aAppStatusPaneModelResId Resource ID specified by the
1.775 + * application.
1.776 + */
1.777 + TInt ReadInitialUsedResourceIdL( TInt aCoreResId,
1.778 + TInt aAppStatusPaneModelResId );
1.779 +
1.780 + /**
1.781 + * Handles foreground lose events.
1.782 + */
1.783 + void DoHandleLosingForegroundL();
1.784 +
1.785 +private:
1.786 +
1.787 + TInt iAppDeclId;
1.788 +
1.789 + /** Formerly TEikStatusPaneSyncDrawer* iSyncDrawer */
1.790 + TAny* iSpare;
1.791 +
1.792 + /** Formerly iServerSpWgId */
1.793 + CAknDelayedForegroundObserver* iDelayedForegroundObserver;
1.794 + };
1.795 +
1.796 +/**
1.797 +* Checks if the pane exists in this status pane.
1.798 +* Note: this will return @c ETrue if the pane can be used,
1.799 +* even if it is not visible.
1.800 +*/
1.801 +inline TBool CEikStatusPaneBase::TPaneCapabilities::IsPresent() const
1.802 + {
1.803 + return iFlags & KStatusPaneCapsPresentBit;
1.804 + }
1.805 +
1.806 +/**
1.807 +* Checks if this pane is owned by application rather than the server.
1.808 +* Applications can only interact directly with application owned panes.
1.809 +*/
1.810 +inline TBool CEikStatusPaneBase::TPaneCapabilities::IsAppOwned() const
1.811 + {
1.812 + return iFlags & KStatusPaneCapsAppOwnedBit;
1.813 + }
1.814 +
1.815 +/**
1.816 +* Checks if this pane is part of the current status pane layout.
1.817 +*/
1.818 +inline TBool CEikStatusPaneBase::TPaneCapabilities::IsInCurrentLayout() const
1.819 + {
1.820 + return iFlags & KStatusPaneCapsInCurrentLayoutBit;
1.821 + }
1.822 +
1.823 +/**
1.824 +* Set the status pane observer.
1.825 +*/
1.826 +inline void CEikStatusPaneBase::SetObserver( MEikStatusPaneObserver* aObserver )
1.827 + {
1.828 + iObserver = aObserver;
1.829 + }
1.830 +
1.831 +/**
1.832 +* Gets the status pane rectangle.
1.833 +*/
1.834 +inline TRect CEikStatusPaneBase::Rect() const
1.835 + {
1.836 + return iModel->CurrentLayout()->Rect();
1.837 + }
1.838 +
1.839 +/**
1.840 +* Gets the window group that this status pane belongs to.
1.841 +*/
1.842 +inline RWindowGroup* CEikStatusPaneBase::WindowGroup() const
1.843 + {
1.844 + return iParentWindowGroup;
1.845 + }
1.846 +
1.847 +#endif // __EIKSPANE_H__