OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_PARSER_CXFA_WIDGETDATA_H_ | 7 #ifndef XFA_FXFA_PARSER_CXFA_WIDGETDATA_H_ |
8 #define XFA_FXFA_PARSER_CXFA_WIDGETDATA_H_ | 8 #define XFA_FXFA_PARSER_CXFA_WIDGETDATA_H_ |
9 | 9 |
10 #include "core/fxcrt/fx_string.h" | 10 #include "core/fxcrt/fx_string.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 class CXFA_Node; | 37 class CXFA_Node; |
38 class IFX_Locale; | 38 class IFX_Locale; |
39 | 39 |
40 class CXFA_WidgetData : public CXFA_Data { | 40 class CXFA_WidgetData : public CXFA_Data { |
41 public: | 41 public: |
42 explicit CXFA_WidgetData(CXFA_Node* pNode); | 42 explicit CXFA_WidgetData(CXFA_Node* pNode); |
43 | 43 |
44 CXFA_Node* GetUIChild(); | 44 CXFA_Node* GetUIChild(); |
45 XFA_Element GetUIType(); | 45 XFA_Element GetUIType(); |
46 CFX_WideString GetRawValue(); | 46 CFX_WideString GetRawValue(); |
47 int32_t GetAccess(FX_BOOL bTemplate = FALSE); | 47 int32_t GetAccess(bool bTemplate = false); |
48 int32_t GetRotate(); | 48 int32_t GetRotate(); |
49 CXFA_Border GetBorder(FX_BOOL bModified = FALSE); | 49 CXFA_Border GetBorder(bool bModified = false); |
50 CXFA_Caption GetCaption(FX_BOOL bModified = FALSE); | 50 CXFA_Caption GetCaption(bool bModified = false); |
51 CXFA_Font GetFont(FX_BOOL bModified = FALSE); | 51 CXFA_Font GetFont(bool bModified = false); |
52 CXFA_Margin GetMargin(FX_BOOL bModified = FALSE); | 52 CXFA_Margin GetMargin(bool bModified = false); |
53 CXFA_Para GetPara(FX_BOOL bModified = FALSE); | 53 CXFA_Para GetPara(bool bModified = false); |
54 void GetEventList(CXFA_NodeArray& events); | 54 void GetEventList(CXFA_NodeArray& events); |
55 int32_t GetEventByActivity(int32_t iActivity, | 55 int32_t GetEventByActivity(int32_t iActivity, |
56 CXFA_NodeArray& events, | 56 CXFA_NodeArray& events, |
57 FX_BOOL bIsFormReady = FALSE); | 57 bool bIsFormReady = false); |
58 CXFA_Value GetDefaultValue(FX_BOOL bModified = FALSE); | 58 CXFA_Value GetDefaultValue(bool bModified = false); |
59 CXFA_Value GetFormValue(FX_BOOL bModified = FALSE); | 59 CXFA_Value GetFormValue(bool bModified = false); |
60 CXFA_Calculate GetCalculate(FX_BOOL bModified = FALSE); | 60 CXFA_Calculate GetCalculate(bool bModified = false); |
61 CXFA_Validate GetValidate(FX_BOOL bModified = FALSE); | 61 CXFA_Validate GetValidate(bool bModified = false); |
62 CXFA_Bind GetBind(FX_BOOL bModified = FALSE); | 62 CXFA_Bind GetBind(bool bModified = false); |
63 CXFA_Assist GetAssist(FX_BOOL bModified = FALSE); | 63 CXFA_Assist GetAssist(bool bModified = false); |
64 FX_BOOL GetWidth(FX_FLOAT& fWidth); | 64 bool GetWidth(FX_FLOAT& fWidth); |
65 FX_BOOL GetHeight(FX_FLOAT& fHeight); | 65 bool GetHeight(FX_FLOAT& fHeight); |
66 FX_BOOL GetMinWidth(FX_FLOAT& fMinWidth); | 66 bool GetMinWidth(FX_FLOAT& fMinWidth); |
67 FX_BOOL GetMinHeight(FX_FLOAT& fMinHeight); | 67 bool GetMinHeight(FX_FLOAT& fMinHeight); |
68 FX_BOOL GetMaxWidth(FX_FLOAT& fMaxWidth); | 68 bool GetMaxWidth(FX_FLOAT& fMaxWidth); |
69 FX_BOOL GetMaxHeight(FX_FLOAT& fMaxHeight); | 69 bool GetMaxHeight(FX_FLOAT& fMaxHeight); |
70 CXFA_Border GetUIBorder(FX_BOOL bModified = FALSE); | 70 CXFA_Border GetUIBorder(bool bModified = false); |
71 CXFA_Margin GetUIMargin(FX_BOOL bModified = FALSE); | 71 CXFA_Margin GetUIMargin(bool bModified = false); |
72 void GetUIMargin(CFX_RectF& rtUIMargin); | 72 void GetUIMargin(CFX_RectF& rtUIMargin); |
73 int32_t GetButtonHighlight(); | 73 int32_t GetButtonHighlight(); |
74 FX_BOOL GetButtonRollover(CFX_WideString& wsRollover, FX_BOOL& bRichText); | 74 bool GetButtonRollover(CFX_WideString& wsRollover, bool& bRichText); |
75 FX_BOOL GetButtonDown(CFX_WideString& wsDown, FX_BOOL& bRichText); | 75 bool GetButtonDown(CFX_WideString& wsDown, bool& bRichText); |
76 int32_t GetCheckButtonShape(); | 76 int32_t GetCheckButtonShape(); |
77 int32_t GetCheckButtonMark(); | 77 int32_t GetCheckButtonMark(); |
78 FX_FLOAT GetCheckButtonSize(); | 78 FX_FLOAT GetCheckButtonSize(); |
79 FX_BOOL IsAllowNeutral(); | 79 bool IsAllowNeutral(); |
80 FX_BOOL IsRadioButton(); | 80 bool IsRadioButton(); |
81 XFA_CHECKSTATE GetCheckState(); | 81 XFA_CHECKSTATE GetCheckState(); |
82 void SetCheckState(XFA_CHECKSTATE eCheckState, bool bNotify); | 82 void SetCheckState(XFA_CHECKSTATE eCheckState, bool bNotify); |
83 CXFA_Node* GetExclGroupNode(); | 83 CXFA_Node* GetExclGroupNode(); |
84 CXFA_Node* GetSelectedMember(); | 84 CXFA_Node* GetSelectedMember(); |
85 CXFA_Node* SetSelectedMember(const CFX_WideStringC& wsName, bool bNotify); | 85 CXFA_Node* SetSelectedMember(const CFX_WideStringC& wsName, bool bNotify); |
86 void SetSelectedMemberByValue(const CFX_WideStringC& wsValue, | 86 void SetSelectedMemberByValue(const CFX_WideStringC& wsValue, |
87 bool bNotify, | 87 bool bNotify, |
88 FX_BOOL bScriptModify, | 88 bool bScriptModify, |
89 FX_BOOL bSyncData); | 89 bool bSyncData); |
90 CXFA_Node* GetExclGroupFirstMember(); | 90 CXFA_Node* GetExclGroupFirstMember(); |
91 CXFA_Node* GetExclGroupNextMember(CXFA_Node* pNode); | 91 CXFA_Node* GetExclGroupNextMember(CXFA_Node* pNode); |
92 int32_t GetChoiceListCommitOn(); | 92 int32_t GetChoiceListCommitOn(); |
93 FX_BOOL IsChoiceListAllowTextEntry(); | 93 bool IsChoiceListAllowTextEntry(); |
94 int32_t GetChoiceListOpen(); | 94 int32_t GetChoiceListOpen(); |
95 FX_BOOL IsListBox(); | 95 bool IsListBox(); |
96 int32_t CountChoiceListItems(FX_BOOL bSaveValue = FALSE); | 96 int32_t CountChoiceListItems(bool bSaveValue = false); |
97 FX_BOOL GetChoiceListItem(CFX_WideString& wsText, | 97 bool GetChoiceListItem(CFX_WideString& wsText, |
98 int32_t nIndex, | 98 int32_t nIndex, |
99 FX_BOOL bSaveValue = FALSE); | 99 bool bSaveValue = false); |
100 void GetChoiceListItems(CFX_WideStringArray& wsTextArray, | 100 void GetChoiceListItems(CFX_WideStringArray& wsTextArray, |
101 FX_BOOL bSaveValue = FALSE); | 101 bool bSaveValue = false); |
102 int32_t CountSelectedItems(); | 102 int32_t CountSelectedItems(); |
103 int32_t GetSelectedItem(int32_t nIndex = 0); | 103 int32_t GetSelectedItem(int32_t nIndex = 0); |
104 void GetSelectedItems(CFX_Int32Array& iSelArray); | 104 void GetSelectedItems(CFX_Int32Array& iSelArray); |
105 void GetSelectedItemsValue(CFX_WideStringArray& wsSelTextArray); | 105 void GetSelectedItemsValue(CFX_WideStringArray& wsSelTextArray); |
106 FX_BOOL GetItemState(int32_t nIndex); | 106 bool GetItemState(int32_t nIndex); |
107 void SetItemState(int32_t nIndex, | 107 void SetItemState(int32_t nIndex, |
108 FX_BOOL bSelected, | 108 bool bSelected, |
109 bool bNotify, | 109 bool bNotify, |
110 FX_BOOL bScriptModify, | 110 bool bScriptModify, |
111 FX_BOOL bSyncData); | 111 bool bSyncData); |
112 void SetSelectedItems(CFX_Int32Array& iSelArray, | 112 void SetSelectedItems(CFX_Int32Array& iSelArray, |
113 bool bNotify, | 113 bool bNotify, |
114 FX_BOOL bScriptModify, | 114 bool bScriptModify, |
115 FX_BOOL bSyncData); | 115 bool bSyncData); |
116 void ClearAllSelections(); | 116 void ClearAllSelections(); |
117 void InsertItem(const CFX_WideString& wsLabel, | 117 void InsertItem(const CFX_WideString& wsLabel, |
118 const CFX_WideString& wsValue, | 118 const CFX_WideString& wsValue, |
119 int32_t nIndex = -1, | 119 int32_t nIndex = -1, |
120 FX_BOOL bNotify = FALSE); | 120 bool bNotify = false); |
121 void GetItemLabel(const CFX_WideStringC& wsValue, CFX_WideString& wsLabel); | 121 void GetItemLabel(const CFX_WideStringC& wsValue, CFX_WideString& wsLabel); |
122 void GetItemValue(const CFX_WideStringC& wsLabel, CFX_WideString& wsValue); | 122 void GetItemValue(const CFX_WideStringC& wsLabel, CFX_WideString& wsValue); |
123 FX_BOOL DeleteItem(int32_t nIndex, | 123 bool DeleteItem(int32_t nIndex, |
124 FX_BOOL bNotify = FALSE, | 124 bool bNotify = false, |
125 FX_BOOL bScriptModify = FALSE, | 125 bool bScriptModify = false, |
126 FX_BOOL bSyncData = TRUE); | 126 bool bSyncData = true); |
127 int32_t GetHorizontalScrollPolicy(); | 127 int32_t GetHorizontalScrollPolicy(); |
128 int32_t GetNumberOfCells(); | 128 int32_t GetNumberOfCells(); |
129 FX_BOOL SetValue(const CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType); | 129 bool SetValue(const CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType); |
130 FX_BOOL GetPictureContent(CFX_WideString& wsPicture, | 130 bool GetPictureContent(CFX_WideString& wsPicture, XFA_VALUEPICTURE ePicture); |
131 XFA_VALUEPICTURE ePicture); | |
132 IFX_Locale* GetLocal(); | 131 IFX_Locale* GetLocal(); |
133 FX_BOOL GetValue(CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType); | 132 bool GetValue(CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType); |
134 FX_BOOL GetNormalizeDataValue(const CFX_WideString& wsValue, | 133 bool GetNormalizeDataValue(const CFX_WideString& wsValue, |
135 CFX_WideString& wsNormalizeValue); | 134 CFX_WideString& wsNormalizeValue); |
136 FX_BOOL GetFormatDataValue(const CFX_WideString& wsValue, | 135 bool GetFormatDataValue(const CFX_WideString& wsValue, |
137 CFX_WideString& wsFormattedValue); | 136 CFX_WideString& wsFormattedValue); |
138 void NormalizeNumStr(const CFX_WideString& wsValue, CFX_WideString& wsOutput); | 137 void NormalizeNumStr(const CFX_WideString& wsValue, CFX_WideString& wsOutput); |
139 CFX_WideString GetBarcodeType(); | 138 CFX_WideString GetBarcodeType(); |
140 FX_BOOL GetBarcodeAttribute_CharEncoding(int32_t& val); | 139 bool GetBarcodeAttribute_CharEncoding(int32_t& val); |
141 FX_BOOL GetBarcodeAttribute_Checksum(FX_BOOL& val); | 140 bool GetBarcodeAttribute_Checksum(bool& val); |
142 FX_BOOL GetBarcodeAttribute_DataLength(int32_t& val); | 141 bool GetBarcodeAttribute_DataLength(int32_t& val); |
143 FX_BOOL GetBarcodeAttribute_StartChar(FX_CHAR& val); | 142 bool GetBarcodeAttribute_StartChar(FX_CHAR& val); |
144 FX_BOOL GetBarcodeAttribute_EndChar(FX_CHAR& val); | 143 bool GetBarcodeAttribute_EndChar(FX_CHAR& val); |
145 FX_BOOL GetBarcodeAttribute_ECLevel(int32_t& val); | 144 bool GetBarcodeAttribute_ECLevel(int32_t& val); |
146 FX_BOOL GetBarcodeAttribute_ModuleWidth(int32_t& val); | 145 bool GetBarcodeAttribute_ModuleWidth(int32_t& val); |
147 FX_BOOL GetBarcodeAttribute_ModuleHeight(int32_t& val); | 146 bool GetBarcodeAttribute_ModuleHeight(int32_t& val); |
148 FX_BOOL GetBarcodeAttribute_PrintChecksum(FX_BOOL& val); | 147 bool GetBarcodeAttribute_PrintChecksum(bool& val); |
149 FX_BOOL GetBarcodeAttribute_TextLocation(int32_t& val); | 148 bool GetBarcodeAttribute_TextLocation(int32_t& val); |
150 FX_BOOL GetBarcodeAttribute_Truncate(FX_BOOL& val); | 149 bool GetBarcodeAttribute_Truncate(bool& val); |
151 FX_BOOL GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val); | 150 bool GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val); |
152 void GetPasswordChar(CFX_WideString& wsPassWord); | 151 void GetPasswordChar(CFX_WideString& wsPassWord); |
153 FX_BOOL IsMultiLine(); | 152 bool IsMultiLine(); |
154 int32_t GetVerticalScrollPolicy(); | 153 int32_t GetVerticalScrollPolicy(); |
155 int32_t GetMaxChars(XFA_Element& eType); | 154 int32_t GetMaxChars(XFA_Element& eType); |
156 FX_BOOL GetFracDigits(int32_t& iFracDigits); | 155 bool GetFracDigits(int32_t& iFracDigits); |
157 FX_BOOL GetLeadDigits(int32_t& iLeadDigits); | 156 bool GetLeadDigits(int32_t& iLeadDigits); |
158 | 157 |
159 CFX_WideString NumericLimit(const CFX_WideString& wsValue, | 158 CFX_WideString NumericLimit(const CFX_WideString& wsValue, |
160 int32_t iLead, | 159 int32_t iLead, |
161 int32_t iTread) const; | 160 int32_t iTread) const; |
162 | 161 |
163 FX_BOOL m_bIsNull; | 162 bool m_bIsNull; |
164 FX_BOOL m_bPreNull; | 163 bool m_bPreNull; |
165 | 164 |
166 protected: | 165 protected: |
167 void SyncValue(const CFX_WideString& wsValue, bool bNotify); | 166 void SyncValue(const CFX_WideString& wsValue, bool bNotify); |
168 void InsertListTextItem(CXFA_Node* pItems, | 167 void InsertListTextItem(CXFA_Node* pItems, |
169 const CFX_WideString& wsText, | 168 const CFX_WideString& wsText, |
170 int32_t nIndex = -1); | 169 int32_t nIndex = -1); |
171 void FormatNumStr(const CFX_WideString& wsValue, | 170 void FormatNumStr(const CFX_WideString& wsValue, |
172 IFX_Locale* pLocale, | 171 IFX_Locale* pLocale, |
173 CFX_WideString& wsOutput); | 172 CFX_WideString& wsOutput); |
174 | 173 |
175 CXFA_Node* m_pUiChildNode; | 174 CXFA_Node* m_pUiChildNode; |
176 XFA_Element m_eUIType; | 175 XFA_Element m_eUIType; |
177 }; | 176 }; |
178 | 177 |
179 #endif // XFA_FXFA_PARSER_CXFA_WIDGETDATA_H_ | 178 #endif // XFA_FXFA_PARSER_CXFA_WIDGETDATA_H_ |
OLD | NEW |