xref: /aosp_15_r20/external/pdfium/xfa/fwl/theme/cfwl_checkboxtp.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_CHECKBOXTP_H_
8 #define XFA_FWL_THEME_CFWL_CHECKBOXTP_H_
9 
10 #include <memory>
11 
12 #include "fxjs/gc/heap.h"
13 #include "xfa/fwl/cfwl_themepart.h"
14 #include "xfa/fwl/theme/cfwl_widgettp.h"
15 
16 class CFGAS_GEPath;
17 class CFWL_Widget;
18 
19 class CFWL_CheckBoxTP final : public CFWL_WidgetTP {
20  public:
21   CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
22   ~CFWL_CheckBoxTP() override;
23 
24   // CFWL_WidgetTP
25   void DrawBackground(const CFWL_ThemeBackground& pParams) override;
26   void DrawText(const CFWL_ThemeText& pParams) override;
27 
28  private:
29   CFWL_CheckBoxTP();
30 
31   void DrawCheckSign(CFWL_Widget* pWidget,
32                      CFGAS_GEGraphics* pGraphics,
33                      const CFX_RectF& pRtBox,
34                      Mask<CFWL_PartState> iState,
35                      const CFX_Matrix& matrix);
36   void DrawSignCheck(CFGAS_GEGraphics* pGraphics,
37                      const CFX_RectF& rtSign,
38                      FX_ARGB argbFill,
39                      const CFX_Matrix& matrix);
40   void DrawSignCircle(CFGAS_GEGraphics* pGraphics,
41                       const CFX_RectF& rtSign,
42                       FX_ARGB argbFill,
43                       const CFX_Matrix& matrix);
44   void DrawSignCross(CFGAS_GEGraphics* pGraphics,
45                      const CFX_RectF& rtSign,
46                      FX_ARGB argbFill,
47                      const CFX_Matrix& matrix);
48   void DrawSignDiamond(CFGAS_GEGraphics* pGraphics,
49                        const CFX_RectF& rtSign,
50                        FX_ARGB argbFill,
51                        const CFX_Matrix& matrix);
52   void DrawSignSquare(CFGAS_GEGraphics* pGraphics,
53                       const CFX_RectF& rtSign,
54                       FX_ARGB argbFill,
55                       const CFX_Matrix& matrix);
56   void DrawSignStar(CFGAS_GEGraphics* pGraphics,
57                     const CFX_RectF& rtSign,
58                     FX_ARGB argbFill,
59                     const CFX_Matrix& matrix);
60 
61   void EnsureCheckPathInitialized(float fCheckLen);
62 
63   std::unique_ptr<CFGAS_GEPath> m_pCheckPath;
64 };
65 
66 #endif  // XFA_FWL_THEME_CFWL_CHECKBOXTP_H_
67