Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fxfa / src / parser / xfa_script_resolveprocessor.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 _XFA_RESOLVEPROCESSOR_H_\r
8 #define _XFA_RESOLVEPROCESSOR_H_\r
9 class CXFA_NodeHelper;\r
10 class CXFA_ScriptContext;\r
11 class CXFA_ResolveNodesData : public CFX_Object\r
12 {\r
13 public:\r
14     CXFA_ResolveNodesData(CXFA_ScriptContext *pSC = NULL)\r
15         : m_pSC(pSC)\r
16         , m_CurNode(NULL)\r
17         , m_wsName()\r
18         , m_uHashName(0)\r
19         , m_wsCondition()\r
20         , m_nLevel(0)\r
21         , m_Nodes()\r
22         , m_dwStyles(XFA_RESOLVENODE_Children)\r
23         , m_pScriptAttribute(NULL)\r
24         , m_dwFlag(XFA_RESOVENODE_RSTYPE_Nodes)\r
25     {\r
26     }\r
27     ~CXFA_ResolveNodesData()\r
28     {\r
29         m_Nodes.RemoveAll();\r
30     }\r
31     CXFA_ScriptContext*                 m_pSC;\r
32     CXFA_Object*                                m_CurNode;\r
33     CFX_WideString                              m_wsName;\r
34     FX_UINT32                                   m_uHashName;\r
35     CFX_WideString                              m_wsCondition;\r
36     FX_INT32                                    m_nLevel;\r
37     CXFA_ObjArray                               m_Nodes;\r
38     FX_DWORD                                    m_dwStyles;\r
39     XFA_LPCSCRIPTATTRIBUTEINFO  m_pScriptAttribute;\r
40     XFA_RESOVENODE_RSTYPE               m_dwFlag;\r
41 };\r
42 class CXFA_ResolveProcessor : public CFX_Object\r
43 {\r
44 public:\r
45     CXFA_ResolveProcessor(void);\r
46     ~CXFA_ResolveProcessor(void);\r
47     FX_INT32    XFA_ResolveNodes(CXFA_ResolveNodesData &rnd);\r
48     FX_INT32    XFA_ResolveNodes_AnyChild(CXFA_ResolveNodesData &rnd);\r
49     FX_INT32    XFA_ResolveNodes_Dollar(CXFA_ResolveNodesData &rnd);\r
50     FX_INT32    XFA_ResolveNodes_Excalmatory(CXFA_ResolveNodesData &rnd);\r
51     FX_INT32    XFA_ResolveNodes_NumberSign(CXFA_ResolveNodesData &rnd);\r
52     FX_INT32    XFA_ResolveNodes_Asterisk(CXFA_ResolveNodesData &rnd);\r
53     FX_INT32    XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &rnd);\r
54     FX_INT32    XFA_ResolveNodes_ForAttributeRs(CXFA_Object* curNode, CXFA_ResolveNodesData &rnd, FX_WSTR strAttr);\r
55     void                XFA_ResolveNode_ConditionArray(FX_INT32 iCurIndex, CFX_WideString wsCondition, FX_INT32 iFoundCount, CXFA_ResolveNodesData &rnd);\r
56     void                XFA_ResolveNode_DoPredicateFilter(FX_INT32 iCurIndex, CFX_WideString wsCondition, FX_INT32 iFoundCount, CXFA_ResolveNodesData &rnd);\r
57     FX_INT32    XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, FX_INT32 nStart, CXFA_ResolveNodesData &rnd);\r
58     void                XFA_ResolveNode_FilterCondition(CXFA_ResolveNodesData &rnd, CFX_WideString wsCondition);\r
59     FX_INT32    XFA_ResolveNodes_PopStack(CFX_Int32Array &stack);\r
60     void                XFA_ResolveNodes_SetStylesForChild(FX_DWORD dwParentStyles, CXFA_ResolveNodesData &rnd);\r
61     FX_INT32    XFA_ResolveNode_SetResultCreateNode(XFA_RESOLVENODE_RS& resolveNodeRS, CFX_WideString &wsLastCondition);\r
62     void            XFA_ResolveNode_SetIndexDataBind(CFX_WideString &wsNextCondition, FX_INT32 &iIndex, FX_INT32 iCount);\r
63     CXFA_NodeHelper* GetNodeHelper()\r
64     {\r
65         return m_pNodeHelper;\r
66     }\r
67 private:\r
68     CXFA_NodeHelper* m_pNodeHelper;\r
69 public:\r
70     FX_INT32             m_iCurStart;\r
71 };\r
72 #endif\r