OLD | NEW |
| (Empty) |
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_LIGHTWIDGET_CFWL_THEME_H_ | |
8 #define XFA_FWL_LIGHTWIDGET_CFWL_THEME_H_ | |
9 | |
10 #include <memory> | |
11 #include <vector> | |
12 | |
13 #include "core/fxcrt/include/fx_coordinates.h" | |
14 #include "core/fxcrt/include/fx_system.h" | |
15 #include "core/fxge/include/fx_dib.h" | |
16 #include "xfa/fwl/core/ifwl_themeprovider.h" | |
17 | |
18 class CFWL_WidgetTP; | |
19 class IFWL_Widget; | |
20 class CFWL_ThemePart; | |
21 class CFWL_ThemeText; | |
22 | |
23 class CFWL_Theme final : public IFWL_ThemeProvider { | |
24 public: | |
25 CFWL_Theme(); | |
26 ~CFWL_Theme() override; | |
27 | |
28 // IFWL_ThemeProvider: | |
29 bool IsValidWidget(IFWL_Widget* pWidget) override; | |
30 uint32_t GetThemeID(IFWL_Widget* pWidget) override; | |
31 uint32_t SetThemeID(IFWL_Widget* pWidget, | |
32 uint32_t dwThemeID, | |
33 FX_BOOL bChildren = TRUE) override; | |
34 FWL_Error GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override; | |
35 FWL_Error SetThemeMatrix(IFWL_Widget* pWidget, | |
36 const CFX_Matrix& matrix) override; | |
37 FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override; | |
38 FX_BOOL DrawText(CFWL_ThemeText* pParams) override; | |
39 void* GetCapacity(CFWL_ThemePart* pThemePart, | |
40 CFWL_WidgetCapacity dwCapacity) override; | |
41 FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) override; | |
42 FWL_Error GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) override; | |
43 FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, | |
44 FX_FLOAT fx, | |
45 FX_FLOAT fy) override; | |
46 FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) override; | |
47 | |
48 FWL_Error Initialize(); | |
49 FWL_Error Finalize(); | |
50 FWL_Error SetFont(IFWL_Widget* pWidget, | |
51 const FX_WCHAR* strFont, | |
52 FX_FLOAT fFontSize, | |
53 FX_ARGB rgbFont); | |
54 CFWL_WidgetTP* GetTheme(IFWL_Widget* pWidget); | |
55 | |
56 protected: | |
57 std::vector<std::unique_ptr<CFWL_WidgetTP>> m_ThemesArray; | |
58 }; | |
59 | |
60 #endif // XFA_FWL_LIGHTWIDGET_CFWL_THEME_H_ | |
OLD | NEW |