xref: /aosp_15_r20/external/pdfium/xfa/fwl/theme/cfwl_scrollbartp.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2014 The PDFium Authors
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 "fxjs/gc/heap.h"
13 #include "xfa/fwl/theme/cfwl_widgettp.h"
14 
15 class CFWL_ScrollBarTP final : public CFWL_WidgetTP {
16  public:
17   CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
18   ~CFWL_ScrollBarTP() override;
19 
20   // CFWL_WidgetTP:
21   void DrawBackground(const CFWL_ThemeBackground& pParams) override;
22 
23  private:
24   struct SBThemeData {
25     FX_ARGB clrTrackBKStart;
26     FX_ARGB clrTrackBKEnd;
27     FX_ARGB clrBtnBK[4][2];
28     FX_ARGB clrBtnBorder[4];
29   };
30 
31   CFWL_ScrollBarTP();
32 
33   void DrawThumbBtn(CFGAS_GEGraphics* pGraphics,
34                     const CFX_RectF& rect,
35                     bool bVert,
36                     FWLTHEME_STATE eState,
37                     const CFX_Matrix& matrix);
38   void DrawTrack(CFGAS_GEGraphics* pGraphics,
39                  const CFX_RectF& rect,
40                  bool bVert,
41                  FWLTHEME_STATE eState,
42                  bool bLowerTrack,
43                  const CFX_Matrix& matrix);
44   void DrawMaxMinBtn(CFGAS_GEGraphics* pGraphics,
45                      const CFX_RectF& rect,
46                      FWLTHEME_DIRECTION eDict,
47                      FWLTHEME_STATE eState,
48                      const CFX_Matrix& matrix);
49   void SetThemeData();
50 
51   std::unique_ptr<SBThemeData> m_pThemeData;
52 };
53 
54 #endif  // XFA_FWL_THEME_CFWL_SCROLLBARTP_H_
55