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