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_INCLUDE_FWL_CORE_FWL_THEME_H_ | |
8 #define XFA_INCLUDE_FWL_CORE_FWL_THEME_H_ | |
9 | |
10 #include "core/fxcrt/include/fx_coordinates.h" | |
11 #include "core/fxcrt/include/fx_system.h" | |
12 #include "xfa/include/fwl/core/fwl_error.h" | |
13 | |
14 class IFWL_Widget; | |
15 class CFX_Graphics; | |
16 class CFX_DIBitmap; | |
17 class CFX_Path; | |
18 | |
19 #define FWL_WGTCAPACITY_CXBorder 1 | |
20 #define FWL_WGTCAPACITY_CYBorder 2 | |
21 #define FWL_WGTCAPACITY_ScrollBarWidth 3 | |
22 #define FWL_WGTCAPACITY_EdgeFlat 4 | |
23 #define FWL_WGTCAPACITY_EdgeRaised 5 | |
24 #define FWL_WGTCAPACITY_EdgeSunken 6 | |
25 #define FWL_WGTCAPACITY_Font 7 | |
26 #define FWL_WGTCAPACITY_FontSize 8 | |
27 #define FWL_WGTCAPACITY_TextColor 9 | |
28 #define FWL_WGTCAPACITY_TextSelColor 10 | |
29 #define FWL_WGTCAPACITY_LineHeight 11 | |
30 #define FWL_WGTCAPACITY_UIMargin 12 | |
31 #define FWL_WGTCAPACITY_SpaceAboveBelow 13 | |
32 #define FWL_WGTCAPACITY_MAX 65535 | |
33 | |
34 class CFWL_ThemePart { | |
35 public: | |
36 CFWL_ThemePart() | |
37 : m_pWidget(NULL), m_iPart(0), m_dwStates(0), m_dwData(0), m_pData(NULL) { | |
38 m_rtPart.Reset(); | |
39 m_matrix.SetIdentity(); | |
40 } | |
41 CFX_Matrix m_matrix; | |
42 CFX_RectF m_rtPart; | |
43 IFWL_Widget* m_pWidget; | |
44 int32_t m_iPart; | |
45 FX_DWORD m_dwStates; | |
46 FX_DWORD m_dwData; | |
47 void* m_pData; | |
48 }; | |
49 class CFWL_ThemeBackground : public CFWL_ThemePart { | |
50 public: | |
51 CFWL_ThemeBackground() : m_pGraphics(NULL), m_pImage(NULL), m_pPath(NULL) {} | |
52 CFX_Graphics* m_pGraphics; | |
53 CFX_DIBitmap* m_pImage; | |
54 CFX_Path* m_pPath; | |
55 }; | |
56 class CFWL_ThemeText : public CFWL_ThemePart { | |
57 public: | |
58 CFWL_ThemeText() : m_pGraphics(NULL) {} | |
59 CFX_WideString m_wsText; | |
60 FX_DWORD m_dwTTOStyles; | |
61 int32_t m_iTTOAlign; | |
62 CFX_Graphics* m_pGraphics; | |
63 }; | |
64 class IFWL_ThemeProvider { | |
65 public: | |
66 virtual ~IFWL_ThemeProvider() {} | |
67 virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget) = 0; | |
68 virtual FX_DWORD GetThemeID(IFWL_Widget* pWidget) = 0; | |
69 virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, | |
70 FX_DWORD dwThemeID, | |
71 FX_BOOL bChildren = TRUE) = 0; | |
72 virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) = 0; | |
73 virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, | |
74 const CFX_Matrix& matrix) = 0; | |
75 virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) = 0; | |
76 virtual FX_BOOL DrawText(CFWL_ThemeText* pParams) = 0; | |
77 virtual void* GetCapacity(CFWL_ThemePart* pThemePart, | |
78 FX_DWORD dwCapacity) = 0; | |
79 virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) = 0; | |
80 virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, | |
81 CFX_RectF& rtPart) = 0; | |
82 virtual FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, | |
83 FX_FLOAT fx, | |
84 FX_FLOAT fy) = 0; | |
85 virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) = 0; | |
86 }; | |
87 | |
88 #endif // XFA_INCLUDE_FWL_CORE_FWL_THEME_H_ | |
OLD | NEW |