• 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 : public CFWL_WidgetTP {
15  public:
16   CFWL_ScrollBarTP();
17   ~CFWL_ScrollBarTP() override;
18 
19   // CFWL_WidgetTP
20   void DrawBackground(CFWL_ThemeBackground* pParams) override;
21 
22  protected:
23   struct SBThemeData {
24     FX_ARGB clrPawColorLight[4];
25     FX_ARGB clrPawColorDark[4];
26     FX_ARGB clrBtnBK[4][2];
27     FX_ARGB clrBtnBorder[4];
28     FX_ARGB clrTrackBKStart;
29     FX_ARGB clrTrackBKEnd;
30   };
31 
32   void DrawThumbBtn(CFX_Graphics* pGraphics,
33                     const CFX_RectF* pRect,
34                     bool bVert,
35                     FWLTHEME_STATE eState,
36                     bool bPawButton = true,
37                     CFX_Matrix* pMatrix = nullptr);
38   void DrawTrack(CFX_Graphics* pGraphics,
39                  const CFX_RectF* pRect,
40                  bool bVert,
41                  FWLTHEME_STATE eState,
42                  bool bLowerTrack,
43                  CFX_Matrix* pMatrix = nullptr);
44   void DrawMaxMinBtn(CFX_Graphics* pGraphics,
45                      const CFX_RectF* pRect,
46                      FWLTHEME_DIRECTION eDict,
47                      FWLTHEME_STATE eState,
48                      CFX_Matrix* pMatrix = nullptr);
49   void DrawPaw(CFX_Graphics* pGraphics,
50                const CFX_RectF* pRect,
51                bool bVert,
52                FWLTHEME_STATE eState,
53                CFX_Matrix* pMatrix = nullptr);
54 
55   std::unique_ptr<SBThemeData> m_pThemeData;
56 
57  private:
58   void SetThemeData();
59 };
60 
61 #endif  // XFA_FWL_THEME_CFWL_SCROLLBARTP_H_
62