OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FXFA_FXFA_WIDGET_H_ | 7 #ifndef XFA_FXFA_FXFA_WIDGET_H_ |
8 #define XFA_FXFA_FXFA_WIDGET_H_ | 8 #define XFA_FXFA_FXFA_WIDGET_H_ |
9 | 9 |
10 #include "core/fxcrt/fx_coordinates.h" | 10 #include "core/fxcrt/fx_coordinates.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 class CXFA_Node; | 26 class CXFA_Node; |
27 class CXFA_TextLayout; | 27 class CXFA_TextLayout; |
28 class CXFA_WidgetLayoutData; | 28 class CXFA_WidgetLayoutData; |
29 class IXFA_AppProvider; | 29 class IXFA_AppProvider; |
30 | 30 |
31 class CXFA_WidgetAcc : public CXFA_WidgetData { | 31 class CXFA_WidgetAcc : public CXFA_WidgetData { |
32 public: | 32 public: |
33 CXFA_WidgetAcc(CXFA_FFDocView* pDocView, CXFA_Node* pNode); | 33 CXFA_WidgetAcc(CXFA_FFDocView* pDocView, CXFA_Node* pNode); |
34 ~CXFA_WidgetAcc(); | 34 ~CXFA_WidgetAcc(); |
35 | 35 |
36 FX_BOOL GetName(CFX_WideString& wsName, int32_t iNameType = 0); | 36 bool GetName(CFX_WideString& wsName, int32_t iNameType = 0); |
37 FX_BOOL ProcessValueChanged(); | 37 bool ProcessValueChanged(); |
38 void ResetData(); | 38 void ResetData(); |
39 | 39 |
40 void SetImageEdit(const CFX_WideString& wsContentType, | 40 void SetImageEdit(const CFX_WideString& wsContentType, |
41 const CFX_WideString& wsHref, | 41 const CFX_WideString& wsHref, |
42 const CFX_WideString& wsData); | 42 const CFX_WideString& wsData); |
43 | 43 |
44 CXFA_WidgetAcc* GetExclGroup(); | 44 CXFA_WidgetAcc* GetExclGroup(); |
45 CXFA_FFDocView* GetDocView(); | 45 CXFA_FFDocView* GetDocView(); |
46 CXFA_FFDoc* GetDoc(); | 46 CXFA_FFDoc* GetDoc(); |
47 CXFA_FFApp* GetApp(); | 47 CXFA_FFApp* GetApp(); |
48 IXFA_AppProvider* GetAppProvider(); | 48 IXFA_AppProvider* GetAppProvider(); |
49 | 49 |
50 int32_t ProcessEvent(int32_t iActivity, CXFA_EventParam* pEventParam); | 50 int32_t ProcessEvent(int32_t iActivity, CXFA_EventParam* pEventParam); |
51 int32_t ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEventParam); | 51 int32_t ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEventParam); |
52 int32_t ProcessCalculate(); | 52 int32_t ProcessCalculate(); |
53 int32_t ProcessValidate(int32_t iFlags = 0); | 53 int32_t ProcessValidate(int32_t iFlags = 0); |
54 int32_t ExecuteScript(CXFA_Script script, | 54 int32_t ExecuteScript(CXFA_Script script, |
55 CXFA_EventParam* pEventParam, | 55 CXFA_EventParam* pEventParam, |
56 CFXJSE_Value** pRetValue = nullptr); | 56 CFXJSE_Value** pRetValue = nullptr); |
57 | 57 |
58 CXFA_FFWidget* GetNextWidget(CXFA_FFWidget* pWidget); | 58 CXFA_FFWidget* GetNextWidget(CXFA_FFWidget* pWidget); |
59 void StartWidgetLayout(FX_FLOAT& fCalcWidth, FX_FLOAT& fCalcHeight); | 59 void StartWidgetLayout(FX_FLOAT& fCalcWidth, FX_FLOAT& fCalcHeight); |
60 FX_BOOL FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight); | 60 bool FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight); |
61 FX_BOOL LoadCaption(); | 61 bool LoadCaption(); |
62 void LoadText(); | 62 void LoadText(); |
63 FX_BOOL LoadImageImage(); | 63 bool LoadImageImage(); |
64 FX_BOOL LoadImageEditImage(); | 64 bool LoadImageEditImage(); |
65 void GetImageDpi(int32_t& iImageXDpi, int32_t& iImageYDpi); | 65 void GetImageDpi(int32_t& iImageXDpi, int32_t& iImageYDpi); |
66 void GetImageEditDpi(int32_t& iImageXDpi, int32_t& iImageYDpi); | 66 void GetImageEditDpi(int32_t& iImageXDpi, int32_t& iImageYDpi); |
67 CXFA_TextLayout* GetCaptionTextLayout(); | 67 CXFA_TextLayout* GetCaptionTextLayout(); |
68 CXFA_TextLayout* GetTextLayout(); | 68 CXFA_TextLayout* GetTextLayout(); |
69 CFX_DIBitmap* GetImageImage(); | 69 CFX_DIBitmap* GetImageImage(); |
70 CFX_DIBitmap* GetImageEditImage(); | 70 CFX_DIBitmap* GetImageEditImage(); |
71 void SetImageImage(CFX_DIBitmap* newImage); | 71 void SetImageImage(CFX_DIBitmap* newImage); |
72 void SetImageEditImage(CFX_DIBitmap* newImage); | 72 void SetImageEditImage(CFX_DIBitmap* newImage); |
73 void UpdateUIDisplay(CXFA_FFWidget* pExcept = nullptr); | 73 void UpdateUIDisplay(CXFA_FFWidget* pExcept = nullptr); |
74 | 74 |
75 CXFA_Node* GetDatasets(); | 75 CXFA_Node* GetDatasets(); |
76 CFGAS_GEFont* GetFDEFont(); | 76 CFGAS_GEFont* GetFDEFont(); |
77 FX_FLOAT GetFontSize(); | 77 FX_FLOAT GetFontSize(); |
78 FX_ARGB GetTextColor(); | 78 FX_ARGB GetTextColor(); |
79 FX_FLOAT GetLineHeight(); | 79 FX_FLOAT GetLineHeight(); |
80 CXFA_WidgetLayoutData* GetWidgetLayoutData(); | 80 CXFA_WidgetLayoutData* GetWidgetLayoutData(); |
81 | 81 |
82 protected: | 82 protected: |
83 void ProcessScriptTestValidate(CXFA_Validate validate, | 83 void ProcessScriptTestValidate(CXFA_Validate validate, |
84 int32_t iRet, | 84 int32_t iRet, |
85 CFXJSE_Value* pRetValue, | 85 CFXJSE_Value* pRetValue, |
86 FX_BOOL bVersionFlag); | 86 bool bVersionFlag); |
87 int32_t ProcessFormatTestValidate(CXFA_Validate validate, | 87 int32_t ProcessFormatTestValidate(CXFA_Validate validate, bool bVersionFlag); |
88 FX_BOOL bVersionFlag); | |
89 int32_t ProcessNullTestValidate(CXFA_Validate validate, | 88 int32_t ProcessNullTestValidate(CXFA_Validate validate, |
90 int32_t iFlags, | 89 int32_t iFlags, |
91 FX_BOOL bVersionFlag); | 90 bool bVersionFlag); |
92 void GetValidateCaptionName(CFX_WideString& wsCaptionName, | 91 void GetValidateCaptionName(CFX_WideString& wsCaptionName, bool bVersionFlag); |
93 FX_BOOL bVersionFlag); | |
94 void GetValidateMessage(IXFA_AppProvider* pAppProvider, | 92 void GetValidateMessage(IXFA_AppProvider* pAppProvider, |
95 CFX_WideString& wsMessage, | 93 CFX_WideString& wsMessage, |
96 FX_BOOL bError, | 94 bool bError, |
97 FX_BOOL bVersionFlag); | 95 bool bVersionFlag); |
98 void CalcCaptionSize(CFX_SizeF& szCap); | 96 void CalcCaptionSize(CFX_SizeF& szCap); |
99 FX_BOOL CalculateFieldAutoSize(CFX_SizeF& size); | 97 bool CalculateFieldAutoSize(CFX_SizeF& size); |
100 FX_BOOL CalculateWidgetAutoSize(CFX_SizeF& size); | 98 bool CalculateWidgetAutoSize(CFX_SizeF& size); |
101 FX_BOOL CalculateTextEditAutoSize(CFX_SizeF& size); | 99 bool CalculateTextEditAutoSize(CFX_SizeF& size); |
102 FX_BOOL CalculateCheckButtonAutoSize(CFX_SizeF& size); | 100 bool CalculateCheckButtonAutoSize(CFX_SizeF& size); |
103 FX_BOOL CalculatePushButtonAutoSize(CFX_SizeF& size); | 101 bool CalculatePushButtonAutoSize(CFX_SizeF& size); |
104 FX_BOOL CalculateImageEditAutoSize(CFX_SizeF& size); | 102 bool CalculateImageEditAutoSize(CFX_SizeF& size); |
105 FX_BOOL CalculateImageAutoSize(CFX_SizeF& size); | 103 bool CalculateImageAutoSize(CFX_SizeF& size); |
106 FX_BOOL CalculateTextAutoSize(CFX_SizeF& size); | 104 bool CalculateTextAutoSize(CFX_SizeF& size); |
107 FX_FLOAT CalculateWidgetAutoHeight(FX_FLOAT fHeightCalc); | 105 FX_FLOAT CalculateWidgetAutoHeight(FX_FLOAT fHeightCalc); |
108 FX_FLOAT CalculateWidgetAutoWidth(FX_FLOAT fWidthCalc); | 106 FX_FLOAT CalculateWidgetAutoWidth(FX_FLOAT fWidthCalc); |
109 FX_FLOAT GetWidthWithoutMargin(FX_FLOAT fWidthCalc); | 107 FX_FLOAT GetWidthWithoutMargin(FX_FLOAT fWidthCalc); |
110 FX_FLOAT GetHeightWithoutMargin(FX_FLOAT fHeightCalc); | 108 FX_FLOAT GetHeightWithoutMargin(FX_FLOAT fHeightCalc); |
111 void CalculateTextContentSize(CFX_SizeF& size); | 109 void CalculateTextContentSize(CFX_SizeF& size); |
112 void CalculateAccWidthAndHeight(XFA_Element eUIType, | 110 void CalculateAccWidthAndHeight(XFA_Element eUIType, |
113 FX_FLOAT& fWidth, | 111 FX_FLOAT& fWidth, |
114 FX_FLOAT& fCalcHeight); | 112 FX_FLOAT& fCalcHeight); |
115 void InitLayoutData(); | 113 void InitLayoutData(); |
116 void StartTextLayout(FX_FLOAT& fCalcWidth, FX_FLOAT& fCalcHeight); | 114 void StartTextLayout(FX_FLOAT& fCalcWidth, FX_FLOAT& fCalcHeight); |
117 | 115 |
118 CXFA_FFDocView* m_pDocView; | 116 CXFA_FFDocView* m_pDocView; |
119 std::unique_ptr<CXFA_WidgetLayoutData> m_pLayoutData; | 117 std::unique_ptr<CXFA_WidgetLayoutData> m_pLayoutData; |
120 uint32_t m_nRecursionDepth; | 118 uint32_t m_nRecursionDepth; |
121 }; | 119 }; |
122 | 120 |
123 #endif // XFA_FXFA_FXFA_WIDGET_H_ | 121 #endif // XFA_FXFA_FXFA_WIDGET_H_ |
OLD | NEW |