OLD | NEW |
| (Empty) |
1 // Copyright 2014 PDFium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
6 | |
7 #ifndef XFA_FXFA_INCLUDE_XFA_FFWIDGETHANDLER_H_ | |
8 #define XFA_FXFA_INCLUDE_XFA_FFWIDGETHANDLER_H_ | |
9 | |
10 #include <vector> | |
11 | |
12 #include "xfa/fxfa/include/cxfa_eventparam.h" | |
13 #include "xfa/fxfa/include/fxfa.h" | |
14 #include "xfa/fxfa/parser/cxfa_document.h" | |
15 | |
16 class CXFA_FFDocView; | |
17 enum class FWL_WidgetHit; | |
18 | |
19 class CXFA_FFWidgetHandler { | |
20 public: | |
21 CXFA_FFWidgetHandler(CXFA_FFDocView* pDocView); | |
22 ~CXFA_FFWidgetHandler(); | |
23 | |
24 CXFA_FFWidget* CreateWidget(CXFA_FFWidget* hParent, | |
25 XFA_WIDGETTYPE eType, | |
26 CXFA_FFWidget* hBefore = nullptr); | |
27 | |
28 FX_BOOL OnMouseEnter(CXFA_FFWidget* hWidget); | |
29 FX_BOOL OnMouseExit(CXFA_FFWidget* hWidget); | |
30 FX_BOOL OnLButtonDown(CXFA_FFWidget* hWidget, | |
31 uint32_t dwFlags, | |
32 FX_FLOAT fx, | |
33 FX_FLOAT fy); | |
34 FX_BOOL OnLButtonUp(CXFA_FFWidget* hWidget, | |
35 uint32_t dwFlags, | |
36 FX_FLOAT fx, | |
37 FX_FLOAT fy); | |
38 FX_BOOL OnLButtonDblClk(CXFA_FFWidget* hWidget, | |
39 uint32_t dwFlags, | |
40 FX_FLOAT fx, | |
41 FX_FLOAT fy); | |
42 FX_BOOL OnMouseMove(CXFA_FFWidget* hWidget, | |
43 uint32_t dwFlags, | |
44 FX_FLOAT fx, | |
45 FX_FLOAT fy); | |
46 FX_BOOL OnMouseWheel(CXFA_FFWidget* hWidget, | |
47 uint32_t dwFlags, | |
48 int16_t zDelta, | |
49 FX_FLOAT fx, | |
50 FX_FLOAT fy); | |
51 FX_BOOL OnRButtonDown(CXFA_FFWidget* hWidget, | |
52 uint32_t dwFlags, | |
53 FX_FLOAT fx, | |
54 FX_FLOAT fy); | |
55 FX_BOOL OnRButtonUp(CXFA_FFWidget* hWidget, | |
56 uint32_t dwFlags, | |
57 FX_FLOAT fx, | |
58 FX_FLOAT fy); | |
59 FX_BOOL OnRButtonDblClk(CXFA_FFWidget* hWidget, | |
60 uint32_t dwFlags, | |
61 FX_FLOAT fx, | |
62 FX_FLOAT fy); | |
63 | |
64 FX_BOOL OnKeyDown(CXFA_FFWidget* hWidget, | |
65 uint32_t dwKeyCode, | |
66 uint32_t dwFlags); | |
67 FX_BOOL OnKeyUp(CXFA_FFWidget* hWidget, uint32_t dwKeyCode, uint32_t dwFlags); | |
68 FX_BOOL OnChar(CXFA_FFWidget* hWidget, uint32_t dwChar, uint32_t dwFlags); | |
69 FWL_WidgetHit OnHitTest(CXFA_FFWidget* hWidget, FX_FLOAT fx, FX_FLOAT fy); | |
70 FX_BOOL OnSetCursor(CXFA_FFWidget* hWidget, FX_FLOAT fx, FX_FLOAT fy); | |
71 void RenderWidget(CXFA_FFWidget* hWidget, | |
72 CFX_Graphics* pGS, | |
73 CFX_Matrix* pMatrix, | |
74 FX_BOOL bHighlight); | |
75 FX_BOOL HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType); | |
76 int32_t ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam); | |
77 | |
78 protected: | |
79 CXFA_Node* CreateWidgetFormItem(XFA_WIDGETTYPE eType, | |
80 CXFA_Node* pParent, | |
81 CXFA_Node* pBefore) const; | |
82 | |
83 CXFA_Node* CreatePushButton(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
84 CXFA_Node* CreateCheckButton(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
85 CXFA_Node* CreateExclGroup(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
86 CXFA_Node* CreateRadioButton(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
87 CXFA_Node* CreateDatetimeEdit(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
88 CXFA_Node* CreateDecimalField(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
89 CXFA_Node* CreateNumericField(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
90 CXFA_Node* CreateSignature(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
91 CXFA_Node* CreateTextEdit(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
92 CXFA_Node* CreateDropdownList(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
93 CXFA_Node* CreateListBox(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
94 CXFA_Node* CreateImageField(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
95 CXFA_Node* CreatePasswordEdit(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
96 CXFA_Node* CreateField(XFA_Element eElement, | |
97 CXFA_Node* pParent, | |
98 CXFA_Node* pBefore) const; | |
99 CXFA_Node* CreateArc(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
100 CXFA_Node* CreateRectangle(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
101 CXFA_Node* CreateImage(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
102 CXFA_Node* CreateLine(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
103 CXFA_Node* CreateText(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
104 CXFA_Node* CreateDraw(XFA_Element eElement, | |
105 CXFA_Node* pParent, | |
106 CXFA_Node* pBefore) const; | |
107 | |
108 CXFA_Node* CreateSubform(CXFA_Node* pParent, CXFA_Node* pBefore) const; | |
109 CXFA_Node* CreateFormItem(XFA_Element eElement, | |
110 CXFA_Node* pParent, | |
111 CXFA_Node* pBefore) const; | |
112 CXFA_Node* CreateCopyNode(XFA_Element eElement, | |
113 CXFA_Node* pParent, | |
114 CXFA_Node* pBefore = nullptr) const; | |
115 CXFA_Node* CreateTemplateNode(XFA_Element eElement, | |
116 CXFA_Node* pParent, | |
117 CXFA_Node* pBefore) const; | |
118 CXFA_Node* CreateFontNode(CXFA_Node* pParent) const; | |
119 CXFA_Node* CreateMarginNode(CXFA_Node* pParent, | |
120 uint32_t dwFlags, | |
121 FX_FLOAT fInsets[4]) const; | |
122 CXFA_Node* CreateValueNode(XFA_Element eValue, CXFA_Node* pParent) const; | |
123 CXFA_Document* GetObjFactory() const; | |
124 CXFA_Document* GetXFADoc() const; | |
125 | |
126 CXFA_FFDocView* m_pDocView; | |
127 }; | |
128 | |
129 #endif // XFA_FXFA_INCLUDE_XFA_FFWIDGETHANDLER_H_ | |
OLD | NEW |