• 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 XFA_FWL_THEME_CFWL_SCROLLBARTP_H_
8 #define XFA_FWL_THEME_CFWL_SCROLLBARTP_H_
9 
10 #include <memory>
11 
12 #include "xfa/fwl/theme/cfwl_widgettp.h"
13 
14 class CFWL_ScrollBarTP final : public CFWL_WidgetTP {
15  public:
16   CFWL_ScrollBarTP();
17   ~CFWL_ScrollBarTP() override;
18 
19   // CFWL_WidgetTP
20   void DrawBackground(const CFWL_ThemeBackground& pParams) override;
21 
22  private:
23   struct SBThemeData {
24     FX_ARGB clrTrackBKStart;
25     FX_ARGB clrTrackBKEnd;
26     FX_ARGB clrPawColorLight[4];
27     FX_ARGB clrPawColorDark[4];
28     FX_ARGB clrBtnBK[4][2];
29     FX_ARGB clrBtnBorder[4];
30   };
31 
32   void DrawThumbBtn(CXFA_Graphics* pGraphics,
33                     const CFX_RectF& rect,
34                     bool bVert,
35                     FWLTHEME_STATE eState,
36                     bool bPawButton,
37                     const CFX_Matrix& matrix);
38   void DrawTrack(CXFA_Graphics* pGraphics,
39                  const CFX_RectF& rect,
40                  bool bVert,
41                  FWLTHEME_STATE eState,
42                  bool bLowerTrack,
43                  const CFX_Matrix& matrix);
44   void DrawMaxMinBtn(CXFA_Graphics* pGraphics,
45                      const CFX_RectF& rect,
46                      FWLTHEME_DIRECTION eDict,
47                      FWLTHEME_STATE eState,
48                      const CFX_Matrix& matrix);
49   void DrawPaw(CXFA_Graphics* pGraphics,
50                const CFX_RectF& rect,
51                bool bVert,
52                FWLTHEME_STATE eState,
53                const CFX_Matrix& matrix);
54   void SetThemeData();
55 
56   std::unique_ptr<SBThemeData> m_pThemeData;
57 };
58 
59 #endif  // XFA_FWL_THEME_CFWL_SCROLLBARTP_H_
60