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_FXFA_FXFA_WIDGET_H_ | |
8 #define XFA_INCLUDE_FXFA_FXFA_WIDGET_H_ | |
9 | |
10 #include "core/fxcrt/include/fx_coordinates.h" | |
11 #include "core/fxge/include/fx_dib.h" | |
12 #include "xfa/fxfa/parser/cxfa_box.h" | |
13 #include "xfa/fxfa/parser/cxfa_event.h" | |
14 #include "xfa/fxfa/parser/cxfa_image.h" | |
15 #include "xfa/fxfa/parser/cxfa_margin.h" | |
16 #include "xfa/fxfa/parser/cxfa_script.h" | |
17 #include "xfa/fxfa/parser/cxfa_value.h" | |
18 #include "xfa/fxfa/parser/cxfa_widgetdata.h" | |
19 | |
20 class CXFA_Node; | |
21 class CXFA_FFDocView; | |
22 class CXFA_FFDoc; | |
23 class CXFA_FFApp; | |
24 class CXFA_EventParam; | |
25 class CXFA_FFWidget; | |
26 class CXFA_TextLayout; | |
27 class CXFA_WidgetLayoutData; | |
28 class IFX_Font; | |
29 class IXFA_AppProvider; | |
30 | |
31 class CXFA_WidgetAcc : public CXFA_WidgetData { | |
32 public: | |
33 CXFA_WidgetAcc(CXFA_FFDocView* pDocView, CXFA_Node* pNode); | |
34 ~CXFA_WidgetAcc(); | |
35 | |
36 FX_BOOL GetName(CFX_WideString& wsName, int32_t iNameType = 0); | |
37 FX_BOOL ProcessValueChanged(); | |
38 | |
39 public: | |
40 void ResetData(); | |
41 | |
42 void SetImageEdit(const CFX_WideStringC& wsContentType, | |
43 const CFX_WideStringC& wsHref, | |
44 const CFX_WideStringC& wsData); | |
45 | |
46 CXFA_WidgetAcc* GetExclGroup(); | |
47 CXFA_FFDocView* GetDocView(); | |
48 CXFA_FFDoc* GetDoc(); | |
49 CXFA_FFApp* GetApp(); | |
50 IXFA_AppProvider* GetAppProvider(); | |
51 | |
52 int32_t ProcessEvent(int32_t iActivity, CXFA_EventParam* pEventParam); | |
53 int32_t ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEventParam); | |
54 int32_t ProcessCalculate(); | |
55 int32_t ProcessValidate(int32_t iFlags = 0); | |
56 int32_t ExecuteScript(CXFA_Script script, | |
57 CXFA_EventParam* pEventParam, | |
58 FXJSE_HVALUE* pRetValue = NULL); | |
59 | |
60 CXFA_FFWidget* GetNextWidget(CXFA_FFWidget* pWidget); | |
61 void StartWidgetLayout(FX_FLOAT& fCalcWidth, FX_FLOAT& fCalcHeight); | |
62 FX_BOOL FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight); | |
63 FX_BOOL LoadCaption(); | |
64 void LoadText(); | |
65 FX_BOOL LoadImageImage(); | |
66 FX_BOOL LoadImageEditImage(); | |
67 void GetImageDpi(int32_t& iImageXDpi, int32_t& iImageYDpi); | |
68 void GetImageEditDpi(int32_t& iImageXDpi, int32_t& iImageYDpi); | |
69 CXFA_TextLayout* GetCaptionTextLayout(); | |
70 CXFA_TextLayout* GetTextLayout(); | |
71 CFX_DIBitmap* GetImageImage(); | |
72 CFX_DIBitmap* GetImageEditImage(); | |
73 void SetImageImage(CFX_DIBitmap* newImage); | |
74 void SetImageEditImage(CFX_DIBitmap* newImage); | |
75 void UpdateUIDisplay(CXFA_FFWidget* pExcept = NULL); | |
76 void NotifyEvent(uint32_t dwEvent, | |
77 CXFA_FFWidget* pWidget = NULL, | |
78 void* pParam = NULL, | |
79 void* pAdditional = NULL); | |
80 | |
81 CXFA_Node* GetDatasets(); | |
82 IFX_Font* GetFDEFont(); | |
83 FX_FLOAT GetFontSize(); | |
84 FX_ARGB GetTextColor(); | |
85 FX_FLOAT GetLineHeight(); | |
86 CXFA_WidgetLayoutData* GetWidgetLayoutData(); | |
87 | |
88 protected: | |
89 void ProcessScriptTestValidate(CXFA_Validate validate, | |
90 int32_t iRet, | |
91 FXJSE_HVALUE pRetValue, | |
92 FX_BOOL bVersionFlag); | |
93 int32_t ProcessFormatTestValidate(CXFA_Validate validate, | |
94 FX_BOOL bVersionFlag); | |
95 int32_t ProcessNullTestValidate(CXFA_Validate validate, | |
96 int32_t iFlags, | |
97 FX_BOOL bVersionFlag); | |
98 void GetValidateCaptionName(CFX_WideString& wsCaptionName, | |
99 FX_BOOL bVersionFlag); | |
100 void GetValidateMessage(IXFA_AppProvider* pAppProvider, | |
101 CFX_WideString& wsMessage, | |
102 FX_BOOL bError, | |
103 FX_BOOL bVersionFlag); | |
104 void CalcCaptionSize(CFX_SizeF& szCap); | |
105 FX_BOOL CalculateFieldAutoSize(CFX_SizeF& size); | |
106 FX_BOOL CalculateWidgetAutoSize(CFX_SizeF& size); | |
107 FX_BOOL CalculateTextEditAutoSize(CFX_SizeF& size); | |
108 FX_BOOL CalculateCheckButtonAutoSize(CFX_SizeF& size); | |
109 FX_BOOL CalculatePushButtonAutoSize(CFX_SizeF& size); | |
110 FX_BOOL CalculateImageEditAutoSize(CFX_SizeF& size); | |
111 FX_BOOL CalculateImageAutoSize(CFX_SizeF& size); | |
112 FX_BOOL CalculateTextAutoSize(CFX_SizeF& size); | |
113 FX_FLOAT CalculateWidgetAutoHeight(FX_FLOAT fHeightCalc); | |
114 FX_FLOAT CalculateWidgetAutoWidth(FX_FLOAT fWidthCalc); | |
115 FX_FLOAT GetWidthWithoutMargin(FX_FLOAT fWidthCalc); | |
116 FX_FLOAT GetHeightWithoutMargin(FX_FLOAT fHeightCalc); | |
117 void CalculateTextContentSize(CFX_SizeF& size); | |
118 void CalculateAccWidthAndHeight(XFA_ELEMENT eUIType, | |
119 FX_FLOAT& fWidth, | |
120 FX_FLOAT& fCalcHeight); | |
121 void InitLayoutData(); | |
122 void StartTextLayout(FX_FLOAT& fCalcWidth, FX_FLOAT& fCalcHeight); | |
123 CXFA_FFDocView* m_pDocView; | |
124 CXFA_WidgetLayoutData* m_pLayoutData; | |
125 uint32_t m_nRecursionDepth; | |
126 }; | |
127 | |
128 #endif // XFA_INCLUDE_FXFA_FXFA_WIDGET_H_ | |
OLD | NEW |