Merge to XFA: Use stdint.h types throughout PDFium.
[pdfium.git] / xfa / include / fwl / core / fwl_theme.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4 \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _FWL_THEME_H\r
8 #define _FWL_THEME_H\r
9 class IFWL_Widget;\r
10 class CFWL_ThemePart;\r
11 class CFWL_ThemeBackground;\r
12 class CFWL_ThemeText;\r
13 class CFWL_ThemeElement;\r
14 class IFWL_ThemeProvider;\r
15 #define FWL_WGTCAPACITY_CXBorder                        1\r
16 #define FWL_WGTCAPACITY_CYBorder                        2\r
17 #define FWL_WGTCAPACITY_ScrollBarWidth          3\r
18 #define FWL_WGTCAPACITY_EdgeFlat                        4\r
19 #define FWL_WGTCAPACITY_EdgeRaised                      5\r
20 #define FWL_WGTCAPACITY_EdgeSunken                      6\r
21 #define FWL_WGTCAPACITY_Font                            7\r
22 #define FWL_WGTCAPACITY_FontSize                        8\r
23 #define FWL_WGTCAPACITY_TextColor                       9\r
24 #define FWL_WGTCAPACITY_TextSelColor            10\r
25 #define FWL_WGTCAPACITY_LineHeight                      11\r
26 #define FWL_WGTCAPACITY_UIMargin                        12\r
27 #define FWL_WGTCAPACITY_SpaceAboveBelow         13\r
28 #define FWL_WGTCAPACITY_MAX                                     65535\r
29 class CFWL_ThemePart\r
30 {\r
31 public:\r
32     CFWL_ThemePart()\r
33         : m_pWidget(NULL)\r
34         , m_iPart(0)\r
35         , m_dwStates(0)\r
36         , m_dwData(0)\r
37         , m_pData(NULL)\r
38     {\r
39         m_rtPart.Reset();\r
40         m_matrix.Reset();\r
41     }\r
42     CFX_Matrix                           m_matrix;\r
43     CFX_RectF                            m_rtPart;\r
44     IFWL_Widget                         *m_pWidget;\r
45     int32_t                              m_iPart;\r
46     FX_DWORD                             m_dwStates;\r
47     FX_DWORD                             m_dwData;\r
48     FX_LPVOID                            m_pData;\r
49 };\r
50 class CFWL_ThemeBackground : public CFWL_ThemePart\r
51 {\r
52 public:\r
53     CFWL_ThemeBackground()\r
54         : m_pGraphics(NULL)\r
55         , m_pImage(NULL)\r
56         , m_pPath(NULL)\r
57     {\r
58     }\r
59     CFX_Graphics                        *m_pGraphics;\r
60     CFX_DIBitmap                        *m_pImage;\r
61     CFX_Path                            *m_pPath;\r
62 };\r
63 class CFWL_ThemeText : public CFWL_ThemePart\r
64 {\r
65 public:\r
66     CFWL_ThemeText()\r
67         : m_pGraphics(NULL)\r
68     {\r
69     }\r
70     CFX_WideString                       m_wsText;\r
71     FX_DWORD                             m_dwTTOStyles;\r
72     int32_t                              m_iTTOAlign;\r
73     CFX_Graphics                    *m_pGraphics;\r
74 };\r
75 class IFWL_ThemeProvider\r
76 {\r
77 public:\r
78     virtual FX_BOOL             IsValidWidget(IFWL_Widget *pWidget) = 0;\r
79     virtual FX_DWORD    GetThemeID(IFWL_Widget *pWidget) = 0;\r
80     virtual FX_DWORD    SetThemeID(IFWL_Widget *pWidget, FX_DWORD dwThemeID, FX_BOOL bChildren = TRUE) = 0;\r
81     virtual FWL_ERR             GetThemeMatrix(IFWL_Widget *pWidget, CFX_Matrix &matrix) = 0;\r
82     virtual FWL_ERR             SetThemeMatrix(IFWL_Widget *pWidget, const CFX_Matrix &matrix) = 0;\r
83     virtual FX_BOOL             DrawBackground(CFWL_ThemeBackground *pParams) = 0;\r
84     virtual FX_BOOL             DrawText(CFWL_ThemeText *pParams) = 0;\r
85     virtual FX_LPVOID   GetCapacity(CFWL_ThemePart *pThemePart, FX_DWORD dwCapacity) = 0;\r
86     virtual FX_BOOL             IsCustomizedLayout(IFWL_Widget *pWidget) = 0;\r
87     virtual FWL_ERR             GetPartRect(CFWL_ThemePart *pThemePart, CFX_RectF &rtPart) = 0;\r
88     virtual FX_BOOL             IsInPart(CFWL_ThemePart *pThemePart, FX_FLOAT fx, FX_FLOAT fy) = 0;\r
89     virtual     FX_BOOL         CalcTextRect(CFWL_ThemeText *pParams, CFX_RectF &rect) = 0;\r
90 };\r
91 #endif\r