classicui_pub/status_pane_api/inc/eikspane.h
branchRCL_3
changeset 56 d48ab3b357f1
equal deleted inserted replaced
55:aecbbf00d063 56:d48ab3b357f1
       
     1 /*
       
     2 * Copyright (c) 2002-2010 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:  EIKON Status Pane control.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __EIKSPANE_H__
       
    20 #define __EIKSPANE_H__
       
    21 
       
    22 #include <eikspmod.h>
       
    23 #include <coecntrl.h>
       
    24 #include <coecobs.h>
       
    25 
       
    26 class CCoeBrushAndPenContext;
       
    27 class CEikStatusPaneContainer;
       
    28 class CEikStatusPaneBaseExtension;
       
    29 class CAknStatuspaneClearer;
       
    30 class CAknDelayedForegroundObserver;
       
    31 class CAknStatusPaneDataSubscriber;
       
    32 class TAknsItemID;
       
    33 
       
    34 /**
       
    35 * Status pane flag indicating that a sub-pane exists
       
    36 * in the status pane.
       
    37 */
       
    38 const TInt KStatusPaneCapsPresentBit         = 1;
       
    39 
       
    40 /**
       
    41 * Status pane flag indicating that a sub-pane is owned
       
    42 * by the application side status pane.
       
    43 */
       
    44 const TInt KStatusPaneCapsAppOwnedBit        = 2;
       
    45 
       
    46 /**
       
    47 * Status pane flag indicating that a sub-pane is part of
       
    48 * a specific status pane layout.
       
    49 */
       
    50 const TInt KStatusPaneCapsInCurrentLayoutBit = 4;
       
    51 
       
    52 /**
       
    53 * Status pane flag indicating that statuspane is transparent.
       
    54 * 
       
    55 */
       
    56 const TInt KStatusPaneTransparentBit = 8;
       
    57 /**
       
    58  * The @c MEikStatusPaneObserver interface allows a status pane observer to
       
    59  * pick up changes in the size or position of the status pane. Such events
       
    60  * will be as a result of layout changes which cause an actual change in the
       
    61  * status pane rectangle.
       
    62  */
       
    63 class MEikStatusPaneObserver
       
    64 	{
       
    65 public:
       
    66 	virtual void HandleStatusPaneSizeChange() = 0;
       
    67 	};
       
    68 
       
    69 /**
       
    70  * The base class for status panes.
       
    71  */
       
    72 class CEikStatusPaneBase : public CBase
       
    73 	{
       
    74 	
       
    75 public:
       
    76 
       
    77     /**
       
    78      * Describes the capabilities of a subpane.
       
    79      */
       
    80     class TPaneCapabilities
       
    81         {
       
    82 
       
    83     public:
       
    84         
       
    85         /**
       
    86         * Constructor.
       
    87         */
       
    88         TPaneCapabilities();
       
    89         
       
    90         /**
       
    91         * Tests whether the subpane exists in the status pane.
       
    92         * 
       
    93         * @return @c ETrue if the subpane exists and can be used by the
       
    94         *            application, even if the subpane is not visible.
       
    95         */
       
    96         inline TBool IsPresent() const;
       
    97         
       
    98         /**
       
    99         * Tests whether the pane is owned by the application or the server.
       
   100         * Applications can only interact directly with application owned
       
   101         * subpanes.
       
   102         *
       
   103         * @return @c ETrue if the subpane is owned by the application.
       
   104         */
       
   105         inline TBool IsAppOwned() const;
       
   106         
       
   107         /**
       
   108         * Tests if this pane is part of the current status pane layout.
       
   109         *
       
   110         * @return @c ETrue if pane is part of the current status pane layout.
       
   111         */
       
   112         inline TBool IsInCurrentLayout() const;
       
   113 
       
   114     private:
       
   115 
       
   116         inline void SetPresent();
       
   117         inline void SetAppOwned();
       
   118         inline void SetInCurrentLayout();
       
   119 
       
   120     private:
       
   121 
       
   122         TInt iFlags;
       
   123 
       
   124     private:
       
   125 
       
   126         friend class CEikStatusPaneBase;
       
   127         };
       
   128 
       
   129 public:
       
   130 
       
   131     /**
       
   132     * Destructor.
       
   133     */
       
   134     IMPORT_C ~CEikStatusPaneBase();
       
   135 
       
   136     /**
       
   137     * Gets a pointer to the thread's currently active status pane
       
   138     * without transferring ownership. 
       
   139     *
       
   140     * @return Pointer to currently active status pane.
       
   141     *         Returns @c NULL if no such pane exists.
       
   142     */
       
   143     IMPORT_C static CEikStatusPaneBase* Current();
       
   144 	
       
   145     /**
       
   146     * Sets the status pane observer.
       
   147     *
       
   148     * @param  aObserver  Pointer to status pane observer.
       
   149     */
       
   150     inline void SetObserver( MEikStatusPaneObserver* aObserver );
       
   151 	
       
   152     /**
       
   153     * Modifies the bounding rectangle so that it lies next to the
       
   154     * status pane rectangle.
       
   155     *
       
   156     * The status pane always places itself along the edge of the screen, so 
       
   157     * that it is consistent across applications and the server. It is 
       
   158     * assumed that the given bounding rectangle does not extend beyond 
       
   159     * the screen area.
       
   160     *
       
   161     * @param[in,out]  aBoundingRect  The bounding rectangle.
       
   162     */
       
   163     IMPORT_C void ReduceRect( TRect& aBoundingRect ) const;
       
   164 	
       
   165     /**
       
   166     * Adds and removes pane rectangles from @c aRegion.
       
   167     *
       
   168     * @param  aRegion              The two-dimensional area from where
       
   169     *                              rectangles are removed from or where
       
   170     *                              rectangles are added to.
       
   171     * @param  aIncludeAppPanes     If @c ETrue, app panes are added, otherwise
       
   172     *                              removed.
       
   173     * @param  aIncludeServerPanes  If @c ETrue, server panes are added, 
       
   174     *                              otherwise removed.
       
   175     */
       
   176     IMPORT_C void GetShapeL( TRegion& aRegion, 
       
   177                              TBool aIncludeAppPanes, 
       
   178                              TBool aIncludeServerPanes ) const;
       
   179 
       
   180     /**
       
   181     * Switches to the specified status pane layout.
       
   182     *
       
   183     * The actual layout to which this method switches may not be the
       
   184     * same as specified in @c aLayoutResourceId parameter.
       
   185     * Eg. if landscape mode status pane layout is set with this method,
       
   186     * while in portrait mode, it's mapped to the corresponding layout
       
   187     * in the portrait mode. This should be noted when using
       
   188     * @c CEikStatusPaneBase::CurrentLayoutResId().
       
   189     *
       
   190     * From release 3.2 on the old status pane layouts are also mapped
       
   191     * to the new layouts, ie.
       
   192     *  @c R_AVKON_STATUS_PANE_LAYOUT_USUAL ->
       
   193     *      @c R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT
       
   194     *
       
   195     *  @c R_AVKON_STATUS_PANE_LAYOUT_IDLE  ->
       
   196     *      @c R_AVKON_STATUS_PANE_LAYOUT_IDLE_EXT
       
   197     *
       
   198     * @param aLayoutResourceId Layout resource ID. This must be one of the
       
   199     *                          layouts identified in the status pane
       
   200     *                          resource structures, otherwise the function
       
   201     *                          leaves @c KErrNotFound.
       
   202     *                          @see avkon.rsg
       
   203     *
       
   204     * @leave KErrNotFound      The specified layout does not exist in the
       
   205     *                          status pane resource structures.
       
   206     */
       
   207     IMPORT_C virtual void SwitchLayoutL( TInt aLayoutResourceId );
       
   208 	
       
   209     /**
       
   210     * Sets the visibility of the status pane and it's contents.
       
   211     *
       
   212     * @param  aVisible  If @c ETrue the status pane and it's contents are set
       
   213     *                   visible.
       
   214     */
       
   215     IMPORT_C virtual void MakeVisible( TBool aVisible );
       
   216 	
       
   217     /**
       
   218     * Sets the status pane and it's contents to dimmed state.
       
   219     *
       
   220     * @param  aDimmed  If @c ETrue the status pane and it's contents are
       
   221     *                  set to dimmed state.
       
   222     */
       
   223     IMPORT_C virtual void SetDimmed( TBool aDimmed );
       
   224 	
       
   225     /**
       
   226     * Not implemented.
       
   227     *
       
   228     * @param aFaded Not used.
       
   229     */
       
   230     IMPORT_C virtual void SetFaded( TBool aFaded );
       
   231 	
       
   232     /**
       
   233     * Handles changes in resources which are shared across the environment.
       
   234     * This function responds to the changes in resources by propagating them
       
   235     * to sub-parts of the status pane.
       
   236     *
       
   237     * @param  aType  A message type.
       
   238     */
       
   239     IMPORT_C virtual void HandleResourceChange( TInt aType );
       
   240 	
       
   241     /**
       
   242     * Returns always @c ETrue. 
       
   243     *
       
   244     * @return @c ETrue.
       
   245     */
       
   246     IMPORT_C virtual TBool OkToChangeStatusPaneNow();
       
   247 
       
   248     /**
       
   249     * Sets all the visual flags at once
       
   250     * (@c KEikStatusPaneBaseVisibleBit and
       
   251     *  @c KEikStatusPaneBaseDimmedBit).
       
   252     * 
       
   253     * @param  aFlags  Flags to be set.
       
   254     */
       
   255     IMPORT_C void SetFlags( TInt aFlags );
       
   256 	
       
   257     /**
       
   258     * Gets status pane settings.
       
   259     *
       
   260     * @return Flags used by status pane base class.
       
   261     */
       
   262     IMPORT_C TInt Flags() const;
       
   263 	
       
   264     /**
       
   265     * Gets the visibility of the status pane.
       
   266     * 
       
   267     * @return @c ETrue if the status pane is visible.
       
   268     */
       
   269     IMPORT_C TBool IsVisible() const;
       
   270 	
       
   271     /**
       
   272     * Gets the dimmed state of the status pane.
       
   273     * 
       
   274     * @return @c ETrue if the status pane is dimmed.
       
   275     */
       
   276     IMPORT_C TBool IsDimmed() const;
       
   277 	
       
   278     /**
       
   279     * Gets the fade status of the status pane.
       
   280     * 
       
   281     * @return @c ETrue if status pane is faded.
       
   282     */
       
   283     IMPORT_C TBool IsFaded() const;
       
   284 
       
   285     /**
       
   286     * Gets the capabilities of a sub-pane in the status pane.
       
   287     * 
       
   288     * @param   aPaneId  Sub-pane ID.
       
   289     *
       
   290     * @return Capabilities of the pane.
       
   291     */
       
   292     IMPORT_C TPaneCapabilities PaneCapabilities( TPaneId aPaneId ) const;
       
   293 	
       
   294     /**
       
   295     * Provides the screen rectangle of a sub-pane.
       
   296     * This can be used to set the size of a new control which you want
       
   297     * to place in the status pane.
       
   298     * 
       
   299     * @param   aPaneId  Sub-pane ID.
       
   300     *
       
   301     * @return The sub-pane rectangle.
       
   302     *
       
   303     * @leave  KErrNotFound The sub-pane ID is not valid.
       
   304     */
       
   305     IMPORT_C TRect PaneRectL( TPaneId aPaneId ) const;
       
   306 	
       
   307     /**
       
   308     * Provides the control currently inside a sub-pane.
       
   309     * This gives the application direct access to the contents of a pane.
       
   310     *
       
   311     * @param   aPaneId  Sub-pane ID.
       
   312     *
       
   313     * @return Pointer to the control instance inside the sub-pane.
       
   314     *
       
   315     * @leave  KErrNotFound The sub-pane ID is not valid.
       
   316     */
       
   317     IMPORT_C CCoeControl* ControlL( TPaneId aPaneId ) const;
       
   318 	
       
   319     /**
       
   320     * Swaps the control currently inside a sub-pane.
       
   321     * The new control must be a fully constructed control.
       
   322     * It will be placed inside the status pane, and the current
       
   323     * content will be returned to the caller. 
       
   324     * 
       
   325     * @param  aPaneId      ID of the sub-pane.
       
   326     * @param  aNewControl  A fully constructed control to
       
   327     *                      place at @c aPaneId.
       
   328     *
       
   329     * @return The control  which was at @c aPaneId.
       
   330     *
       
   331     * @leave  KErrNotFound This can occur before ownership of the new
       
   332     *                      control is taken, if the subpane ID is not valid.
       
   333     */
       
   334     IMPORT_C CCoeControl* SwapControlL( TPaneId aPaneId,
       
   335                                         CCoeControl* aNewControl );
       
   336 	
       
   337     /**
       
   338     * Provides access to the container control of a sub-pane.
       
   339     * You will need access to the container of a sub pane if you want 
       
   340     * to swap in a new control. The container control should be set as the
       
   341     * parent window of the new control.
       
   342     * It also provides a fast way to get the rectangle of the sub-pane 
       
   343     * (@see PaneRect()).
       
   344     *
       
   345     * @param   aPaneId  ID of the sub-pane.
       
   346     *
       
   347     * @return Pointer to the new container control for the sub-pane.
       
   348     *
       
   349     * @leave  KErrNotFound The sub-pane ID is not valid.
       
   350     */
       
   351     IMPORT_C CCoeControl* ContainerControlL( TPaneId aPaneId ) const;
       
   352 	
       
   353     /**
       
   354     * Provides access to a server-side window group.
       
   355     *
       
   356     * @return Pointer to the window group.
       
   357     */
       
   358     inline RWindowGroup* WindowGroup() const;
       
   359 	
       
   360     /**
       
   361     * Draws the control.
       
   362     */
       
   363     IMPORT_C void DrawNow();
       
   364 	
       
   365     /**
       
   366     * Gets the resource ID of the current layout.
       
   367     *
       
   368     * @return The resource ID of the current layout.
       
   369     *         @see avkon.rsg
       
   370     */
       
   371     IMPORT_C TInt CurrentLayoutResId() const;
       
   372     
       
   373     /**
       
   374     * Status pane drawing commands.
       
   375     */
       
   376     enum TDrawCmd 
       
   377         { 
       
   378         /** Do not draw. */
       
   379         ENoDraw, 
       
   380 
       
   381         /** Draw immediately. */
       
   382         EDrawNow, 
       
   383         
       
   384         /** Draw with low priority. */
       
   385         EDrawDeferred 
       
   386         };
       
   387 
       
   388     /**
       
   389     * Sets the skin background ID of sub-panes which
       
   390     * are in the CBA area.
       
   391     * @internal This method is not exported.
       
   392     *
       
   393     * @param  aBgID     The skin background ID to be set.
       
   394     * @param  aDrawCmd  Whether the status pane is drawn
       
   395     *                   when updating the background context,
       
   396     *                   (@see @c TDrawCmd).
       
   397     */
       
   398     void SetCbaAreaBackgroundID( const TAknsItemID& aBgID,
       
   399                                  CEikStatusPaneBase::TDrawCmd aDrawCmd );
       
   400     
       
   401     /**
       
   402     * Returns the current skin background ID of the sub-panes
       
   403     * which are in the CBA area.
       
   404     * @internal This method is not exported.
       
   405     *
       
   406     * @return  The skin background ID.
       
   407     */
       
   408     TAknsItemID CbaAreaBackgroundID();
       
   409 
       
   410 protected:
       
   411 
       
   412     /**
       
   413     * C++ default constructor.
       
   414     *
       
   415     * @param  aEikEnv  An environment for creating controls and utility 
       
   416     *                  functions for manipulating them.
       
   417     * @param  aParent  Pointer to the parent window group.
       
   418     */
       
   419     IMPORT_C CEikStatusPaneBase( CEikonEnv& aEikEnv, RWindowGroup* aParent );
       
   420 	
       
   421     /**
       
   422     * Initializes the status pane with standard values. 
       
   423     * 
       
   424     * @param  aCoreResId  ID of the status pane resource.
       
   425     */
       
   426     IMPORT_C void BaseConstructL( TInt aCoreResId );
       
   427 
       
   428     /**
       
   429     * Creates a new model for the status pane.
       
   430     *
       
   431     * @param  aCoreResId  ID of the status pane resource.
       
   432     *
       
   433     * @return Pointer to the new status pane model instance.
       
   434     */
       
   435     virtual CEikStatusPaneModelBase* CreateModelL( TInt aCoreResId ) const = 0;
       
   436 	
       
   437     /**
       
   438     * Creates the sub-panes to the status pane.
       
   439     */
       
   440     void CreatePanesL();
       
   441 	
       
   442     /**
       
   443     * Creates a sub-pane.
       
   444     *
       
   445     * @param[in]  aPaneInit  Initial values for the sub-pane.
       
   446     */
       
   447     void CreatePaneL( const TEikStatusPaneInit& aPaneInit );
       
   448 	
       
   449     /**
       
   450     * Gets a container of a specified sub-pane.
       
   451     *
       
   452     * @param  aPaneId  The sub-pane ID.
       
   453     *
       
   454     * @return Pointer to the container of the sub-pane with a given ID.
       
   455     */
       
   456     CEikStatusPaneContainer* Find( TPaneId aPaneId ) const;
       
   457 
       
   458     /**
       
   459     * Can be used to determine whether or not the status pane is on
       
   460     * application side or server side.
       
   461     *
       
   462     * @return @c ETrue if the status pane resides in the application side,
       
   463     *         @c EFalse if it's on the server side.
       
   464     */
       
   465     virtual TBool IsApp() const = 0;
       
   466 	
       
   467     /**
       
   468     * Gets the rectangle of the status pane.
       
   469     *
       
   470     * @return The rectangle used by the status pane.
       
   471     */
       
   472     inline TRect Rect() const;
       
   473 	
       
   474     /**
       
   475     * Calls @c CCoeControl's @c DrawNow() or @c DrawDeferred() to draw the 
       
   476     * status pane. If @c aDraw is @c ENoDraw status pane is not drawed.
       
   477     * 
       
   478     * @param  aDraw  Status pane drawing command.
       
   479     */
       
   480     void DoDrawNow( TDrawCmd aDraw );
       
   481 	
       
   482     /**
       
   483     * Gets the status pane clearer.
       
   484     *
       
   485     * @return Pointer to the status pane clearer instance.
       
   486     */
       
   487     CAknStatuspaneClearer* Clearer();
       
   488 	
       
   489     /**
       
   490     * Disables the status pane clearer. 
       
   491     *
       
   492     * @param  aDisabled  Disabled if @c ETrue.
       
   493     */
       
   494     IMPORT_C void DisableClearer( TBool aDisabled );
       
   495 	
       
   496     /**
       
   497     * Prepares the status pane for the application exit.
       
   498     * Clears the status pane.
       
   499     */
       
   500     IMPORT_C void CommonPrepareForAppExit();
       
   501 
       
   502 public:
       
   503     /**
       
   504      * Enable transparency of status pane and its contents.
       
   505      * From @c CEikStatusPaneBase.
       
   506      *
       
   507      * @param aTransparent If @c ETrue the status pane and its
       
   508      *                 contents are set aTransparent.
       
   509      */
       
   510     IMPORT_C void EnableTransparent( TBool aTransparent );
       
   511     
       
   512     /**
       
   513       * Gets the transparency of the status pane.
       
   514       * 
       
   515       * @return @c ETrue if the status pane is transparent.
       
   516       */
       
   517     IMPORT_C TBool IsTransparent() const;
       
   518     
       
   519 private:
       
   520 
       
   521     void DoSwitchLayoutL( TInt aLayoutResourceId, TDrawCmd aDraw );
       
   522     void ApplyLayoutL( CEikStatusPaneLayout* aLayout, TDrawCmd aDraw );
       
   523     void SetAllInvisible();
       
   524     void SetNotNeededInvisible();
       
   525 
       
   526 public:
       
   527     
       
   528     /**
       
   529     * Notifies the command button area and status pane observer about the
       
   530     * status pane size change. If the status pane is an embedded application,
       
   531     * also this application is notified.
       
   532     */
       
   533     void ReportSizeChange();
       
   534 
       
   535 private:
       
   536 
       
   537     class TSetRectAndVisibility : public MEikStatusPaneLayoutTreeVisitor
       
   538         {    
       
   539     public:
       
   540     
       
   541         TSetRectAndVisibility( TBool aIsApp, CEikStatusPaneBase* aStatusPane );
       
   542         void VisitL( CEikStatusPaneLayoutTree* aNode );
       
   543     
       
   544     private:
       
   545     
       
   546         TBool iIsApp;
       
   547         CEikStatusPaneBase* iStatusPane;
       
   548         };
       
   549 	
       
   550 	friend class TSetRectAndVisibility;
       
   551 
       
   552 private:
       
   553 
       
   554     void  SetLastUsedResourceId( TInt aResourceId );
       
   555     TInt  LastUsedResourceId();
       
   556     TInt  ReadInitialUsedResourceIdL( TInt aCoreResId );    
       
   557     TInt  InitialUsedResourceId();
       
   558     TRect LargestBoundingRect( TRegion& aWholeRegion,
       
   559                                TRegion& aRemovedRegion ) const;
       
   560     void SetCombinedPaneVisibilityL( TBool aVisible );
       
   561 
       
   562 protected:
       
   563 
       
   564     /**
       
   565     * Gets the status pane data subscriber.
       
   566     *
       
   567     * @return Pointer to the status pane data subscriber.
       
   568     */
       
   569 	CAknStatusPaneDataSubscriber* DataSubscriber() const;
       
   570 
       
   571     /**
       
   572     * Sets the initial status pane resource ID to an extension class 
       
   573     * @c CEikStatusPaneBaseExtension.
       
   574     *
       
   575     * @param  aResourceId  The initial status pane resource ID.
       
   576     */
       
   577     void SetInitialUsedResourceId( TInt aResourceId );
       
   578     
       
   579     /**
       
   580     * Optimizes the status pane region which cleared during
       
   581     * status pane layout change.
       
   582     *
       
   583     * @param         aOldResourceId  Old status pane resource ID.
       
   584     * @param         aNewResourceId  New status pane resource ID.
       
   585     * @param[in,out] aRegion         Status pane region.
       
   586     *                                On return contains only
       
   587     *                                the region that needs to be cleared.
       
   588     */
       
   589 	void OptimizeClearerWindowShape( TInt aOldResourceId,
       
   590 	                                 TInt aNewResourceId,
       
   591 	                                 TRegion& aRegion );
       
   592 
       
   593 	/**
       
   594 	* Sets redraw storing state of the window.
       
   595 	*
       
   596 	* @param  aWindow  The window whose redraw storing state is to be set.
       
   597 	* @param  aOn      @c ETrue to turn redraw storing on.
       
   598 	*/	
       
   599 	void SetStoreHandler( RWindow* aWindow, TBool aOn );
       
   600 
       
   601 protected:
       
   602 
       
   603     /**
       
   604     * An environment for creating controls and utility functions for 
       
   605     * manipulating them.
       
   606     */
       
   607     CEikonEnv& iEikEnv;
       
   608 	
       
   609     /**
       
   610     * Status pane model class. <br>
       
   611     * Own.
       
   612     */
       
   613     CEikStatusPaneModelBase* iModel;
       
   614 
       
   615     /**
       
   616     * Flags for the status pane.
       
   617     */
       
   618     TInt iFlags;
       
   619 
       
   620 protected:
       
   621 
       
   622 	typedef CArrayPtrFlat<CEikStatusPaneContainer> CContainerControls;
       
   623 	CContainerControls* iControls;
       
   624 	
       
   625 private:
       
   626 
       
   627 	MEikStatusPaneObserver* iObserver;
       
   628 	RWindowGroup* iParentWindowGroup;
       
   629 	CEikStatusPaneBaseExtension* iExtension;
       
   630 	};
       
   631 
       
   632 /**
       
   633  * Application side status pane class.
       
   634  *
       
   635  * @c CEikStatusPane is the interface through which applications use the
       
   636  * status pane. This class synchronises the status pane layout with the
       
   637  * server side status pane object. To do this, the @c ApplyCurrentSettingsL()
       
   638  * method must be called whenever the owner application switches to the
       
   639  * foreground.
       
   640  */
       
   641 NONSHARABLE_CLASS( CEikStatusPane ) : public CEikStatusPaneBase,
       
   642                                       public MCoeForegroundObserver
       
   643 	{
       
   644 public:
       
   645 
       
   646     /**
       
   647     * Two-phased constructor.
       
   648     *
       
   649     * @param  aEikEnv                    An environment for creating controls
       
   650     *                                    and utility functions for
       
   651     *                                    manipulating them.
       
   652     * @param  aParent                    Pointer to the parent window group.
       
   653     * @param  aCoreStatusPaneModelResId  Status pane core resource ID.
       
   654     * @param  aAppStatusPaneModelResId   Resource ID of the application's
       
   655     *                                    status pane.
       
   656     *
       
   657     * @return Pointer to the created @c CEikStatusPane object.
       
   658     */
       
   659 	IMPORT_C static CEikStatusPane* NewL(
       
   660         CEikonEnv& aEikEnv,
       
   661         RWindowGroup* aParent,
       
   662         TInt aCoreStatusPaneModelResId,
       
   663         TInt aAppStatusPaneModelResId = EEikStatusPaneUseDefaults );
       
   664 
       
   665     /**
       
   666     * Destructor.
       
   667     */
       
   668 	IMPORT_C ~CEikStatusPane();
       
   669     
       
   670     /**
       
   671     * Synchronises the server status pane layout with the
       
   672     * application status pane.
       
   673     */
       
   674 	IMPORT_C void ApplyCurrentSettingsL();
       
   675 	
       
   676 	/**
       
   677     * Prepares the status pane for the application exit.
       
   678     * Clears the status pane.
       
   679     */
       
   680 	IMPORT_C void PrepareForAppExit();
       
   681 
       
   682 	/**
       
   683     * Sets the visiblility of the status pane and its contents.
       
   684     * From @c CEikStatusPaneBase.
       
   685     *
       
   686     * @param aVisible If @c ETrue the status pane and its
       
   687     *                 contents are set visible.
       
   688     */
       
   689 	IMPORT_C virtual void MakeVisible( TBool aVisible );
       
   690 	
       
   691 	/**
       
   692     * Sets the status pane and its contents to dimmed state.
       
   693     * From @c CEikStatusPaneBase.
       
   694     *
       
   695     * @param aDimmed If @c ETrue the status pane and its
       
   696     *                contents are set to dimmed state.
       
   697     */
       
   698 	IMPORT_C virtual void SetDimmed( TBool aDimmed );
       
   699 	
       
   700 	/**
       
   701     * Not implemented.
       
   702     * From @c CEikStatusPaneBase.
       
   703     *
       
   704     * @param aFaded Not used.
       
   705     */
       
   706 	IMPORT_C virtual void SetFaded( TBool aFaded );
       
   707 	
       
   708 	/**
       
   709     * Handles changes in resources which are shared across the environment.
       
   710     * This function responds to the changes in resources by propagating them
       
   711     * to sub-parts of the status pane.
       
   712     * From @c CEikStatusPaneBase.
       
   713     *
       
   714     * @param  aType  A message type.
       
   715     */
       
   716 	IMPORT_C virtual void HandleResourceChange( TInt aType );
       
   717 	
       
   718 	/**
       
   719     * Returns always @c ETrue. 
       
   720     * From @c CEikStatusPaneBase.
       
   721     *
       
   722     * @return @c ETrue.
       
   723     */
       
   724 	IMPORT_C virtual TBool OkToChangeStatusPaneNow();
       
   725 
       
   726 private:
       
   727 
       
   728     /**
       
   729     * Default C++ constructor.
       
   730     *
       
   731     * @param  aEikEnv                    An environment for creating controls
       
   732     *                                    and utility functions for
       
   733     *                                    manipulating them.
       
   734     * @param  aParent                    Pointer to the parent window group.
       
   735     * @param  aAppStatusPaneModelResId   Resource ID of the application's
       
   736     *                                    status pane.
       
   737     */
       
   738 	CEikStatusPane( CEikonEnv& aEikEnv,
       
   739 	                RWindowGroup* aParent,
       
   740 	                TInt aAppStatusPaneModelId );
       
   741 
       
   742     /**
       
   743     * Second-phase constructor.
       
   744     *
       
   745     * @param  aCoreStatusPaneModelResId  Status pane core resource ID.
       
   746     */
       
   747 	void ConstructL( TInt aCoreStatusPaneModelResId );
       
   748 
       
   749     /**
       
   750     * Creates the application side status pane model.
       
   751     *
       
   752     * @param  aCoreResId  Status pane core resource ID.
       
   753     */
       
   754 	virtual CEikStatusPaneModelBase* CreateModelL( TInt aCoreResId ) const;
       
   755 	
       
   756 	/**
       
   757     * Can be used to determine whether or not the status pane is on
       
   758     * application side or server side.
       
   759     *
       
   760     * @return @c ETrue
       
   761     */
       
   762 	TBool IsApp() const;
       
   763 
       
   764     /**
       
   765     * Applies the current status pane flags.
       
   766     */
       
   767 	void ApplyCurrentFlags();
       
   768 	
       
   769 	/**
       
   770 	* Hides all the sub-panes owned by the application
       
   771 	* side status pane.
       
   772 	*/
       
   773 	void HideAppPanes( TBool aHide );
       
   774 
       
   775 private: // From base class @c MCoeForegroundObserver.
       
   776 
       
   777     /**
       
   778     * Handles foreground gain events.
       
   779     */
       
   780 	void HandleGainingForeground();
       
   781 	
       
   782 	/**
       
   783     * Handles foreground lose events.
       
   784     */
       
   785 	void HandleLosingForeground();
       
   786 	
       
   787 private:
       
   788 	
       
   789 	/**
       
   790     * Reads the initial status pane layout from the status pane resources.
       
   791     *
       
   792     * @param  aCoreResId                Status pane core resource ID.
       
   793     * @param  aAppStatusPaneModelResId  Resource ID specified by the
       
   794     *                                   application.
       
   795     */
       
   796     TInt ReadInitialUsedResourceIdL( TInt aCoreResId,
       
   797                                      TInt aAppStatusPaneModelResId );
       
   798 
       
   799     /**
       
   800     * Handles foreground lose events.
       
   801     */
       
   802     void DoHandleLosingForegroundL();
       
   803 
       
   804 private:
       
   805 
       
   806 	TInt iAppDeclId;
       
   807 	
       
   808 	/** Formerly TEikStatusPaneSyncDrawer* iSyncDrawer */
       
   809 	TAny* iSpare;
       
   810 	
       
   811 	/** Formerly iServerSpWgId */
       
   812 	CAknDelayedForegroundObserver* iDelayedForegroundObserver;
       
   813 	};
       
   814 
       
   815 /**
       
   816 * Checks if the pane exists in this status pane.
       
   817 * Note: this will return @c ETrue if the pane can be used,
       
   818 * even if it is not visible.
       
   819 */
       
   820 inline TBool CEikStatusPaneBase::TPaneCapabilities::IsPresent() const
       
   821     {
       
   822     return iFlags & KStatusPaneCapsPresentBit;
       
   823     }
       
   824     
       
   825 /**
       
   826 * Checks if this pane is owned by application rather than the server.
       
   827 * Applications can only interact directly with application owned panes.
       
   828 */
       
   829 inline TBool CEikStatusPaneBase::TPaneCapabilities::IsAppOwned() const
       
   830     {
       
   831     return iFlags & KStatusPaneCapsAppOwnedBit;
       
   832     }
       
   833     
       
   834 /**
       
   835 * Checks if this pane is part of the current status pane layout.
       
   836 */
       
   837 inline TBool CEikStatusPaneBase::TPaneCapabilities::IsInCurrentLayout() const
       
   838     {
       
   839     return iFlags & KStatusPaneCapsInCurrentLayoutBit;
       
   840     }
       
   841 
       
   842 /**
       
   843 * Set the status pane observer.
       
   844 */
       
   845 inline void CEikStatusPaneBase::SetObserver( MEikStatusPaneObserver* aObserver )
       
   846     {
       
   847     iObserver = aObserver;
       
   848     }
       
   849 
       
   850 /**
       
   851 * Gets the status pane rectangle.
       
   852 */
       
   853 inline TRect CEikStatusPaneBase::Rect() const
       
   854     {
       
   855     return iModel->CurrentLayout()->Rect();
       
   856     }
       
   857 
       
   858 /**
       
   859 * Gets the window group that this status pane belongs to.
       
   860 */
       
   861 inline RWindowGroup* CEikStatusPaneBase::WindowGroup() const
       
   862     {
       
   863     return iParentWindowGroup;
       
   864     }
       
   865 
       
   866 #endif // __EIKSPANE_H__