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_XFA_FFWIDGETHANDLER_H_ | 7 #ifndef XFA_FXFA_XFA_FFWIDGETHANDLER_H_ |
8 #define XFA_FXFA_XFA_FFWIDGETHANDLER_H_ | 8 #define XFA_FXFA_XFA_FFWIDGETHANDLER_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "xfa/fxfa/cxfa_eventparam.h" | 12 #include "xfa/fxfa/cxfa_eventparam.h" |
13 #include "xfa/fxfa/fxfa.h" | 13 #include "xfa/fxfa/fxfa.h" |
14 #include "xfa/fxfa/parser/cxfa_document.h" | 14 #include "xfa/fxfa/parser/cxfa_document.h" |
15 | 15 |
16 class CXFA_FFDocView; | 16 class CXFA_FFDocView; |
17 enum class FWL_WidgetHit; | 17 enum class FWL_WidgetHit; |
18 | 18 |
19 class CXFA_FFWidgetHandler { | 19 class CXFA_FFWidgetHandler { |
20 public: | 20 public: |
21 CXFA_FFWidgetHandler(CXFA_FFDocView* pDocView); | 21 CXFA_FFWidgetHandler(CXFA_FFDocView* pDocView); |
22 ~CXFA_FFWidgetHandler(); | 22 ~CXFA_FFWidgetHandler(); |
23 | 23 |
24 CXFA_FFWidget* CreateWidget(CXFA_FFWidget* hParent, | 24 CXFA_FFWidget* CreateWidget(CXFA_FFWidget* hParent, |
25 XFA_WIDGETTYPE eType, | 25 XFA_WIDGETTYPE eType, |
26 CXFA_FFWidget* hBefore = nullptr); | 26 CXFA_FFWidget* hBefore = nullptr); |
27 | 27 |
28 FX_BOOL OnMouseEnter(CXFA_FFWidget* hWidget); | 28 bool OnMouseEnter(CXFA_FFWidget* hWidget); |
29 FX_BOOL OnMouseExit(CXFA_FFWidget* hWidget); | 29 bool OnMouseExit(CXFA_FFWidget* hWidget); |
30 FX_BOOL OnLButtonDown(CXFA_FFWidget* hWidget, | 30 bool OnLButtonDown(CXFA_FFWidget* hWidget, |
31 uint32_t dwFlags, | 31 uint32_t dwFlags, |
32 FX_FLOAT fx, | 32 FX_FLOAT fx, |
33 FX_FLOAT fy); | 33 FX_FLOAT fy); |
34 FX_BOOL OnLButtonUp(CXFA_FFWidget* hWidget, | 34 bool OnLButtonUp(CXFA_FFWidget* hWidget, |
35 uint32_t dwFlags, | 35 uint32_t dwFlags, |
36 FX_FLOAT fx, | 36 FX_FLOAT fx, |
37 FX_FLOAT fy); | 37 FX_FLOAT fy); |
38 FX_BOOL OnLButtonDblClk(CXFA_FFWidget* hWidget, | 38 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, | 39 uint32_t dwFlags, |
48 int16_t zDelta, | |
49 FX_FLOAT fx, | 40 FX_FLOAT fx, |
50 FX_FLOAT fy); | 41 FX_FLOAT fy); |
51 FX_BOOL OnRButtonDown(CXFA_FFWidget* hWidget, | 42 bool OnMouseMove(CXFA_FFWidget* hWidget, |
52 uint32_t dwFlags, | 43 uint32_t dwFlags, |
53 FX_FLOAT fx, | 44 FX_FLOAT fx, |
54 FX_FLOAT fy); | 45 FX_FLOAT fy); |
55 FX_BOOL OnRButtonUp(CXFA_FFWidget* hWidget, | 46 bool OnMouseWheel(CXFA_FFWidget* hWidget, |
56 uint32_t dwFlags, | 47 uint32_t dwFlags, |
57 FX_FLOAT fx, | 48 int16_t zDelta, |
58 FX_FLOAT fy); | 49 FX_FLOAT fx, |
59 FX_BOOL OnRButtonDblClk(CXFA_FFWidget* hWidget, | 50 FX_FLOAT fy); |
60 uint32_t dwFlags, | 51 bool OnRButtonDown(CXFA_FFWidget* hWidget, |
61 FX_FLOAT fx, | 52 uint32_t dwFlags, |
62 FX_FLOAT fy); | 53 FX_FLOAT fx, |
| 54 FX_FLOAT fy); |
| 55 bool OnRButtonUp(CXFA_FFWidget* hWidget, |
| 56 uint32_t dwFlags, |
| 57 FX_FLOAT fx, |
| 58 FX_FLOAT fy); |
| 59 bool OnRButtonDblClk(CXFA_FFWidget* hWidget, |
| 60 uint32_t dwFlags, |
| 61 FX_FLOAT fx, |
| 62 FX_FLOAT fy); |
63 | 63 |
64 FX_BOOL OnKeyDown(CXFA_FFWidget* hWidget, | 64 bool OnKeyDown(CXFA_FFWidget* hWidget, uint32_t dwKeyCode, uint32_t dwFlags); |
65 uint32_t dwKeyCode, | 65 bool OnKeyUp(CXFA_FFWidget* hWidget, uint32_t dwKeyCode, uint32_t dwFlags); |
66 uint32_t dwFlags); | 66 bool OnChar(CXFA_FFWidget* hWidget, uint32_t dwChar, 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); | 67 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); | 68 bool OnSetCursor(CXFA_FFWidget* hWidget, FX_FLOAT fx, FX_FLOAT fy); |
71 void RenderWidget(CXFA_FFWidget* hWidget, | 69 void RenderWidget(CXFA_FFWidget* hWidget, |
72 CFX_Graphics* pGS, | 70 CFX_Graphics* pGS, |
73 CFX_Matrix* pMatrix, | 71 CFX_Matrix* pMatrix, |
74 FX_BOOL bHighlight); | 72 bool bHighlight); |
75 FX_BOOL HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType); | 73 bool HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType); |
76 int32_t ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam); | 74 int32_t ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam); |
77 | 75 |
78 protected: | 76 protected: |
79 CXFA_Node* CreateWidgetFormItem(XFA_WIDGETTYPE eType, | 77 CXFA_Node* CreateWidgetFormItem(XFA_WIDGETTYPE eType, |
80 CXFA_Node* pParent, | 78 CXFA_Node* pParent, |
81 CXFA_Node* pBefore) const; | 79 CXFA_Node* pBefore) const; |
82 | 80 |
83 CXFA_Node* CreatePushButton(CXFA_Node* pParent, CXFA_Node* pBefore) const; | 81 CXFA_Node* CreatePushButton(CXFA_Node* pParent, CXFA_Node* pBefore) const; |
84 CXFA_Node* CreateCheckButton(CXFA_Node* pParent, CXFA_Node* pBefore) const; | 82 CXFA_Node* CreateCheckButton(CXFA_Node* pParent, CXFA_Node* pBefore) const; |
85 CXFA_Node* CreateExclGroup(CXFA_Node* pParent, CXFA_Node* pBefore) const; | 83 CXFA_Node* CreateExclGroup(CXFA_Node* pParent, CXFA_Node* pBefore) const; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 uint32_t dwFlags, | 118 uint32_t dwFlags, |
121 FX_FLOAT fInsets[4]) const; | 119 FX_FLOAT fInsets[4]) const; |
122 CXFA_Node* CreateValueNode(XFA_Element eValue, CXFA_Node* pParent) const; | 120 CXFA_Node* CreateValueNode(XFA_Element eValue, CXFA_Node* pParent) const; |
123 CXFA_Document* GetObjFactory() const; | 121 CXFA_Document* GetObjFactory() const; |
124 CXFA_Document* GetXFADoc() const; | 122 CXFA_Document* GetXFADoc() const; |
125 | 123 |
126 CXFA_FFDocView* m_pDocView; | 124 CXFA_FFDocView* m_pDocView; |
127 }; | 125 }; |
128 | 126 |
129 #endif // XFA_FXFA_XFA_FFWIDGETHANDLER_H_ | 127 #endif // XFA_FXFA_XFA_FFWIDGETHANDLER_H_ |
OLD | NEW |