• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 _FWL_THEME_LIGHT_H
8 #define _FWL_THEME_LIGHT_H
9 
10 #include "xfa/include/fwl/core/fwl_theme.h"
11 
12 class CFWL_WidgetTP;
13 class IFWL_Widget;
14 
15 class CFWL_Theme : public IFWL_ThemeProvider {
16  public:
17   CFWL_Theme();
18   ~CFWL_Theme() override;
19 
20   // IFWL_ThemeProvider:
21   FX_BOOL IsValidWidget(IFWL_Widget* pWidget) override;
22   FX_DWORD GetThemeID(IFWL_Widget* pWidget) override;
23   FX_DWORD SetThemeID(IFWL_Widget* pWidget,
24                       FX_DWORD dwThemeID,
25                       FX_BOOL bChildren = TRUE) override;
26   FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override;
27   FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget,
28                          const CFX_Matrix& matrix) override;
29   FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override;
30   FX_BOOL DrawText(CFWL_ThemeText* pParams) override;
31   void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity) override;
32   FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) override;
33   FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) override;
34   FX_BOOL IsInPart(CFWL_ThemePart* pThemePart,
35                    FX_FLOAT fx,
36                    FX_FLOAT fy) override;
37   FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) override;
38 
39   FWL_ERR Initialize();
40   FWL_ERR Finalize();
41   FWL_ERR SetFont(IFWL_Widget* pWidget,
42                   const FX_WCHAR* strFont,
43                   FX_FLOAT fFontSize,
44                   FX_ARGB rgbFont);
45   CFWL_WidgetTP* GetTheme(IFWL_Widget* pWidget);
46 
47  protected:
48   CFX_PtrArray m_arrThemes;
49 };
50 #endif
51