00001
00002
00003
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:
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 ,
00158
00167 EFloating ,
00168
00174 EApplicationScrollBar
00175 };
00176
00181 enum TScrollBarFrameFlags
00182 {
00184 EHVisible =0x01,
00185
00187 EVVisible =0x02,
00188
00193 EEnableNudgeButtons = 0x04,
00194
00200 EDisableExpandedTouchArea = 0x08
00201 };
00202 private:
00203 enum TMarginsAdjustmentMode
00204 {
00205 EGrow,
00206 EShrink
00207 };
00208
00209 public:
00210
00214 CEikScrollBarFrame(){}
00215
00223 IMPORT_C CEikScrollBarFrame(CCoeControl* aParentWindow,
00224 MEikScrollBarObserver* aObserver,
00225 TBool aPreAlloc=EFalse);
00226
00230 IMPORT_C ~CEikScrollBarFrame();
00231
00243 CEikScrollBarFrame(CCoeControl* aParentWindow,
00244 MEikScrollBarObserver* aObserver,
00245 TBool aPreAlloc,
00246 TBool aDoubleSpan);
00247
00255 void InitExtension(CCoeControl* aParentWindow,
00256 MEikScrollBarObserver* aObserver);
00257
00262 IMPORT_C void DrawScrollBarsNow() const;
00263
00267 void DrawScrollBarsDeferred() const;
00268
00276 IMPORT_C void SetScrollBarVisibilityL(TScrollBarVisibility aHVisibility,
00277 TScrollBarVisibility aVVisibility);
00278
00287 inline TScrollBarVisibility VScrollBarVisibility() const;
00288
00294 IMPORT_C void SetScrollBarFrameObserver(MEikScrollBarObserver* aObserver);
00295
00296
00297
00305 IMPORT_C TBool Tile(TEikScrollBarModel* aVModel);
00306
00344 IMPORT_C TBool TileL(TEikScrollBarModel* aHModel,
00345 TEikScrollBarModel* aVModel,
00346 TRect& aClientRect,
00347 TRect& aInclusiveRect,
00348 const TEikScrollBarFrameLayout& aLayout);
00349
00360 IMPORT_C void MoveThumbsBy(TInt aDeltaX, TInt aDeltaY);
00361
00370 IMPORT_C void MoveHorizThumbTo(TInt aHorizThumbPos);
00371
00380 IMPORT_C void MoveVertThumbTo(TInt aVertThumbPos);
00381
00390 IMPORT_C void SetVFocusPosToThumbPos(TInt aFocusPosition);
00391
00401 IMPORT_C TInt ScrollBarBreadth(
00402 CEikScrollBar::TOrientation aOrientation) const;
00403
00404
00405
00411 IMPORT_C void SetAdjustsHorizontalModel(TBool aAdjusts);
00412
00418 IMPORT_C void SetAdjustsVerticalModel(TBool aAdjusts);
00419
00425 inline void SetScrollBarFrameFlags(TInt aMask);
00426
00433 IMPORT_C TBool ScrollBarExists(
00434 CEikScrollBar::TOrientation aOrientation) const;
00435
00443 IMPORT_C TInt CountComponentControls() const;
00444
00455 IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
00456
00466 IMPORT_C CEikScrollBar* GetScrollBarHandle(
00467 CEikScrollBar::TOrientation aOrientation) const;
00468
00474 IMPORT_C CEikScrollBar* VerticalScrollBar() const;
00475
00482 IMPORT_C void SetTypeOfHScrollBar(TScrollBarType aType);
00483
00490 IMPORT_C void SetTypeOfVScrollBar(TScrollBarType aType);
00491
00497 IMPORT_C TScrollBarType TypeOfHScrollBar() const;
00498
00504 IMPORT_C TScrollBarType TypeOfVScrollBar() const;
00505
00512 IMPORT_C TBool IsArrowHeadScrollBar(TInt aFlag) const;
00513
00514
00515
00522 void DisconnectExternalScrollBar(CEikScrollBar* aScrollBar);
00523
00564 IMPORT_C void CreateDoubleSpanScrollBarsL(TBool aWindowOwning,
00565 TBool aRemote);
00566
00587 IMPORT_C void CreateDoubleSpanScrollBarsL(TBool aWindowOwning,
00588 TBool aRemote,
00589 TBool aVertical,
00590 TBool aHorizontal);
00591
00611 IMPORT_C void Tile(TEikScrollBarModel* aVModel, TRect& aVScrollBar);
00612
00621 IMPORT_C void Tile(TEikScrollBarModel* aHModel,
00622 TEikScrollBarModel* aVModel);
00623
00635 IMPORT_C TScrollBarVisibility ScrollBarVisibility(
00636 CEikScrollBar::TOrientation aOrientation) const;
00652 IMPORT_C TInt DrawBackground(TBool aDrawHorizontal, TBool aDrawVertical);
00653
00669 IMPORT_C TInt DrawBackgroundState(TBool& aDrawHorizontal, TBool& aDrawVertical);
00670
00671 public:
00672
00678 CEikScrollBar* HorizontalScrollBar() const;
00679
00685 MEikScrollBarObserver* ScrollBarFrameObserver();
00686
00687 protected:
00688
00689
00695 void SetParentWindow(CCoeControl* aParentWindow);
00696
00702 CCoeControl* ParentWindow() const;
00703
00704 protected:
00705
00707 struct SBarData
00708 {
00709
00711 CAknScrollBar* iBar;
00712
00714 TEikScrollBarModel iModel;
00715
00717 TScrollBarVisibility iVisibility;
00718
00720 TBool iExternalScrollBarAttached;
00721 };
00722
00723 private:
00724
00725 void CalcTheoreticalScrollBarVisibility(const TEikScrollBarModel* aVModel);
00726 void ApplyModel(SBarData& aSBar);
00727 void MakeSBarVisible(SBarData& aSBar, TBool aVisible);
00728 void GetScrollBars(TBool aDoubleSpan);
00729 CEikCba* GetCurrentCba();
00730 void DeleteScrollBars();
00731 void CreateArrowHeadScrollBarsL();
00732
00733 void CalcTheoreticalScrollBarVisibility(const TEikScrollBarModel* aVModel,
00734 const TEikScrollBarModel* aHModel);
00735
00736 protected:
00737
00739 SBarData iV;
00740
00741 private:
00742
00743 CEikScrollBarFrameExtension* iExtension;
00744 TInt iScrollBarFrameFlags;
00745
00746 friend class CEikScrollBarFrameExtension;
00747 };
00748
00749 inline CEikScrollBarFrame::TScrollBarVisibility CEikScrollBarFrame::VScrollBarVisibility() const
00750 { return iV.iVisibility; }
00751 inline void CEikScrollBarFrame::SetScrollBarFrameFlags(TInt aMask)
00752 { iScrollBarFrameFlags|=aMask; }
00753
00754
00755 class CEikCbaScrollBarFrame : public CEikScrollBarFrame
00756 {
00757 public:
00758 CEikCbaScrollBarFrame(CCoeControl* aParentWindow, MEikScrollBarObserver* aObserver, TBool aPreAlloc=EFalse);
00759 void ConstructL();
00760 void SwitchToArrowHeadScrollBarL();
00761 };
00762
00763 #endif