libcdos-fw
CFScrolledView.h
1 // Copyright 2017, CDOS.
2 // All rights reserved.
3 //
4 // Author: CDOS Support Team <support_os@sari.ac.cn>
5 //
6 // Adds scrollbars to its child widget.
7 #ifndef __CF_SCROLLEDVIEW_H__
8 #define __CF_SCROLLEDVIEW_H__
9 
10 #include <Gui/CFBin.h>
11 #include <Gui/CFAdjustment.h>
12 #include "Gui/CFScrollbar.h"
13 #include "Gui/CFEnums.h"
14 
15 CF_NAMESPACE_BEGIN
16 
17 class CFScrolledViewPriv;
18 
19 class CFScrolledView : public CFBin {
20 public:
22 
23  virtual ~CFScrolledView();
24 
25  // CFScrolledView(CFAdjustment& hadjustment, CFAdjustment& vadjustment);
26 
27  // void setHadjustment(CFAdjustment& hadjustment);
28 
29  // CFAdjustment getHajustment();
30 
31  // void setVadjustment(CFAdjustment& vhadjustment);
32 
33  // CFAdjustment getVajustment();
34 
35  void setPolicy(CFPolicyType hscrollbar_pollcy,
36  CFPolicyType vscrollbar_pollcy);
37 
38  void getPolicy(CFPolicyType& hscrollbar_pollcy,
39  CFPolicyType& vscrollbar_pollcy);
40 
41  void setPlacement(CFCornerType window_placement);
42 
43  void unsetPlacement();
44 
45  CFCornerType getPlacement();
46 
47  void setShadowType(CFShadowType type);
48 
49  CFShadowType getShadowType();
50 
51  void add(CFWidget& widget); // override Cdos::CFConter::add
52 
53  void removeWithViewport();
54 
55  CFScrollbar* getVscrollbar();
56 
57  CFScrollbar* setHscrollbar();
58 
59  int getMinContentWidth();
60 
61  void setMinContentWidth(int width);
62 
63  int getMinContentHeight();
64 
65  void setMinContentHeight(int height);
66 
67  void setKineticScrolling(bool kinetic_scrolling = true);
68 
69  bool getKineticScrolling();
70 
71  void setCaptureButtonPress(bool capture_button_press);
72 
73  bool getCaptureButtonPress();
74 
75  void setOverlayScrolling(bool overlay_scrolling);
76 
77  bool getOverlayScrolling();
78 
79  void setMaxContentWidth(int width);
80 
81  int getMaxContentWidth();
82 
83  void setMaxContentHeight(int height);
84 
85  int getMaxContentHeight();
86 
87  void setPropagateNaturalWidth(bool propagate = true);
88 
89  bool getPropagateNaturalWidth();
90 
91  void setPropagateNaturalHeight(bool propagate = true);
92 
93  bool getPropagateNaturalHeight();
94 
95  sigc::signal<void, CFPositionType> signalEdgeOvershot();
96 
97  sigc::signal<void, CFPositionType> signalEdgeReached();
98 
99 protected:
100  virtual void onRealObjectInit();
101 
102  virtual void onRealObjectFinalize();
103 
104 private:
105  sigc::signal<void, CFPositionType> m_edgeOvershotSignal;
106 
107  sigc::signal<void, CFPositionType> m_edgeReachedSignal;
108 
109  CFScrolledViewPriv* m_priv;
110 };
111 
112 CF_NAMESPACE_END
113 #endif // __CF_SCROLLEDVIEW_H__
CFCornerType
决定子容器应该被放置在 CFScrollWindow 的哪个角落 这个位置是与滚动条相反的。
Definition: CFEnums.h:129
所有可视控件的基类,抽象类。
Definition: CFWidget.h:25
CFBin 一个只允许容纳一个控件的容器类.
Definition: CFBin.h:14
Definition: CFScrollbar.h:17
Definition: CFScrolledView.h:19
virtual void onRealObjectInit()
对象绑定后进行初始化的回调函数。
virtual void onRealObjectFinalize()
对象解除绑定前的回调函数。
CFPolicyType
确定应如何计算大小以实现滚动条的可见性模式
Definition: CFEnums.h:113
CFShadowType
通常用于更改轮廓的外观
Definition: CFEnums.h:141