| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef XFA_FXFA_APP_XFA_FWLTHEME_H_ | 7 #ifndef XFA_FXFA_APP_XFA_FWLTHEME_H_ |
| 8 #define XFA_FXFA_APP_XFA_FWLTHEME_H_ | 8 #define XFA_FXFA_APP_XFA_FWLTHEME_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "xfa/fwl/theme/cfwl_pushbuttontp.h" | 22 #include "xfa/fwl/theme/cfwl_pushbuttontp.h" |
| 23 #include "xfa/fwl/theme/cfwl_scrollbartp.h" | 23 #include "xfa/fwl/theme/cfwl_scrollbartp.h" |
| 24 #include "xfa/fwl/theme/cfwl_widgettp.h" | 24 #include "xfa/fwl/theme/cfwl_widgettp.h" |
| 25 #include "xfa/fxfa/include/xfa_ffapp.h" | 25 #include "xfa/fxfa/include/xfa_ffapp.h" |
| 26 | 26 |
| 27 class CXFA_FWLTheme final : public IFWL_ThemeProvider { | 27 class CXFA_FWLTheme final : public IFWL_ThemeProvider { |
| 28 public: | 28 public: |
| 29 CXFA_FWLTheme(CXFA_FFApp* pApp); | 29 CXFA_FWLTheme(CXFA_FFApp* pApp); |
| 30 ~CXFA_FWLTheme() override; | 30 ~CXFA_FWLTheme() override; |
| 31 | 31 |
| 32 FWL_Error GetClassName(CFX_WideString& wsClass) const { | |
| 33 return FWL_Error::Succeeded; | |
| 34 } | |
| 35 uint32_t GetHashCode() const { return 0; } | |
| 36 FWL_Error Initialize(); | |
| 37 FWL_Error Finalize(); | |
| 38 | |
| 39 // IFWL_ThemeProvider: | 32 // IFWL_ThemeProvider: |
| 40 bool IsValidWidget(IFWL_Widget* pWidget) override; | 33 bool IsValidWidget(IFWL_Widget* pWidget) override; |
| 41 uint32_t GetThemeID(IFWL_Widget* pWidget) override; | 34 uint32_t GetThemeID(IFWL_Widget* pWidget) override; |
| 42 uint32_t SetThemeID(IFWL_Widget* pWidget, | 35 uint32_t SetThemeID(IFWL_Widget* pWidget, |
| 43 uint32_t dwThemeID, | 36 uint32_t dwThemeID, |
| 44 FX_BOOL bChildren = TRUE) override; | 37 FX_BOOL bChildren = TRUE) override; |
| 45 FWL_Error GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override; | 38 FWL_Error GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override; |
| 46 FWL_Error SetThemeMatrix(IFWL_Widget* pWidget, | 39 FWL_Error SetThemeMatrix(IFWL_Widget* pWidget, |
| 47 const CFX_Matrix& matrix) override; | 40 const CFX_Matrix& matrix) override; |
| 48 FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override; | 41 FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override; |
| 49 FX_BOOL DrawText(CFWL_ThemeText* pParams) override; | 42 FX_BOOL DrawText(CFWL_ThemeText* pParams) override; |
| 50 void* GetCapacity(CFWL_ThemePart* pThemePart, | 43 void* GetCapacity(CFWL_ThemePart* pThemePart, |
| 51 CFWL_WidgetCapacity dwCapacity) override; | 44 CFWL_WidgetCapacity dwCapacity) override; |
| 52 FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) override; | 45 FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) override; |
| 53 FWL_Error GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) override; | 46 FWL_Error GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) override; |
| 54 FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, | 47 FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, |
| 55 FX_FLOAT fx, | 48 FX_FLOAT fx, |
| 56 FX_FLOAT fy) override; | 49 FX_FLOAT fy) override; |
| 57 FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) override; | 50 FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) override; |
| 58 | 51 |
| 52 FWL_Error GetClassName(CFX_WideString& wsClass) const { |
| 53 return FWL_Error::Succeeded; |
| 54 } |
| 55 uint32_t GetHashCode() const { return 0; } |
| 56 FWL_Error Initialize(); |
| 57 FWL_Error Finalize(); |
| 59 FWL_Error GetPartRect(CFWL_ThemePart* pThemePart); | 58 FWL_Error GetPartRect(CFWL_ThemePart* pThemePart); |
| 60 | 59 |
| 61 protected: | 60 protected: |
| 62 CFWL_WidgetTP* GetTheme(IFWL_Widget* pWidget); | 61 CFWL_WidgetTP* GetTheme(IFWL_Widget* pWidget); |
| 63 CFWL_CheckBoxTP* m_pCheckBoxTP; | 62 std::unique_ptr<CFWL_CheckBoxTP> m_pCheckBoxTP; |
| 64 CFWL_ListBoxTP* m_pListBoxTP; | 63 std::unique_ptr<CFWL_ListBoxTP> m_pListBoxTP; |
| 65 CFWL_PictureBoxTP* m_pPictureBoxTP; | 64 std::unique_ptr<CFWL_PictureBoxTP> m_pPictureBoxTP; |
| 66 CFWL_ScrollBarTP* m_pSrollBarTP; | 65 std::unique_ptr<CFWL_ScrollBarTP> m_pSrollBarTP; |
| 67 CFWL_EditTP* m_pEditTP; | 66 std::unique_ptr<CFWL_EditTP> m_pEditTP; |
| 68 CFWL_ComboBoxTP* m_pComboBoxTP; | 67 std::unique_ptr<CFWL_ComboBoxTP> m_pComboBoxTP; |
| 69 CFWL_MonthCalendarTP* m_pMonthCalendarTP; | 68 std::unique_ptr<CFWL_MonthCalendarTP> m_pMonthCalendarTP; |
| 70 CFWL_DateTimePickerTP* m_pDateTimePickerTP; | 69 std::unique_ptr<CFWL_DateTimePickerTP> m_pDateTimePickerTP; |
| 71 CFWL_PushButtonTP* m_pPushButtonTP; | 70 std::unique_ptr<CFWL_PushButtonTP> m_pPushButtonTP; |
| 72 CFWL_CaretTP* m_pCaretTP; | 71 std::unique_ptr<CFWL_CaretTP> m_pCaretTP; |
| 73 CFWL_BarcodeTP* m_pBarcodeTP; | 72 std::unique_ptr<CFWL_BarcodeTP> m_pBarcodeTP; |
| 74 std::unique_ptr<CFDE_TextOut> m_pTextOut; | 73 std::unique_ptr<CFDE_TextOut> m_pTextOut; |
| 75 FX_FLOAT m_fCapacity; | 74 FX_FLOAT m_fCapacity; |
| 76 uint32_t m_dwCapacity; | 75 uint32_t m_dwCapacity; |
| 77 CFGAS_GEFont* m_pCalendarFont; | 76 CFGAS_GEFont* m_pCalendarFont; |
| 78 CFX_WideString m_wsResource; | 77 CFX_WideString m_wsResource; |
| 79 CXFA_FFApp* m_pApp; | 78 CXFA_FFApp* const m_pApp; |
| 80 CFX_RectF m_Rect; | 79 CFX_RectF m_Rect; |
| 81 CFX_SizeF m_SizeAboveBelow; | 80 CFX_SizeF m_SizeAboveBelow; |
| 82 }; | 81 }; |
| 82 |
| 83 class CXFA_FWLCheckBoxTP : public CFWL_CheckBoxTP { | 83 class CXFA_FWLCheckBoxTP : public CFWL_CheckBoxTP { |
| 84 public: | 84 public: |
| 85 CXFA_FWLCheckBoxTP(); | 85 CXFA_FWLCheckBoxTP(); |
| 86 | 86 |
| 87 // CFWL_CheckBoxTP | 87 // CFWL_CheckBoxTP |
| 88 FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override; | 88 FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override; |
| 89 | 89 |
| 90 protected: | 90 protected: |
| 91 void DrawCheckSign(IFWL_Widget* pWidget, | 91 void DrawCheckSign(IFWL_Widget* pWidget, |
| 92 CFX_Graphics* pGraphics, | 92 CFX_Graphics* pGraphics, |
| 93 const CFX_RectF* pRtBox, | 93 const CFX_RectF* pRtBox, |
| 94 int32_t iState, | 94 int32_t iState, |
| 95 CFX_Matrix* pMatrix); | 95 CFX_Matrix* pMatrix); |
| 96 }; | 96 }; |
| 97 |
| 97 class CXFA_FWLEditTP : public CFWL_EditTP { | 98 class CXFA_FWLEditTP : public CFWL_EditTP { |
| 98 public: | 99 public: |
| 99 CXFA_FWLEditTP(); | 100 CXFA_FWLEditTP(); |
| 100 ~CXFA_FWLEditTP() override; | 101 ~CXFA_FWLEditTP() override; |
| 101 | 102 |
| 102 // CFWL_EditTP | 103 // CFWL_EditTP |
| 103 FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override; | 104 FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override; |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 #endif // XFA_FXFA_APP_XFA_FWLTHEME_H_ | 107 #endif // XFA_FXFA_APP_XFA_FWLTHEME_H_ |
| OLD | NEW |