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 _XFA_FWL_THEME_IMP_H 8 #define _XFA_FWL_THEME_IMP_H 9 class CXFA_FWLTheme : public IFWL_ThemeProvider { 10 public: 11 CXFA_FWLTheme(CXFA_FFApp* pApp); 12 virtual ~CXFA_FWLTheme(); Release()13 virtual FWL_ERR Release() { 14 delete this; 15 return FWL_ERR_Succeeded; 16 } Retain()17 virtual IFWL_Target* Retain() { return NULL; } GetClassName(CFX_WideString & wsClass)18 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { 19 return FWL_ERR_Succeeded; 20 } GetHashCode()21 virtual FX_DWORD GetHashCode() const { return 0; } 22 virtual FWL_ERR Initialize(); 23 virtual FWL_ERR Finalize(); 24 virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); 25 virtual FX_DWORD GetThemeID(IFWL_Widget* pWidget); 26 virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, 27 FX_DWORD dwThemeID, 28 FX_BOOL bChildren = TRUE); 29 virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); 30 virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); 31 virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); 32 virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget); 33 virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart); 34 virtual FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, 35 FX_FLOAT fx, 36 FX_FLOAT fy); 37 38 virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect); GetThemeMatrix(IFWL_Widget * pWidget,CFX_Matrix & matrix)39 virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) { 40 return FWL_ERR_Succeeded; 41 } SetThemeMatrix(IFWL_Widget * pWidget,const CFX_Matrix & matrix)42 virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, 43 const CFX_Matrix& matrix) { 44 return FWL_ERR_Succeeded; 45 } GetPartRect(CFWL_ThemePart * pThemePart,CFX_RectF & rtPart)46 virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) { 47 return FWL_ERR_Succeeded; 48 } 49 50 protected: 51 CFWL_WidgetTP* GetTheme(IFWL_Widget* pWidget); 52 CFWL_CheckBoxTP* m_pCheckBoxTP; 53 CFWL_ListBoxTP* m_pListBoxTP; 54 CFWL_PictureBoxTP* m_pPictureBoxTP; 55 CFWL_ScrollBarTP* m_pSrollBarTP; 56 CFWL_EditTP* m_pEditTP; 57 CFWL_ComboBoxTP* m_pComboBoxTP; 58 CFWL_MonthCalendarTP* m_pMonthCalendarTP; 59 CFWL_DateTimePickerTP* m_pDateTimePickerTP; 60 CFWL_PushButtonTP* m_pPushButtonTP; 61 CFWL_CaretTP* m_pCaretTP; 62 CFWL_BarcodeTP* m_pBarcodeTP; 63 IFDE_TextOut* m_pTextOut; 64 FX_FLOAT m_fCapacity; 65 FX_DWORD m_dwCapacity; 66 IFX_Font* m_pCalendarFont; 67 CFX_WideString m_wsResource; 68 CXFA_FFApp* m_pApp; 69 CFX_RectF m_Rect; 70 CFX_SizeF m_SizeAboveBelow; 71 }; 72 class CXFA_FWLCheckBoxTP : public CFWL_CheckBoxTP { 73 public: 74 CXFA_FWLCheckBoxTP(); 75 virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); 76 77 protected: 78 void DrawCheckSign(IFWL_Widget* pWidget, 79 CFX_Graphics* pGraphics, 80 const CFX_RectF* pRtBox, 81 int32_t iState, 82 CFX_Matrix* pMatrix); 83 }; 84 class CXFA_FWLEditTP : public CFWL_EditTP { 85 public: 86 CXFA_FWLEditTP(); 87 virtual ~CXFA_FWLEditTP(); 88 89 public: 90 virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); 91 }; 92 #endif 93