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_APP_XFA_FFDOCVIEW_H_ | 7 #ifndef XFA_INCLUDE_FXFA_XFA_FFDOCVIEW_H_ |
8 #define XFA_FXFA_APP_XFA_FFDOCVIEW_H_ | 8 #define XFA_INCLUDE_FXFA_XFA_FFDOCVIEW_H_ |
9 | 9 |
10 #include "xfa/fxfa/app/xfa_ffdoc.h" | 10 #include "xfa/include/fxfa/xfa_ffdoc.h" |
11 | 11 |
12 class CXFA_FFWidgetHandler; | 12 class CXFA_FFWidgetHandler; |
13 class CXFA_FFDoc; | 13 class CXFA_FFDoc; |
14 class CXFA_FFWidget; | 14 class CXFA_FFWidget; |
| 15 class CXFA_WidgetAccIterator; |
| 16 |
15 extern const XFA_ATTRIBUTEENUM gs_EventActivity[]; | 17 extern const XFA_ATTRIBUTEENUM gs_EventActivity[]; |
16 enum XFA_DOCVIEW_LAYOUTSTATUS { | 18 enum XFA_DOCVIEW_LAYOUTSTATUS { |
17 XFA_DOCVIEW_LAYOUTSTATUS_None, | 19 XFA_DOCVIEW_LAYOUTSTATUS_None, |
18 XFA_DOCVIEW_LAYOUTSTATUS_Start, | 20 XFA_DOCVIEW_LAYOUTSTATUS_Start, |
19 XFA_DOCVIEW_LAYOUTSTATUS_FormInitialize, | 21 XFA_DOCVIEW_LAYOUTSTATUS_FormInitialize, |
20 XFA_DOCVIEW_LAYOUTSTATUS_FormInitCalculate, | 22 XFA_DOCVIEW_LAYOUTSTATUS_FormInitCalculate, |
21 XFA_DOCVIEW_LAYOUTSTATUS_FormInitValidate, | 23 XFA_DOCVIEW_LAYOUTSTATUS_FormInitValidate, |
22 XFA_DOCVIEW_LAYOUTSTATUS_FormFormReady, | 24 XFA_DOCVIEW_LAYOUTSTATUS_FormFormReady, |
23 XFA_DOCVIEW_LAYOUTSTATUS_Doing, | 25 XFA_DOCVIEW_LAYOUTSTATUS_Doing, |
24 XFA_DOCVIEW_LAYOUTSTATUS_PagesetInitialize, | 26 XFA_DOCVIEW_LAYOUTSTATUS_PagesetInitialize, |
25 XFA_DOCVIEW_LAYOUTSTATUS_PagesetInitCalculate, | 27 XFA_DOCVIEW_LAYOUTSTATUS_PagesetInitCalculate, |
26 XFA_DOCVIEW_LAYOUTSTATUS_PagesetInitValidate, | 28 XFA_DOCVIEW_LAYOUTSTATUS_PagesetInitValidate, |
27 XFA_DOCVIEW_LAYOUTSTATUS_PagesetFormReady, | 29 XFA_DOCVIEW_LAYOUTSTATUS_PagesetFormReady, |
28 XFA_DOCVIEW_LAYOUTSTATUS_LayoutReady, | 30 XFA_DOCVIEW_LAYOUTSTATUS_LayoutReady, |
29 XFA_DOCVIEW_LAYOUTSTATUS_DocReady, | 31 XFA_DOCVIEW_LAYOUTSTATUS_DocReady, |
30 XFA_DOCVIEW_LAYOUTSTATUS_End | 32 XFA_DOCVIEW_LAYOUTSTATUS_End |
31 }; | 33 }; |
32 class CXFA_FFDocView : public IXFA_DocView { | 34 class CXFA_FFDocView { |
33 public: | 35 public: |
34 CXFA_FFDocView(CXFA_FFDoc* pDoc); | 36 CXFA_FFDocView(CXFA_FFDoc* pDoc); |
35 ~CXFA_FFDocView(); | 37 ~CXFA_FFDocView(); |
36 | 38 |
37 virtual IXFA_Doc* GetDoc() { return m_pDoc; } | 39 CXFA_FFDoc* GetDoc() { return m_pDoc; } |
38 virtual int32_t StartLayout(int32_t iStartPage = 0); | 40 int32_t StartLayout(int32_t iStartPage = 0); |
39 virtual int32_t DoLayout(IFX_Pause* pPause = NULL); | 41 int32_t DoLayout(IFX_Pause* pPause = NULL); |
40 virtual void StopLayout(); | 42 void StopLayout(); |
41 virtual int32_t GetLayoutStatus(); | 43 int32_t GetLayoutStatus(); |
42 virtual void UpdateDocView(); | 44 void UpdateDocView(); |
43 virtual int32_t CountPageViews(); | 45 int32_t CountPageViews(); |
44 virtual IXFA_PageView* GetPageView(int32_t nIndex); | 46 CXFA_FFPageView* GetPageView(int32_t nIndex); |
45 virtual IXFA_Widget* GetWidgetByName(const CFX_WideStringC& wsName); | 47 |
46 virtual CXFA_WidgetAcc* GetWidgetAccByName(const CFX_WideStringC& wsName); | 48 void ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc = NULL); |
47 virtual void ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc = NULL); | 49 int32_t ProcessWidgetEvent(CXFA_EventParam* pParam, |
48 virtual int32_t ProcessWidgetEvent(CXFA_EventParam* pParam, | 50 CXFA_WidgetAcc* pWidgetAcc = NULL); |
49 CXFA_WidgetAcc* pWidgetAcc = NULL); | 51 CXFA_FFWidgetHandler* GetWidgetHandler(); |
50 virtual IXFA_WidgetHandler* GetWidgetHandler(); | 52 IXFA_WidgetIterator* CreateWidgetIterator(); |
51 virtual IXFA_WidgetIterator* CreateWidgetIterator(); | 53 CXFA_WidgetAccIterator* CreateWidgetAccIterator( |
52 virtual IXFA_WidgetAccIterator* CreateWidgetAccIterator( | |
53 XFA_WIDGETORDER eOrder = XFA_WIDGETORDER_PreOrder); | 54 XFA_WIDGETORDER eOrder = XFA_WIDGETORDER_PreOrder); |
54 virtual IXFA_Widget* GetFocusWidget(); | 55 CXFA_FFWidget* GetFocusWidget(); |
55 virtual void KillFocus(); | 56 void KillFocus(); |
56 virtual FX_BOOL SetFocus(IXFA_Widget* hWidget); | 57 FX_BOOL SetFocus(CXFA_FFWidget* hWidget); |
57 CXFA_FFWidget* GetWidgetByName(const CFX_WideStringC& wsName, | 58 CXFA_FFWidget* GetWidgetByName(const CFX_WideStringC& wsName, |
58 CXFA_FFWidget* pRefWidget = NULL); | 59 CXFA_FFWidget* pRefWidget = NULL); |
59 CXFA_WidgetAcc* GetWidgetAccByName(const CFX_WideStringC& wsName, | 60 CXFA_WidgetAcc* GetWidgetAccByName(const CFX_WideStringC& wsName, |
60 CXFA_WidgetAcc* pRefWidgetAcc = NULL); | 61 CXFA_WidgetAcc* pRefWidgetAcc = NULL); |
61 IXFA_DocLayout* GetXFALayout() const; | 62 CXFA_LayoutProcessor* GetXFALayout() const; |
62 void OnPageEvent(IXFA_LayoutPage* pSender, | 63 void OnPageEvent(CXFA_ContainerLayoutItem* pSender, |
63 XFA_PAGEEVENT eEvent, | 64 XFA_PAGEEVENT eEvent, |
64 int32_t iPageIndex); | 65 int32_t iPageIndex); |
65 void LockUpdate(); | 66 void LockUpdate(); |
66 void UnlockUpdate(); | 67 void UnlockUpdate(); |
67 FX_BOOL IsUpdateLocked(); | 68 FX_BOOL IsUpdateLocked(); |
68 void ClearInvalidateList(); | 69 void ClearInvalidateList(); |
69 void AddInvalidateRect(CXFA_FFWidget* pWidget, const CFX_RectF& rtInvalidate); | 70 void AddInvalidateRect(CXFA_FFWidget* pWidget, const CFX_RectF& rtInvalidate); |
70 void AddInvalidateRect(IXFA_PageView* pPageView, | 71 void AddInvalidateRect(CXFA_FFPageView* pPageView, |
71 const CFX_RectF& rtInvalidate); | 72 const CFX_RectF& rtInvalidate); |
72 void RunInvalidate(); | 73 void RunInvalidate(); |
73 void RunDocClose(); | 74 void RunDocClose(); |
74 void DestroyDocView(); | 75 void DestroyDocView(); |
75 | 76 |
76 FX_BOOL InitValidate(CXFA_Node* pNode); | 77 FX_BOOL InitValidate(CXFA_Node* pNode); |
77 FX_BOOL RunValidate(); | 78 FX_BOOL RunValidate(); |
78 | 79 |
79 void SetChangeMark(); | 80 void SetChangeMark(); |
80 | 81 |
(...skipping 24 matching lines...) Expand all Loading... |
105 void RunBindItems(); | 106 void RunBindItems(); |
106 FX_BOOL InitCalculate(CXFA_Node* pNode); | 107 FX_BOOL InitCalculate(CXFA_Node* pNode); |
107 void InitLayout(CXFA_Node* pNode); | 108 void InitLayout(CXFA_Node* pNode); |
108 void RunCalculateRecursive(int32_t& iIndex); | 109 void RunCalculateRecursive(int32_t& iIndex); |
109 void ShowNullTestMsg(); | 110 void ShowNullTestMsg(); |
110 FX_BOOL ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc); | 111 FX_BOOL ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc); |
111 CXFA_Node* GetRootSubform(); | 112 CXFA_Node* GetRootSubform(); |
112 | 113 |
113 CXFA_FFDoc* m_pDoc; | 114 CXFA_FFDoc* m_pDoc; |
114 CXFA_FFWidgetHandler* m_pWidgetHandler; | 115 CXFA_FFWidgetHandler* m_pWidgetHandler; |
115 IXFA_DocLayout* m_pXFADocLayout; | 116 CXFA_LayoutProcessor* m_pXFADocLayout; |
116 CXFA_WidgetAcc* m_pFocusAcc; | 117 CXFA_WidgetAcc* m_pFocusAcc; |
117 CXFA_FFWidget* m_pFocusWidget; | 118 CXFA_FFWidget* m_pFocusWidget; |
118 CXFA_FFWidget* m_pOldFocusWidget; | 119 CXFA_FFWidget* m_pOldFocusWidget; |
119 CFX_MapPtrToPtr m_mapPageInvalidate; | 120 CFX_MapPtrToPtr m_mapPageInvalidate; |
120 CFX_PtrArray m_ValidateAccs; | 121 CFX_PtrArray m_ValidateAccs; |
121 CFX_PtrArray m_bindItems; | 122 CFX_PtrArray m_bindItems; |
122 CFX_PtrArray m_CalculateAccs; | 123 CFX_PtrArray m_CalculateAccs; |
123 | 124 |
124 CFX_PtrArray m_NewAddedNodes; | 125 CFX_PtrArray m_NewAddedNodes; |
125 CFX_PtrArray m_IndexChangedSubforms; | 126 CFX_PtrArray m_IndexChangedSubforms; |
126 XFA_DOCVIEW_LAYOUTSTATUS m_iStatus; | 127 XFA_DOCVIEW_LAYOUTSTATUS m_iStatus; |
127 int32_t m_iLock; | 128 int32_t m_iLock; |
128 friend class CXFA_FFNotify; | 129 friend class CXFA_FFNotify; |
129 }; | 130 }; |
130 class CXFA_FFDocWidgetIterator : public IXFA_WidgetIterator { | 131 class CXFA_FFDocWidgetIterator : public IXFA_WidgetIterator { |
131 public: | 132 public: |
132 CXFA_FFDocWidgetIterator(CXFA_FFDocView* pDocView, CXFA_Node* pTravelRoot); | 133 CXFA_FFDocWidgetIterator(CXFA_FFDocView* pDocView, CXFA_Node* pTravelRoot); |
133 virtual ~CXFA_FFDocWidgetIterator(); | 134 virtual ~CXFA_FFDocWidgetIterator(); |
134 | 135 |
135 virtual void Release() { delete this; } | 136 virtual void Release() { delete this; } |
136 | 137 |
137 virtual void Reset(); | 138 virtual void Reset(); |
138 virtual IXFA_Widget* MoveToFirst(); | 139 virtual CXFA_FFWidget* MoveToFirst(); |
139 virtual IXFA_Widget* MoveToLast(); | 140 virtual CXFA_FFWidget* MoveToLast(); |
140 virtual IXFA_Widget* MoveToNext(); | 141 virtual CXFA_FFWidget* MoveToNext(); |
141 virtual IXFA_Widget* MoveToPrevious(); | 142 virtual CXFA_FFWidget* MoveToPrevious(); |
142 virtual IXFA_Widget* GetCurrentWidget(); | 143 virtual CXFA_FFWidget* GetCurrentWidget(); |
143 virtual FX_BOOL SetCurrentWidget(IXFA_Widget* hWidget); | 144 virtual FX_BOOL SetCurrentWidget(CXFA_FFWidget* hWidget); |
144 | 145 |
145 protected: | 146 protected: |
146 CXFA_ContainerIterator m_ContentIterator; | 147 CXFA_ContainerIterator m_ContentIterator; |
147 CXFA_FFDocView* m_pDocView; | 148 CXFA_FFDocView* m_pDocView; |
148 CXFA_FFWidget* m_pCurWidget; | 149 CXFA_FFWidget* m_pCurWidget; |
149 }; | 150 }; |
150 class CXFA_WidgetAccIterator : public IXFA_WidgetAccIterator { | 151 class CXFA_WidgetAccIterator { |
151 public: | 152 public: |
152 CXFA_WidgetAccIterator(CXFA_FFDocView* pDocView, CXFA_Node* pTravelRoot); | 153 CXFA_WidgetAccIterator(CXFA_FFDocView* pDocView, CXFA_Node* pTravelRoot); |
153 virtual ~CXFA_WidgetAccIterator(); | 154 ~CXFA_WidgetAccIterator(); |
154 virtual void Release() { delete this; } | 155 |
155 virtual void Reset(); | 156 void Release() { delete this; } |
156 virtual CXFA_WidgetAcc* MoveToFirst(); | 157 void Reset(); |
157 virtual CXFA_WidgetAcc* MoveToLast(); | 158 CXFA_WidgetAcc* MoveToFirst(); |
158 virtual CXFA_WidgetAcc* MoveToNext(); | 159 CXFA_WidgetAcc* MoveToLast(); |
159 virtual CXFA_WidgetAcc* MoveToPrevious(); | 160 CXFA_WidgetAcc* MoveToNext(); |
160 virtual CXFA_WidgetAcc* GetCurrentWidgetAcc(); | 161 CXFA_WidgetAcc* MoveToPrevious(); |
161 virtual FX_BOOL SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget); | 162 CXFA_WidgetAcc* GetCurrentWidgetAcc(); |
162 virtual void SkipTree(); | 163 FX_BOOL SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget); |
| 164 void SkipTree(); |
163 | 165 |
164 protected: | 166 protected: |
165 CXFA_ContainerIterator m_ContentIterator; | 167 CXFA_ContainerIterator m_ContentIterator; |
166 CXFA_FFDocView* m_pDocView; | 168 CXFA_FFDocView* m_pDocView; |
167 CXFA_WidgetAcc* m_pCurWidgetAcc; | 169 CXFA_WidgetAcc* m_pCurWidgetAcc; |
168 }; | 170 }; |
169 | 171 |
170 #endif // XFA_FXFA_APP_XFA_FFDOCVIEW_H_ | 172 #endif // XFA_INCLUDE_FXFA_XFA_FFDOCVIEW_H_ |
OLD | NEW |