Merge to XFA: Use stdint.h types throughout PDFium.
[pdfium.git] / xfa / include / fxfa / fxfa_widget.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 _FXFA_WIDGET_H\r
8 #define _FXFA_WIDGET_H\r
9 class CXFA_Node;\r
10 class CXFA_FFDocView;\r
11 class CXFA_FFDoc;\r
12 class CXFA_FFApp;\r
13 class CXFA_Node;\r
14 class CXFA_EventParam;\r
15 class CXFA_FFWidget;\r
16 class CXFA_TextLayout;\r
17 class CXFA_TextProvider;\r
18 class CXFA_WidgetLayoutData;\r
19 class IFX_Font;\r
20 class CXFA_WidgetAcc;\r
21 #include "fxfa_objectacc.h"\r
22 class CXFA_WidgetAcc : public CXFA_WidgetData\r
23 {\r
24 public:\r
25     CXFA_WidgetAcc(CXFA_FFDocView* pDocView, CXFA_Node* pNode);\r
26     ~CXFA_WidgetAcc();\r
27 \r
28     FX_BOOL                     GetName(CFX_WideString &wsName, int32_t iNameType = 0);\r
29     FX_BOOL                     ProcessValueChanged();\r
30 \r
31 public:\r
32 \r
33     void                        ResetData();\r
34 \r
35 \r
36     void                        SetImageEdit(FX_WSTR wsContentType, FX_WSTR wsHref, FX_WSTR wsData);\r
37 \r
38     CXFA_WidgetAcc*     GetExclGroup();\r
39     CXFA_FFDocView*             GetDocView();\r
40     CXFA_FFDoc*                 GetDoc();\r
41     CXFA_FFApp*                 GetApp();\r
42     IXFA_AppProvider*   GetAppProvider();\r
43 \r
44     int32_t             ProcessEvent(int32_t iActivity, CXFA_EventParam* pEventParam);\r
45     int32_t             ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEventParam);\r
46     int32_t             ProcessCalculate();\r
47     int32_t             ProcessValidate(int32_t iFlags = 0);\r
48     int32_t             ExecuteScript(CXFA_Script script, CXFA_EventParam* pEventParam, FXJSE_HVALUE* pRetValue = NULL);\r
49 \r
50     CXFA_FFWidget*      GetNextWidget(CXFA_FFWidget* pWidget);\r
51     void                        StartWidgetLayout(FX_FLOAT &fCalcWidth, FX_FLOAT& fCalcHeight);\r
52     FX_BOOL                     FindSplitPos(int32_t iBlockIndex, FX_FLOAT &fCalcHeight);\r
53     FX_BOOL                             LoadCaption();\r
54     FX_BOOL                             LoadText();\r
55     FX_BOOL                             LoadImageImage();\r
56     FX_BOOL                             LoadImageEditImage();\r
57     void                                GetImageDpi(int32_t &iImageXDpi, int32_t &iImageYDpi);\r
58     void                                GetImageEditDpi(int32_t &iImageXDpi, int32_t &iImageYDpi);\r
59     CXFA_TextLayout*    GetCaptionTextLayout();\r
60     CXFA_TextLayout*    GetTextLayout();\r
61     CFX_DIBitmap*               GetImageImage();\r
62     CFX_DIBitmap*               GetImageEditImage();\r
63     void                                SetImageImage(CFX_DIBitmap* newImage);\r
64     void                                SetImageEditImage(CFX_DIBitmap* newImage);\r
65     void                        UpdateUIDisplay(CXFA_FFWidget* pExcept = NULL);\r
66     void                        NotifyEvent(FX_DWORD dwEvent, CXFA_FFWidget* pWidget = NULL, FX_LPVOID pParam = NULL, FX_LPVOID pAdditional = NULL);\r
67 \r
68 \r
69     CXFA_Node*          GetDatasets();\r
70     IFX_Font*           GetFDEFont();\r
71     FX_FLOAT            GetFontSize();\r
72     FX_ARGB                     GetTextColor();\r
73     FX_FLOAT            GetLineHeight();\r
74     CXFA_WidgetLayoutData* GetWidgetLayoutData();\r
75 protected:\r
76     void                        ProcessScriptTestValidate(CXFA_Validate validate, int32_t iRet, FXJSE_HVALUE pRetValue, FX_BOOL bVersionFlag);\r
77     int32_t             ProcessFormatTestValidate(CXFA_Validate validate, FX_BOOL bVersionFlag);\r
78     int32_t             ProcessNullTestValidate(CXFA_Validate validate, int32_t iFlags, FX_BOOL bVersionFlag);\r
79     void                        GetValidateCaptionName(CFX_WideString& wsCaptionName, FX_BOOL bVersionFlag);\r
80     void                        GetValidateMessage(IXFA_AppProvider* pAppProvider, CFX_WideString& wsMessage, FX_BOOL bError, FX_BOOL bVersionFlag);\r
81     void                        CalcCaptionSize(CFX_SizeF &szCap);\r
82     FX_BOOL                     CalculateFieldAutoSize(CFX_SizeF &size);\r
83     FX_BOOL                     CalculateWidgetAutoSize(CFX_SizeF &size);\r
84     FX_BOOL                     CalculateTextEditAutoSize(CFX_SizeF &size);\r
85     FX_BOOL                     CalculateCheckButtonAutoSize(CFX_SizeF &size);\r
86     FX_BOOL                     CalculatePushButtonAutoSize(CFX_SizeF &size);\r
87     FX_BOOL                     CalculateImageEditAutoSize(CFX_SizeF &size);\r
88     FX_BOOL                     CalculateImageAutoSize(CFX_SizeF &size);\r
89     FX_BOOL                     CalculateTextAutoSize(CFX_SizeF &size);\r
90     FX_FLOAT            CalculateWidgetAutoHeight(FX_FLOAT fHeightCalc);\r
91     FX_FLOAT            CalculateWidgetAutoWidth(FX_FLOAT fWidthCalc);\r
92     FX_FLOAT            GetWidthWithoutMargin(FX_FLOAT fWidthCalc);\r
93     FX_FLOAT            GetHeightWithoutMargin(FX_FLOAT fHeightCalc);\r
94     void                        CalculateTextContentSize(CFX_SizeF &size);\r
95     void                        CalculateAccWidthAndHeight(XFA_ELEMENT eUIType, FX_FLOAT& fWidth, FX_FLOAT& fCalcHeight);\r
96     void                        InitLayoutData();\r
97     void                        StartTextLayout(FX_FLOAT& fCalcWidth, FX_FLOAT& fCalcHeight);\r
98     CXFA_FFDocView*             m_pDocView;\r
99     CXFA_WidgetLayoutData* m_pLayoutData;\r
100 };\r
101 #endif\r