Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / include / fwl / theme / formtp.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_FORM_THEMEPROVIDER_H\r
8 #define _FWL_FORM_THEMEPROVIDER_H\r
9 class CFWL_WidgetTP;\r
10 class CFWL_FormTP;\r
11 class CFWL_FormTP : public CFWL_WidgetTP\r
12 {\r
13 public:\r
14     CFWL_FormTP();\r
15     virtual ~CFWL_FormTP();\r
16 \r
17     virtual FWL_ERR             Initialize();\r
18     virtual FWL_ERR             Finalize();\r
19     virtual FX_BOOL             IsValidWidget(IFWL_Widget *pWidget);\r
20     virtual     FX_DWORD        SetThemeID(IFWL_Widget *pWidget, FX_DWORD dwThemeID, FX_BOOL bChildren = TRUE);\r
21     virtual FX_BOOL             DrawBackground(CFWL_ThemeBackground *pParams);\r
22     virtual FX_BOOL             DrawText(CFWL_ThemeText *pParams);\r
23     virtual FX_LPVOID   GetCapacity(CFWL_ThemePart *pThemePart, FX_DWORD dwCapacity);\r
24     virtual FWL_ERR             GetPartRect(CFWL_ThemePart *pThemePart, CFX_RectF& rtPart);\r
25 protected:\r
26 \r
27     void CalCloseBox(IFWL_Widget *pWidget, CFX_RectF &rect);\r
28     void CalMaxBox(IFWL_Widget *pWidget, CFX_RectF &rect);\r
29     void CalMinBox(IFWL_Widget *pWidget, CFX_RectF &rect);\r
30     void CalCaption(IFWL_Widget *pWidget, CFX_RectF &rect);\r
31     void CalIcon(IFWL_Widget *pWidget, CFX_RectF &rect);\r
32 \r
33     void DrawFormBorder(CFX_Graphics *pGraphics, const CFX_RectF *pRect,  FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);\r
34     void DrawCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect,  FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);\r
35     void DrawNarrowCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect,  FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);\r
36     void DrawCloseBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect,  FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);\r
37     void DrawMinMaxBoxCommon(CFX_Graphics *pGraphics, const CFX_RectF *pRect,  FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);\r
38     void DrawMinimizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect,  FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);\r
39     void DrawMaximizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect,  FWLTHEME_STATE eState, FX_BOOL bMax, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);\r
40     void DrawIconImage(CFX_Graphics *pGraphics, CFX_DIBitmap *pDIBitmap, const CFX_RectF *pRect,  FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);\r
41     void SetThemeData(FX_DWORD dwID);\r
42     void TransModeColor(FX_ARGB clrFore, FX_ARGB &clrBack);\r
43     void DeactiveForm();\r
44     void InitCaption(FX_BOOL bActive);\r
45     CFX_DIBitmap        *m_pActiveBitmap;\r
46     CFX_DIBitmap        *m_pDeactivebitmap;\r
47     CFX_RectF           m_rtDisCaption;\r
48     CFX_RectF           m_rtDisLBorder;\r
49     CFX_RectF           m_rtDisRBorder;\r
50     CFX_RectF           m_rtDisBBorder;\r
51     struct SBThemeData : public CFX_Object {\r
52     public:\r
53         FX_ARGB clrHeadBK[2][4];\r
54         FX_ARGB clrHeadEdgeLeft[2][3];\r
55         FX_ARGB clrHeadEdgeRight[2][3];\r
56         FX_ARGB clrHeadEdgeTop[2][3];\r
57         FX_ARGB clrHeadEdgeBottom[2][3];\r
58         FX_ARGB clrCloseBtBKStart[2][3];\r
59         FX_ARGB clrCloseBtBKEnd[2][3];\r
60         FX_ARGB clrCloseBtEdgeLight[2][3];\r
61         FX_ARGB clrCloseBtEdgeDark[2][3];\r
62         FX_ARGB clrNormalBtBKStart[2][3];\r
63         FX_ARGB clrNormalBtBKEnd[2][3];\r
64         FX_ARGB clrNormalBtEdgeLight[2][3];\r
65         FX_ARGB clrNormalBtEdgeDark[2][3];\r
66         FX_ARGB clrBtnEdgeOut[2];\r
67         FX_ARGB clrBtnCornerLight[2][3];\r
68         FX_ARGB clrHeadText[2];\r
69         FX_ARGB clrFormBorder[2][5];\r
70         FX_ARGB clrFormBorderLight[2];\r
71         FX_ARGB clrTransWhite;\r
72     } *m_pThemeData;\r
73 };\r
74 #endif\r