• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef _FWL_SCROLLBAR_H
8 #define _FWL_SCROLLBAR_H
9 class CFWL_WidgetImpProperties;
10 class IFWL_Widget;
11 class IFWL_ScrollBarDP;
12 class IFWL_ScrollBar;
13 #define FWL_CLASS_ScrollBar L"FWL_SCROLLBAR"
14 #define FWL_CLASSHASH_ScrollBar 2826584844
15 #define FWL_STYLEEXT_SCB_Horz (0L << 0)
16 #define FWL_STYLEEXT_SCB_Vert (1L << 0)
17 #define FWL_PART_SCB_Border 1
18 #define FWL_PART_SCB_Edge 2
19 #define FWL_PART_SCB_Background 3
20 #define FWL_PART_SCB_ForeArrow 4
21 #define FWL_PART_SCB_BackArrow 5
22 #define FWL_PART_SCB_Thumb 6
23 #define FWL_PART_SCB_LowerTrack 7
24 #define FWL_PART_SCB_UpperTrack 8
25 #define FWL_PARTSTATE_SCB_Normal (0L << 0)
26 #define FWL_PARTSTATE_SCB_Hovered (1L << 0)
27 #define FWL_PARTSTATE_SCB_Pressed (2L << 0)
28 #define FWL_PARTSTATE_SCB_Disabled (3L << 0)
29 #define FWL_WGTHITTEST_SCB_ForeArrow FWL_WGTHITTEST_MAX + 1
30 #define FWL_WGTHITTEST_SCB_BackArrow FWL_WGTHITTEST_MAX + 2
31 #define FWL_WGTHITTEST_SCB_LowerTrack FWL_WGTHITTEST_MAX + 3
32 #define FWL_WGTHITTEST_SCB_UpperTrack FWL_WGTHITTEST_MAX + 4
33 #define FWL_WGTHITTEST_SCB_Thumb FWL_WGTHITTEST_MAX + 5
34 #define FWL_CAPACITY_SCB_Size FWL_WGTCAPACITY_MAX
35 enum FWL_SCBCODE {
36   FWL_SCBCODE_None = 1,
37   FWL_SCBCODE_Min,
38   FWL_SCBCODE_Max,
39   FWL_SCBCODE_PageBackward,
40   FWL_SCBCODE_PageForward,
41   FWL_SCBCODE_StepBackward,
42   FWL_SCBCODE_StepForward,
43   FWL_SCBCODE_Pos,
44   FWL_SCBCODE_TrackPos,
45   FWL_SCBCODE_EndScroll,
46 };
47 class IFWL_ScrollBarDP : public IFWL_DataProvider {};
48 class IFWL_ScrollBar : public IFWL_Widget {
49  public:
50   static IFWL_ScrollBar* Create(const CFWL_WidgetImpProperties& properties,
51                                 IFWL_Widget* pOuter);
52 
53   FX_BOOL IsVertical();
54   FWL_ERR GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax);
55   FWL_ERR SetRange(FX_FLOAT fMin, FX_FLOAT fMax);
56   FX_FLOAT GetPageSize();
57   FWL_ERR SetPageSize(FX_FLOAT fPageSize);
58   FX_FLOAT GetStepSize();
59   FWL_ERR SetStepSize(FX_FLOAT fStepSize);
60   FX_FLOAT GetPos();
61   FWL_ERR SetPos(FX_FLOAT fPos);
62   FX_FLOAT GetTrackPos();
63   FWL_ERR SetTrackPos(FX_FLOAT fTrackPos);
64   FX_BOOL DoScroll(FX_DWORD dwCode, FX_FLOAT fPos = 0.0f);
65 
66  protected:
67   IFWL_ScrollBar();
68 };
69 #endif
70