S60 3rd Edition API Reference: eikspane.h Source File

eikspane.h

Go to the documentation of this file.
00001 // EIKSPANE.H
00002 //
00003 // Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
00004 //
00005 
00006 #if !defined(__EIKSPANE_H__)
00007 #define __EIKSPANE_H__
00008 
00009 #if !defined(__EIKSPMOD_H__)
00010 #include <eikspmod.h>
00011 #endif
00012 
00013 #if !defined(__COECNTRL_H__)
00014 #include <coecntrl.h>
00015 #endif
00016 
00017 #if !defined(__COECOBS_H__)
00018 #include <coecobs.h>
00019 #endif
00020 
00021 class CCoeBrushAndPenContext;
00022 class CEikStatusPaneContainer;
00023 class TEikStatusPaneSyncDrawer;
00024 class CEikStatusPaneBaseExtension;
00025 class CAknStatuspaneClearer;
00026 #start_since SINCE_3_1_SDK
00027 class CAknDelayedForegroundObserver;
00028 #end_since SINCE_3_1_SDK
00029 
00030 const TInt KStatusPaneCapsPresentBit = 1;
00031 const TInt KStatusPaneCapsAppOwnedBit = 2;
00032 const TInt KStatusPaneCapsInCurrentLayoutBit = 4;
00033 
00034 
00041 class MEikStatusPaneObserver
00042         {
00043 public:
00044         virtual void HandleStatusPaneSizeChange() = 0;
00045         };
00046 
00050 class CEikStatusPaneBase : public CBase
00051         {
00052 
00053 public:
00054 
00058     class TPaneCapabilities
00059         {
00060 
00061     public:
00062         
00066         TPaneCapabilities();
00067         
00074         inline TBool IsPresent() const;
00075         
00083         inline TBool IsAppOwned() const;
00084         
00090         inline TBool IsInCurrentLayout() const;
00091 
00092     private:
00093 
00094         inline void SetPresent();
00095         inline void SetAppOwned();
00096         inline void SetInCurrentLayout();
00097 
00098     private:
00099 
00100         TInt iFlags;
00101 
00102     private:
00103 
00104         friend class CEikStatusPaneBase;
00105         };
00106 
00107 public:
00108 
00112     IMPORT_C ~CEikStatusPaneBase();
00113 
00121     IMPORT_C static CEikStatusPaneBase* Current();
00122         
00128     inline void SetObserver(MEikStatusPaneObserver* aObserver);
00129         
00141     IMPORT_C void ReduceRect(TRect& aBoundingRect) const;
00142         
00153     IMPORT_C void GetShapeL(TRegion& aRegion, 
00154                             TBool aIncludeAppPanes, 
00155                             TBool aIncludeServerPanes) const;
00156 
00165     IMPORT_C virtual void SwitchLayoutL(TInt aLayoutResourceId);
00166         
00173     IMPORT_C virtual void MakeVisible(TBool aVisible);
00174         
00181     IMPORT_C virtual void SetDimmed(TBool aDimmed);
00182         
00188     IMPORT_C virtual void SetFaded(TBool aFaded);
00189         
00197     IMPORT_C virtual void HandleResourceChange(TInt aType);
00198         
00204     IMPORT_C virtual TBool OkToChangeStatusPaneNow();
00205 
00212     IMPORT_C void SetFlags(TInt aFlags);
00213         
00219     IMPORT_C TInt Flags() const;
00220         
00226     IMPORT_C TBool IsVisible() const;
00227         
00233     IMPORT_C TBool IsDimmed() const;
00234         
00240     IMPORT_C TBool IsFaded() const;
00241 
00248     IMPORT_C TPaneCapabilities PaneCapabilities(TPaneId aPaneId) const;
00249         
00259     IMPORT_C TRect PaneRectL(TPaneId aPaneId) const;
00260         
00269     IMPORT_C CCoeControl* ControlL(TPaneId aPaneId) const;
00270         
00283     IMPORT_C CCoeControl* SwapControlL(TPaneId aPaneId,
00284                                        CCoeControl* aNewControl);
00285         
00298     IMPORT_C CCoeControl* ContainerControlL(TPaneId aPaneId) const;
00299         
00305     inline RWindowGroup* WindowGroup() const;
00306         
00310     IMPORT_C void DrawNow();
00311         
00317     IMPORT_C TInt CurrentLayoutResId() const;
00318 
00319 protected:
00320 
00328     IMPORT_C CEikStatusPaneBase(CEikonEnv& aEikEnv, RWindowGroup* aParent);
00329         
00335     IMPORT_C void BaseConstructL(TInt aCoreResId);
00336 
00343     virtual CEikStatusPaneModelBase* CreateModelL(TInt aCoreResId) const = 0;
00344         
00348     void CreatePanesL();
00349         
00355     void CreatePaneL(const TEikStatusPaneInit& aPaneInit);
00356         
00363     CEikStatusPaneContainer* Find(TPaneId aPaneId) const;
00364 
00368     virtual TBool IsApp() const = 0;
00369         
00375     inline TRect Rect() const;
00376 
00380     enum TDrawCmd 
00381         { 
00383         ENoDraw, 
00384 
00386         EDrawNow, 
00387         
00389         EDrawDeferred 
00390         };
00391         
00398     void DoDrawNow(TDrawCmd aDraw);
00399         
00405     CAknStatuspaneClearer* Clearer();
00406         
00412     IMPORT_C void DisableClearer(TBool aDisabled);
00413         
00418     IMPORT_C void CommonPrepareForAppExit();
00419 
00420 private:
00421 
00422     void DoSwitchLayoutL(TInt aLayoutResourceId, TDrawCmd aDraw);
00423     void ApplyLayoutL(CEikStatusPaneLayout* aLayout, TDrawCmd aDraw);
00424     void SetAllInvisible();
00425     void SetNotNeededInvisible();
00426 
00427 public:
00428     
00434     void ReportSizeChange();
00435 
00436 private:
00437 
00438     class TSetRectAndVisibility : public MEikStatusPaneLayoutTreeVisitor
00439         {
00440     
00441     public:
00442     
00443         TSetRectAndVisibility(TBool aIsApp, CEikStatusPaneBase* aStatusPane);
00444         void VisitL(CEikStatusPaneLayoutTree* aNode);
00445     
00446     private:
00447     
00448         TBool iIsApp;
00449         CEikStatusPaneBase* iStatusPane;
00450         };
00451         
00452         friend class TSetRectAndVisibility;
00453 
00454 private:
00455 
00456     void SetLastUsedResourceId(TInt aResourceId);
00457     TInt LastUsedResourceId();
00458     TInt ReadInitialUsedResourceIdL(TInt aCoreResId);    
00459     TInt InitialUsedResourceId();
00460     TRect LargestBoundingRect(TRegion& aWholeRegion,
00461                               TRegion& aRemovedRegion) const;
00462 
00463 protected:
00464 
00465 
00472     void SetInitialUsedResourceId(TInt aResourceId);
00473 #start_since SINCE_3_1_SDK
00474 
00477         void OptimizeClearerWindowShape(TInt aOldResourceId, TInt aNewResourceId, TRegion& aRegion);
00478 #end_since SINCE_3_1_SDK
00479 
00480 
00481 protected:
00482 
00487     CEikonEnv& iEikEnv;
00488         
00493     CEikStatusPaneModelBase* iModel;
00494 
00498     TInt iFlags;
00499 #start_since SINCE_3_1_SDK
00500 
00501 protected:
00502 
00506         typedef CArrayPtrFlat<CEikStatusPaneContainer> CContainerControls;
00510         CContainerControls* iControls;
00511 #end_since SINCE_3_1_SDK
00512 private:
00513         MEikStatusPaneObserver* iObserver;
00514         RWindowGroup* iParentWindowGroup;
00515         CEikStatusPaneBaseExtension* iExtension;
00516         };
00517 
00524 NONSHARABLE_CLASS(CEikStatusPane) : public CEikStatusPaneBase, public MCoeForegroundObserver
00525         {
00526 public:
00527         IMPORT_C static CEikStatusPane* NewL(CEikonEnv& aEikEnv, RWindowGroup* aParent, TInt aCoreStatusPaneModelResId, TInt aAppStatusPaneModelResId=EEikStatusPaneUseDefaults);
00528         IMPORT_C ~CEikStatusPane();
00529 
00530         IMPORT_C void ApplyCurrentSettingsL();
00531         IMPORT_C void PrepareForAppExit();
00532 
00533         // from CEikStatusPaneBase
00534         IMPORT_C virtual void MakeVisible(TBool aVisible);
00535         IMPORT_C virtual void SetDimmed(TBool aDimmed);
00536         IMPORT_C virtual void SetFaded(TBool aFaded);
00537         IMPORT_C virtual void HandleResourceChange(TInt aType);
00538         IMPORT_C virtual TBool OkToChangeStatusPaneNow();
00539 
00540 private:
00541         CEikStatusPane(CEikonEnv& aEikEnv, RWindowGroup* aParent, TInt aAppStatusPaneModelId);
00542         void ConstructL(TInt aCoreStatusPaneModelResId);
00543 
00544         virtual CEikStatusPaneModelBase* CreateModelL(TInt aCoreResId) const;
00545         TBool IsApp() const;
00546 
00547         void ApplyCurrentFlags();
00548         void HideAppPanes(TBool aHide);
00549 
00550 private: // from MCoeForegroundObserver
00551         void HandleGainingForeground();
00552         void HandleLosingForeground();
00553 private:        
00554     TInt ReadInitialUsedResourceIdL(TInt aCoreResId, TInt aAppStatusPaneModelResId);
00555     void DoHandleLosingForegroundL();
00556 
00557 private:
00558         TInt iAppDeclId;
00559         TEikStatusPaneSyncDrawer* iSyncDrawer;  // formerly CPeriodic* iTimer;
00560         CAknDelayedForegroundObserver*iDelayedForegroundObserver;       // formerly iServerSpWgId;
00561         };
00562 
00563 
00564 
00565 
00566 
00567 
00572 inline TBool CEikStatusPaneBase::TPaneCapabilities::IsPresent() const { return iFlags & KStatusPaneCapsPresentBit; }
00577 inline TBool CEikStatusPaneBase::TPaneCapabilities::IsAppOwned() const { return iFlags & KStatusPaneCapsAppOwnedBit; }
00581 inline TBool CEikStatusPaneBase::TPaneCapabilities::IsInCurrentLayout() const { return iFlags & KStatusPaneCapsInCurrentLayoutBit; }
00585 inline void CEikStatusPaneBase::SetObserver(MEikStatusPaneObserver* aObserver) { iObserver = aObserver; }
00586 inline TRect CEikStatusPaneBase::Rect() const { return iModel->CurrentLayout()->Rect(); }
00587 inline RWindowGroup* CEikStatusPaneBase::WindowGroup() const { return iParentWindowGroup; }
00588 
00589 #endif

Copyright © Nokia Corporation 2001-2007
Back to top