Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fxfa / src / app / xfa_ffpageview.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 _FXFA_FORMFILLER_PAGEVIEW_IMP_H\r
8 #define _FXFA_FORMFILLER_PAGEVIEW_IMP_H\r
9 class CXFA_FFWidget;\r
10 class CXFA_FFDocView;\r
11 class CXFA_FFPageView : public CXFA_ContainerLayoutItemImpl, public IXFA_PageView\r
12 {\r
13 public:\r
14     CXFA_FFPageView(CXFA_FFDocView* pDocView, CXFA_Node* pPageArea);\r
15     ~CXFA_FFPageView();\r
16     virtual IXFA_DocView*       GetDocView();\r
17     virtual FX_INT32            GetPageViewIndex();\r
18     virtual void                        GetPageViewRect(CFX_RectF &rtPage);\r
19     virtual void                        GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, FX_INT32 iRotate);\r
20     virtual FX_INT32            LoadPageView(IFX_Pause *pPause = NULL);\r
21     virtual void                        UnloadPageView();\r
22     FX_BOOL                                     IsPageViewLoaded();\r
23 \r
24     virtual XFA_HWIDGET         GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy);\r
25     virtual IXFA_WidgetIterator* CreateWidgetIterator(FX_DWORD dwTraverseWay = XFA_TRAVERSEWAY_Form,\r
26             FX_DWORD dwWidgetFilter = XFA_WIDGETFILTER_Visible | XFA_WIDGETFILTER_Viewable | XFA_WIDGETFILTER_AllType);\r
27     IXFA_LayoutPage*            GetLayoutPage()\r
28     {\r
29         return (IXFA_LayoutPage*)this;\r
30     }\r
31 protected:\r
32     CXFA_FFDocView*                     m_pDocView;\r
33     FX_BOOL                                     m_bLoaded;\r
34 };\r
35 typedef         CXFA_NodeIteratorTemplate<CXFA_LayoutItem, CXFA_TraverseStrategy_LayoutItem> CXFA_LayoutItemIterator;\r
36 class CXFA_FFPageWidgetIterator : public IXFA_WidgetIterator, public CFX_Object\r
37 {\r
38 public:\r
39     CXFA_FFPageWidgetIterator(CXFA_FFPageView* pPageView, FX_DWORD dwFilter);\r
40     virtual ~CXFA_FFPageWidgetIterator();\r
41     virtual void                                Release()\r
42     {\r
43         delete this;\r
44     }\r
45 \r
46     virtual void                                Reset();\r
47     virtual XFA_HWIDGET                 MoveToFirst();\r
48     virtual XFA_HWIDGET                 MoveToLast();\r
49     virtual XFA_HWIDGET                 MoveToNext();\r
50     virtual XFA_HWIDGET                 MoveToPrevious();\r
51     virtual XFA_HWIDGET                 GetCurrentWidget();\r
52     virtual FX_BOOL                             SetCurrentWidget(XFA_HWIDGET hWidget);\r
53 protected:\r
54     XFA_HWIDGET                                 GetWidget(CXFA_LayoutItem* pLayoutItem);\r
55     CXFA_FFPageView*                    m_pPageView;\r
56     XFA_HWIDGET                                 m_hCurWidget;\r
57     FX_DWORD                                    m_dwFilter;\r
58     FX_BOOL                                             m_bIgnorerelevant;\r
59     CXFA_LayoutItemIterator             m_sIterator;\r
60 };\r
61 typedef         CFX_ArrayTemplate<CXFA_FFWidget*> CXFA_WidgetArray;\r
62 class CXFA_TabParam : public CFX_Object\r
63 {\r
64 public:\r
65     CXFA_TabParam() : m_pWidget(NULL) {}\r
66     ~CXFA_TabParam() {}\r
67 \r
68     CXFA_FFWidget*              m_pWidget;\r
69     CXFA_WidgetArray            m_Children;\r
70 };\r
71 class CXFA_FFTabOrderPageWidgetIterator : public IXFA_WidgetIterator, public CFX_Object\r
72 {\r
73 public:\r
74     CXFA_FFTabOrderPageWidgetIterator(CXFA_FFPageView* pPageView, FX_DWORD dwFilter);\r
75     virtual ~CXFA_FFTabOrderPageWidgetIterator();\r
76 \r
77     virtual void Release();\r
78 \r
79     virtual void Reset();\r
80     virtual XFA_HWIDGET MoveToFirst();\r
81     virtual XFA_HWIDGET MoveToLast();\r
82     virtual XFA_HWIDGET MoveToNext();\r
83     virtual XFA_HWIDGET MoveToPrevious();\r
84     virtual XFA_HWIDGET GetCurrentWidget();\r
85     virtual FX_BOOL             SetCurrentWidget(XFA_HWIDGET hWidget);\r
86 protected:\r
87     CXFA_WidgetArray                                            m_TabOrderWidgetArray;\r
88     CXFA_FFPageView*                                    m_pPageView;\r
89     FX_DWORD                                                    m_dwFilter;\r
90     FX_INT32                                                    m_iCurWidget;\r
91     FX_BOOL                                                             m_bIgnorerelevant;\r
92     CXFA_FFWidget*                      GetTraverseWidget(CXFA_FFWidget* pWidget);\r
93     CXFA_FFWidget*                      FindWidgetByName(FX_WSTR wsWidgetName, CXFA_FFWidget* pRefWidget);\r
94     void                                        CreateTabOrderWidgetArray();\r
95     void                                        CreateSpaceOrderWidgetArray(CXFA_WidgetArray& WidgetArray);\r
96     CXFA_FFWidget*                      GetWidget(CXFA_LayoutItem* pLayoutItem);\r
97     void                                        OrderContainer(CXFA_LayoutItemIterator* sIterator, CXFA_LayoutItem* pContainerItem, CXFA_TabParam* pContainer, FX_BOOL &bCurrentItem, FX_BOOL& bContentArea, FX_BOOL bMarsterPage = FALSE);\r
98 };\r
99 #endif\r