• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 <array>
11 #include <memory>
12 
13 #include "fxjs/gc/heap.h"
14 #include "xfa/fwl/theme/cfwl_widgettp.h"
15 
16 namespace pdfium {
17 
18 class CFWL_ScrollBarTP final : public CFWL_WidgetTP {
19  public:
20   CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
21   ~CFWL_ScrollBarTP() override;
22 
23   // CFWL_WidgetTP:
24   void DrawBackground(const CFWL_ThemeBackground& pParams) override;
25 
26  private:
27   struct SBThemeData {
28     FX_ARGB clrTrackBKStart;
29     FX_ARGB clrTrackBKEnd;
30     std::array<FX_ARGB, 4> clrBtnBK;
31     std::array<FX_ARGB, 4> clrBtnBorder;
32   };
33 
34   CFWL_ScrollBarTP();
35 
36   void DrawThumbBtn(CFGAS_GEGraphics* pGraphics,
37                     const CFX_RectF& rect,
38                     bool bVert,
39                     FWLTHEME_STATE eState,
40                     const CFX_Matrix& matrix);
41   void DrawTrack(CFGAS_GEGraphics* pGraphics,
42                  const CFX_RectF& rect,
43                  bool bVert,
44                  FWLTHEME_STATE eState,
45                  bool bLowerTrack,
46                  const CFX_Matrix& matrix);
47   void DrawMaxMinBtn(CFGAS_GEGraphics* pGraphics,
48                      const CFX_RectF& rect,
49                      FWLTHEME_DIRECTION eDict,
50                      FWLTHEME_STATE eState,
51                      const CFX_Matrix& matrix);
52   void SetThemeData();
53 
54   std::unique_ptr<SBThemeData> const m_pThemeData;
55 };
56 
57 }  // namespace pdfium
58 
59 // TODO(crbug.com/42271761): Remove.
60 using pdfium::CFWL_ScrollBarTP;
61 
62 #endif  // XFA_FWL_THEME_CFWL_SCROLLBARTP_H_
63