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 18 namespace pdfium { 19 20 class CFWL_Widget; 21 22 class CFWL_CheckBoxTP final : public CFWL_WidgetTP { 23 public: 24 CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED; 25 ~CFWL_CheckBoxTP() override; 26 27 // CFWL_WidgetTP 28 void DrawBackground(const CFWL_ThemeBackground& pParams) override; 29 void DrawText(const CFWL_ThemeText& pParams) override; 30 31 private: 32 CFWL_CheckBoxTP(); 33 34 void DrawCheckSign(CFWL_Widget* pWidget, 35 CFGAS_GEGraphics* pGraphics, 36 const CFX_RectF& pRtBox, 37 Mask<CFWL_PartState> iState, 38 const CFX_Matrix& matrix); 39 void DrawSignCheck(CFGAS_GEGraphics* pGraphics, 40 const CFX_RectF& rtSign, 41 FX_ARGB argbFill, 42 const CFX_Matrix& matrix); 43 void DrawSignCircle(CFGAS_GEGraphics* pGraphics, 44 const CFX_RectF& rtSign, 45 FX_ARGB argbFill, 46 const CFX_Matrix& matrix); 47 void DrawSignCross(CFGAS_GEGraphics* pGraphics, 48 const CFX_RectF& rtSign, 49 FX_ARGB argbFill, 50 const CFX_Matrix& matrix); 51 void DrawSignDiamond(CFGAS_GEGraphics* pGraphics, 52 const CFX_RectF& rtSign, 53 FX_ARGB argbFill, 54 const CFX_Matrix& matrix); 55 void DrawSignSquare(CFGAS_GEGraphics* pGraphics, 56 const CFX_RectF& rtSign, 57 FX_ARGB argbFill, 58 const CFX_Matrix& matrix); 59 void DrawSignStar(CFGAS_GEGraphics* pGraphics, 60 const CFX_RectF& rtSign, 61 FX_ARGB argbFill, 62 const CFX_Matrix& matrix); 63 64 void EnsureCheckPathInitialized(float fCheckLen); 65 66 std::unique_ptr<CFGAS_GEPath> m_pCheckPath; 67 }; 68 69 } // namespace pdfium 70 71 // TODO(crbug.com/42271761): Remove. 72 using pdfium::CFWL_CheckBoxTP; 73 74 #endif // XFA_FWL_THEME_CFWL_CHECKBOXTP_H_ 75