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 _FWL_CHECKBOXTP_H 8 #define _FWL_CHECKBOXTP_H 9 class CFWL_WidgetTP; 10 class CFWL_CheckBoxTP; 11 class CFWL_CheckBoxTP : public CFWL_WidgetTP { 12 public: 13 CFWL_CheckBoxTP(); 14 virtual ~CFWL_CheckBoxTP(); 15 virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); 16 virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, 17 FX_DWORD dwThemeID, 18 FX_BOOL bChildren = TRUE); 19 virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); 20 virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); 21 virtual FWL_ERR Initialize(); 22 virtual FWL_ERR Finalize(); 23 24 protected: 25 void DrawBoxBk(IFWL_Widget* pWidget, 26 CFX_Graphics* pGraphics, 27 const CFX_RectF* pRect, 28 FX_DWORD dwStates, 29 CFX_Matrix* pMatrix = NULL); 30 void DrawSign(IFWL_Widget* pWidget, 31 CFX_Graphics* pGraphics, 32 const CFX_RectF* pRtBox, 33 FX_DWORD dwStates, 34 CFX_Matrix* pMatrix = NULL); 35 void DrawSignNeutral(CFX_Graphics* pGraphics, 36 const CFX_RectF* pRtSign, 37 CFX_Matrix* pMatrix = NULL); 38 void DrawSignCheck(CFX_Graphics* pGraphics, 39 const CFX_RectF* pRtSign, 40 FX_ARGB argbFill, 41 CFX_Matrix* pMatrix = NULL); 42 void DrawSignCircle(CFX_Graphics* pGraphics, 43 const CFX_RectF* pRtSign, 44 FX_ARGB argbFill, 45 CFX_Matrix* pMatrix = NULL); 46 void DrawSignCross(CFX_Graphics* pGraphics, 47 const CFX_RectF* pRtSign, 48 FX_ARGB argbFill, 49 CFX_Matrix* pMatrix = NULL); 50 void DrawSignDiamond(CFX_Graphics* pGraphics, 51 const CFX_RectF* pRtSign, 52 FX_ARGB argbFill, 53 CFX_Matrix* pMatrix = NULL); 54 void DrawSignSquare(CFX_Graphics* pGraphics, 55 const CFX_RectF* pRtSign, 56 FX_ARGB argbFill, 57 CFX_Matrix* pMatrix = NULL); 58 void DrawSignStar(CFX_Graphics* pGraphics, 59 const CFX_RectF* pRtSign, 60 FX_ARGB argbFill, 61 CFX_Matrix* pMatrix = NULL); 62 void DrawSignBorder(IFWL_Widget* pWidget, 63 CFX_Graphics* pGraphics, 64 const CFX_RectF* pRtBox, 65 FX_BOOL bDisable = FALSE, 66 CFX_Matrix* pMatrix = NULL); 67 void SetThemeData(FX_DWORD dwID); 68 void initCheckPath(FX_FLOAT fCheckLen); 69 struct CKBThemeData { 70 FX_ARGB clrBoxBk[13][2]; 71 FX_ARGB clrSignBorderNormal; 72 FX_ARGB clrSignBorderDisable; 73 FX_ARGB clrSignCheck; 74 FX_ARGB clrSignNeutral; 75 FX_ARGB clrSignNeutralNormal; 76 FX_ARGB clrSignNeutralHover; 77 FX_ARGB clrSignNeutralPressed; 78 } * m_pThemeData; 79 CFX_Path* m_pCheckPath; 80 }; 81 #endif 82