summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_scrollbar.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-10 10:25:32 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-10 10:25:32 -0800
commit12f72bfc06198fcddf86f366adbbdeb152163b0e (patch)
tree61c3b3859382950e75fc8044639d3e9cea10cf16 /xfa/fwl/core/ifwl_scrollbar.h
parentbe6b14899381d31628887d3cf4af086a3acb7eef (diff)
downloadpdfium-12f72bfc06198fcddf86f366adbbdeb152163b0e.tar.xz
Continue cleaning IFWL classes
More work cleaning up visiblity, unused methods and return values. Review-Url: https://codereview.chromium.org/2489013002
Diffstat (limited to 'xfa/fwl/core/ifwl_scrollbar.h')
-rw-r--r--xfa/fwl/core/ifwl_scrollbar.h95
1 files changed, 48 insertions, 47 deletions
diff --git a/xfa/fwl/core/ifwl_scrollbar.h b/xfa/fwl/core/ifwl_scrollbar.h
index 07393a9040..78164fd50a 100644
--- a/xfa/fwl/core/ifwl_scrollbar.h
+++ b/xfa/fwl/core/ifwl_scrollbar.h
@@ -9,7 +9,6 @@
#include "core/fxcrt/fx_system.h"
#include "xfa/fwl/core/cfwl_widgetproperties.h"
-#include "xfa/fwl/core/fwl_error.h"
#include "xfa/fwl/core/ifwl_dataprovider.h"
#include "xfa/fwl/core/ifwl_timer.h"
#include "xfa/fwl/core/ifwl_widget.h"
@@ -51,21 +50,25 @@ class IFWL_ScrollBar : public IFWL_Widget {
void OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) override;
- bool IsVertical();
- FWL_Error GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax);
- FWL_Error SetRange(FX_FLOAT fMin, FX_FLOAT fMax);
- FX_FLOAT GetPageSize();
- FWL_Error SetPageSize(FX_FLOAT fPageSize);
- FX_FLOAT GetStepSize();
- FWL_Error SetStepSize(FX_FLOAT fStepSize);
- FX_FLOAT GetPos();
- FWL_Error SetPos(FX_FLOAT fPos);
- FX_FLOAT GetTrackPos();
- FWL_Error SetTrackPos(FX_FLOAT fTrackPos);
- bool DoScroll(uint32_t dwCode, FX_FLOAT fPos = 0.0f);
- FWL_Error SetOuter(IFWL_Widget* pOuter);
+ void GetRange(FX_FLOAT* fMin, FX_FLOAT* fMax) const {
+ ASSERT(fMin);
+ ASSERT(fMax);
+ *fMin = m_fRangeMin;
+ *fMax = m_fRangeMax;
+ }
+ void SetRange(FX_FLOAT fMin, FX_FLOAT fMax) {
+ m_fRangeMin = fMin;
+ m_fRangeMax = fMax;
+ }
+ FX_FLOAT GetPageSize() const { return m_fPageSize; }
+ void SetPageSize(FX_FLOAT fPageSize) { m_fPageSize = fPageSize; }
+ FX_FLOAT GetStepSize() const { return m_fStepSize; }
+ void SetStepSize(FX_FLOAT fStepSize) { m_fStepSize = fStepSize; }
+ FX_FLOAT GetPos() const { return m_fPos; }
+ void SetPos(FX_FLOAT fPos) { m_fPos = fPos; }
+ void SetTrackPos(FX_FLOAT fTrackPos);
- protected:
+ private:
class Timer : public IFWL_Timer {
public:
explicit Timer(IFWL_ScrollBar* pToolTip);
@@ -75,7 +78,9 @@ class IFWL_ScrollBar : public IFWL_Widget {
};
friend class IFWL_ScrollBar::Timer;
- IFWL_ScrollBar();
+ bool IsVertical() const {
+ return !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_SCB_Vert);
+ }
void DrawTrack(CFX_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme,
bool bLower = true,
@@ -98,6 +103,33 @@ class IFWL_ScrollBar : public IFWL_Widget {
void GetTrackRect(CFX_RectF& rect, bool bLower = true);
bool SendEvent();
bool OnScroll(uint32_t dwCode, FX_FLOAT fPos);
+ void OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ void OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ void OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ void OnMouseLeave();
+ void OnMouseWheel(FX_FLOAT fx,
+ FX_FLOAT fy,
+ uint32_t dwFlags,
+ FX_FLOAT fDeltaX,
+ FX_FLOAT fDeltaY);
+ bool DoScroll(uint32_t dwCode, FX_FLOAT fPos = 0.0f);
+ void DoMouseDown(int32_t iItem,
+ const CFX_RectF& rtItem,
+ int32_t& iState,
+ FX_FLOAT fx,
+ FX_FLOAT fy);
+ void DoMouseUp(int32_t iItem,
+ const CFX_RectF& rtItem,
+ int32_t& iState,
+ FX_FLOAT fx,
+ FX_FLOAT fy);
+ void DoMouseMove(int32_t iItem,
+ const CFX_RectF& rtItem,
+ int32_t& iState,
+ FX_FLOAT fx,
+ FX_FLOAT fy);
+ void DoMouseLeave(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState);
+ void DoMouseHover(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState);
IFWL_TimerInfo* m_pTimerInfo;
FX_FLOAT m_fRangeMin;
@@ -115,10 +147,7 @@ class IFWL_ScrollBar : public IFWL_Widget {
FX_FLOAT m_cpTrackPointX;
FX_FLOAT m_cpTrackPointY;
int32_t m_iMouseWheel;
- bool m_bTrackMouseLeave;
- bool m_bMouseHover;
bool m_bMouseDown;
- bool m_bRepaintThumb;
FX_FLOAT m_fButtonLen;
bool m_bMinSize;
CFX_RectF m_rtClient;
@@ -130,34 +159,6 @@ class IFWL_ScrollBar : public IFWL_Widget {
bool m_bCustomLayout;
FX_FLOAT m_fMinThumb;
IFWL_ScrollBar::Timer m_Timer;
-
- private:
- void OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- void OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- void OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- void OnMouseLeave();
- void OnMouseWheel(FX_FLOAT fx,
- FX_FLOAT fy,
- uint32_t dwFlags,
- FX_FLOAT fDeltaX,
- FX_FLOAT fDeltaY);
- void DoMouseDown(int32_t iItem,
- const CFX_RectF& rtItem,
- int32_t& iState,
- FX_FLOAT fx,
- FX_FLOAT fy);
- void DoMouseUp(int32_t iItem,
- const CFX_RectF& rtItem,
- int32_t& iState,
- FX_FLOAT fx,
- FX_FLOAT fy);
- void DoMouseMove(int32_t iItem,
- const CFX_RectF& rtItem,
- int32_t& iState,
- FX_FLOAT fx,
- FX_FLOAT fy);
- void DoMouseLeave(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState);
- void DoMouseHover(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState);
};
#endif // XFA_FWL_CORE_IFWL_SCROLLBAR_H_