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_PARSER_XFA_UTILS_H_ | 7 #ifndef XFA_FXFA_PARSER_XFA_UTILS_H_ |
8 #define XFA_FXFA_PARSER_XFA_UTILS_H_ | 8 #define XFA_FXFA_PARSER_XFA_UTILS_H_ |
9 | 9 |
10 #include "xfa/fde/xml/fde_xml.h" | 10 #include "xfa/fde/xml/fde_xml.h" |
11 #include "xfa/include/fxfa/fxfa_basic.h" | 11 #include "xfa/include/fxfa/fxfa_basic.h" |
12 | 12 |
13 class CFDE_XMLElement; | 13 class CFDE_XMLElement; |
14 class CFDE_XMLNode; | 14 class CFDE_XMLNode; |
15 class CXFA_LocaleValue; | 15 class CXFA_LocaleValue; |
16 | 16 |
| 17 inline FX_BOOL XFA_IsSpace(FX_WCHAR c) { |
| 18 return (c == 0x20) || (c == 0x0d) || (c == 0x0a) || (c == 0x09); |
| 19 } |
| 20 inline FX_BOOL XFA_IsDigit(FX_WCHAR c) { |
| 21 return c >= '0' && c <= '9'; |
| 22 } |
| 23 |
17 FX_BOOL XFA_FDEExtension_ResolveNamespaceQualifier( | 24 FX_BOOL XFA_FDEExtension_ResolveNamespaceQualifier( |
18 CFDE_XMLElement* pNode, | 25 CFDE_XMLElement* pNode, |
19 const CFX_WideStringC& wsQualifier, | 26 const CFX_WideStringC& wsQualifier, |
20 CFX_WideString& wsNamespaceURI); | 27 CFX_WideString& wsNamespaceURI); |
21 template <class NodeType, class TraverseStrategy> | 28 template <class NodeType, class TraverseStrategy> |
22 class CXFA_NodeIteratorTemplate { | 29 class CXFA_NodeIteratorTemplate { |
23 public: | 30 public: |
24 CXFA_NodeIteratorTemplate(NodeType* pRootNode = NULL) : m_pRoot(pRootNode) { | 31 CXFA_NodeIteratorTemplate(NodeType* pRootNode = NULL) : m_pRoot(pRootNode) { |
25 if (pRootNode) { | 32 if (pRootNode) { |
26 m_NodeStack.Push(pRootNode); | 33 m_NodeStack.Push(pRootNode); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 void* pValue = NULL; | 195 void* pValue = NULL; |
189 CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue); | 196 CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue); |
190 rKey = (KeyType)(uintptr_t)pKey; | 197 rKey = (KeyType)(uintptr_t)pKey; |
191 } | 198 } |
192 }; | 199 }; |
193 class CXFA_Node; | 200 class CXFA_Node; |
194 class CXFA_WidgetData; | 201 class CXFA_WidgetData; |
195 | 202 |
196 CXFA_Node* XFA_CreateUIChild(CXFA_Node* pNode, XFA_ELEMENT& eWidgetType); | 203 CXFA_Node* XFA_CreateUIChild(CXFA_Node* pNode, XFA_ELEMENT& eWidgetType); |
197 CXFA_LocaleValue XFA_GetLocaleValue(CXFA_WidgetData* pWidgetData); | 204 CXFA_LocaleValue XFA_GetLocaleValue(CXFA_WidgetData* pWidgetData); |
198 CFX_WideString XFA_NumericLimit(const CFX_WideString& wsValue, | |
199 int32_t iLead, | |
200 int32_t iTread); | |
201 FX_DOUBLE XFA_WideStringToDouble(const CFX_WideString& wsStringVal); | 205 FX_DOUBLE XFA_WideStringToDouble(const CFX_WideString& wsStringVal); |
202 FX_DOUBLE XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal); | 206 FX_DOUBLE XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal); |
203 int32_t XFA_MapRotation(int32_t nRotation); | 207 int32_t XFA_MapRotation(int32_t nRotation); |
204 | 208 |
205 FX_BOOL XFA_RecognizeRichText(CFDE_XMLElement* pRichTextXMLNode); | 209 FX_BOOL XFA_RecognizeRichText(CFDE_XMLElement* pRichTextXMLNode); |
206 void XFA_GetPlainTextFromRichText(CFDE_XMLNode* pXMLNode, | 210 void XFA_GetPlainTextFromRichText(CFDE_XMLNode* pXMLNode, |
207 CFX_WideString& wsPlainText); | 211 CFX_WideString& wsPlainText); |
208 FX_BOOL XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode); | 212 FX_BOOL XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode); |
209 IFX_Stream* XFA_CreateWideTextRead(const CFX_WideString& wsBuffer); | 213 IFX_Stream* XFA_CreateWideTextRead(const CFX_WideString& wsBuffer); |
210 FX_BOOL XFA_IsLayoutElement(XFA_ELEMENT eElement, | 214 FX_BOOL XFA_IsLayoutElement(XFA_ELEMENT eElement, |
211 FX_BOOL bLayoutContainer = FALSE); | 215 FX_BOOL bLayoutContainer = FALSE); |
212 FX_BOOL XFA_IsTakingupSpace(XFA_ATTRIBUTEENUM ePresence); | 216 FX_BOOL XFA_IsTakingupSpace(XFA_ATTRIBUTEENUM ePresence); |
213 FX_BOOL XFA_IsFlowingLayout(XFA_ATTRIBUTEENUM eLayout); | 217 FX_BOOL XFA_IsFlowingLayout(XFA_ATTRIBUTEENUM eLayout); |
214 FX_BOOL XFA_IsHorizontalFlow(XFA_ATTRIBUTEENUM eLayout); | 218 FX_BOOL XFA_IsHorizontalFlow(XFA_ATTRIBUTEENUM eLayout); |
215 void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node* pDataNode); | 219 void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node* pDataNode); |
216 void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode, | 220 void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode, |
217 IFX_Stream* pStream, | 221 IFX_Stream* pStream, |
218 const FX_CHAR* pChecksum = NULL, | 222 const FX_CHAR* pChecksum = NULL, |
219 FX_BOOL bSaveXML = FALSE); | 223 FX_BOOL bSaveXML = FALSE); |
220 | 224 |
221 #endif // XFA_FXFA_PARSER_XFA_UTILS_H_ | 225 #endif // XFA_FXFA_PARSER_XFA_UTILS_H_ |
OLD | NEW |