eiksbfrm.h

Go to the documentation of this file.
00001 // EIKSBFRM.H
00002 //
00003 // Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
00004 //
00005         
00006 #if !defined(__EIKSBFRM_H__)
00007 #define __EIKSBFRM_H__
00008 
00009 #include <lafpublc.h>
00010 #if !defined(__AKNSCRLB_H__)
00011 #include <aknscrlb.h>
00012 #endif
00013  
00014 class CEikCba;
00015 
00019 class TEikScrollBarFrameLayout
00020     {
00021 
00022 public:
00023 
00028     enum TTilingMode
00029         {
00030 
00032         EClientRectConstant,
00033 
00035         EInclusiveRectConstant
00036         };
00037 
00038 public:
00039 
00043     IMPORT_C TEikScrollBarFrameLayout();
00044 
00050     IMPORT_C void SetInclusiveMargin(TInt aMargin);
00051 
00058     IMPORT_C void SetClientMargin(TInt aMargin);
00059 
00060 public:
00061 
00063     TMargins iInclusiveMargin;
00064 
00069     TMargins iClientMargin;
00070 
00075     TSize iClientAreaGranularity;
00076 
00081     TTilingMode iTilingMode;
00082     };
00083 
00084 
00085 class CEikCornerWindow;
00086 class CEikScrollBarFrameExtension;
00087 
00099 class CEikScrollBarFrame : public CBase
00100     {
00101         
00102 public: // enums 
00103 
00104     DECLARE_TYPE_ID(0x101F8672)   
00105 
00106     
00107     enum TScrollBarVisibility
00108         {
00110         EOff,
00111 
00113         EOn,
00114 
00116         EAuto
00117         };
00118 
00120     enum TScrollBarType
00121         {
00123         ENormalScrollBar =0x0,
00124 
00126         EArrowHead =0x200,
00127 
00129         EDoubleSpan =0x400
00130         };
00131 
00133     enum TScrollBarSide
00134         {
00139         EBottomOrRight =0x0,
00140 
00145         ETopOrLeft =0x800
00146         };
00147                 
00149     enum TScrollBarManagement 
00150         {
00157         EComponent                  ,//=SLafScrollBarFrame::EComponent,
00158 
00167         EFloating                   ,//=SLafScrollBarFrame::EFloating,
00168 
00174         EApplicationScrollBar       //=SLafScrollBarFrame::EApplicationScrollBar
00175         };
00176 
00181     enum TScrollBarFrameFlags
00182         {
00184         EHVisible           =0x01,
00185 
00187         EVVisible           =0x02,
00188         };
00189 private:
00190     enum TMarginsAdjustmentMode
00191         {
00192         EGrow,
00193         EShrink
00194         };
00195 
00196 public: // specific
00197 
00201     CEikScrollBarFrame(){}
00202 
00210     IMPORT_C CEikScrollBarFrame(CCoeControl* aParentWindow, 
00211                                 MEikScrollBarObserver* aObserver, 
00212                                 TBool aPreAlloc=EFalse);
00213 
00217     IMPORT_C ~CEikScrollBarFrame();
00218 
00230     CEikScrollBarFrame(CCoeControl* aParentWindow, 
00231                        MEikScrollBarObserver* aObserver, 
00232                        TBool aPreAlloc, 
00233                        TBool aDoubleSpan);
00234 
00242     void InitExtension(CCoeControl* aParentWindow, 
00243                        MEikScrollBarObserver* aObserver);
00244 
00249     IMPORT_C void DrawScrollBarsNow() const;
00250 
00254     void DrawScrollBarsDeferred() const;
00255 
00263     IMPORT_C void SetScrollBarVisibilityL(TScrollBarVisibility aHVisibility, 
00264                                           TScrollBarVisibility aVVisibility);
00265 
00274     inline TScrollBarVisibility VScrollBarVisibility() const;
00275 
00281     IMPORT_C void SetScrollBarFrameObserver(MEikScrollBarObserver* aObserver);
00282 
00283     // Model setting. 
00284 
00292     IMPORT_C TBool Tile(TEikScrollBarModel* aVModel);
00293 
00331     IMPORT_C TBool TileL(TEikScrollBarModel* aHModel, 
00332                          TEikScrollBarModel* aVModel,
00333                          TRect& aClientRect,
00334                          TRect& aInclusiveRect,
00335                          const TEikScrollBarFrameLayout& aLayout);
00336 
00347     IMPORT_C void MoveThumbsBy(TInt aDeltaX, TInt aDeltaY);
00348 
00357     IMPORT_C void MoveHorizThumbTo(TInt aHorizThumbPos);
00358 
00367     IMPORT_C void MoveVertThumbTo(TInt aVertThumbPos);
00368 
00377     IMPORT_C void SetVFocusPosToThumbPos(TInt aFocusPosition);
00378 
00388     IMPORT_C TInt ScrollBarBreadth(
00389         CEikScrollBar::TOrientation aOrientation) const;
00390 
00391     // scroll bar frame behavior functions
00392 
00398     IMPORT_C void SetAdjustsHorizontalModel(TBool aAdjusts); 
00399 
00405     IMPORT_C void SetAdjustsVerticalModel(TBool aAdjusts);
00406 
00412     inline void SetScrollBarFrameFlags(TInt aMask);
00413 
00420     IMPORT_C TBool ScrollBarExists(
00421         CEikScrollBar::TOrientation aOrientation) const;
00422 
00430     IMPORT_C TInt CountComponentControls() const;
00431 
00442     IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
00443 
00453     IMPORT_C CEikScrollBar* GetScrollBarHandle(
00454         CEikScrollBar::TOrientation aOrientation) const;
00455 
00461     IMPORT_C CEikScrollBar* VerticalScrollBar() const;
00462 
00469     IMPORT_C void SetTypeOfHScrollBar(TScrollBarType aType);
00470 
00477     IMPORT_C void SetTypeOfVScrollBar(TScrollBarType aType);
00478 
00484     IMPORT_C TScrollBarType TypeOfHScrollBar() const;
00485 
00491     IMPORT_C TScrollBarType TypeOfVScrollBar() const;
00492 
00499     IMPORT_C TBool IsArrowHeadScrollBar(TInt aFlag) const;
00500 
00501     // application scroll bar utilities
00502 
00509     void DisconnectExternalScrollBar(CEikScrollBar* aScrollBar);
00510 
00551     IMPORT_C void CreateDoubleSpanScrollBarsL(TBool aWindowOwning, 
00552                                               TBool aRemote);
00553 
00574     IMPORT_C void CreateDoubleSpanScrollBarsL(TBool aWindowOwning, 
00575                                               TBool aRemote, 
00576                                               TBool aVertical, 
00577                                               TBool aHorizontal);
00578 
00598     IMPORT_C void Tile(TEikScrollBarModel* aVModel, TRect& aVScrollBar);
00599 
00608     IMPORT_C void Tile(TEikScrollBarModel* aHModel,
00609                        TEikScrollBarModel* aVModel);
00610 
00622     IMPORT_C TScrollBarVisibility ScrollBarVisibility(
00623             CEikScrollBar::TOrientation aOrientation) const;
00639         IMPORT_C TInt DrawBackground(TBool aDrawHorizontal, TBool aDrawVertical);
00640         
00656         IMPORT_C TInt DrawBackgroundState(TBool& aDrawHorizontal, TBool& aDrawVertical);
00657 
00658 public:
00659 
00665     CEikScrollBar* HorizontalScrollBar() const;
00666     
00672     MEikScrollBarObserver* ScrollBarFrameObserver();
00673 
00674 protected:
00675     // Accessor methods
00676 
00682     void SetParentWindow(CCoeControl* aParentWindow);
00683 
00689     CCoeControl* ParentWindow() const;
00690 
00691 protected:
00692    
00694     struct SBarData
00695         {
00696 
00698         CAknScrollBar* iBar;
00699 
00701         TEikScrollBarModel iModel;
00702 
00704         TScrollBarVisibility iVisibility;
00705 
00707         TBool iExternalScrollBarAttached;
00708         };
00709 
00710 private:
00711 
00712     void CalcTheoreticalScrollBarVisibility(const TEikScrollBarModel* aVModel);
00713     void ApplyModel(SBarData& aSBar);
00714     void MakeSBarVisible(SBarData& aSBar, TBool aVisible);
00715     void GetScrollBars(TBool aDoubleSpan);
00716     CEikCba* GetCurrentCba();
00717     void DeleteScrollBars();
00718     void CreateArrowHeadScrollBarsL();
00719 
00720     void CalcTheoreticalScrollBarVisibility(const TEikScrollBarModel* aVModel,
00721                                             const TEikScrollBarModel* aHModel);
00722 
00723 protected:
00724 
00726     SBarData iV;
00727 
00728 private:
00729 
00730     CEikScrollBarFrameExtension* iExtension; 
00731     TInt iScrollBarFrameFlags;
00732 
00733     friend class CEikScrollBarFrameExtension;
00734     };
00735 
00736 inline CEikScrollBarFrame::TScrollBarVisibility CEikScrollBarFrame::VScrollBarVisibility() const
00737     { return iV.iVisibility; }
00738 inline void CEikScrollBarFrame::SetScrollBarFrameFlags(TInt aMask)
00739     { iScrollBarFrameFlags|=aMask; }
00740 
00741 // Cba scroll bar frame (with it's own scrollbar creation methods)
00742 class CEikCbaScrollBarFrame : public CEikScrollBarFrame
00743     {
00744 public:
00745     CEikCbaScrollBarFrame(CCoeControl* aParentWindow, MEikScrollBarObserver* aObserver, TBool aPreAlloc=EFalse);
00746     void ConstructL();
00747     void SwitchToArrowHeadScrollBarL();  // 
00748     };
00749 
00750 #endif

Copyright © Nokia Corporation 2001-2008
Back to top