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_SRC_FXFA_APP_XFA_FFFIELD_H_ | |
8 #define XFA_SRC_FXFA_APP_XFA_FFFIELD_H_ | |
9 | |
10 #include "xfa/include/fwl/adapter/fwl_sdadapterimp.h" | |
11 #include "xfa/include/fwl/core/fwl_widget.h" | |
12 #include "xfa/include/fwl/lightwidget/widget.h" | |
13 #include "xfa/src/fxfa/app/xfa_ffpageview.h" | |
14 #include "xfa/src/fxfa/app/xfa_ffwidget.h" | |
15 | |
16 #define XFA_MINUI_HEIGHT 4.32f | |
17 #define XFA_DEFAULTUI_HEIGHT 2.0f | |
18 | |
19 class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { | |
20 public: | |
21 CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); | |
22 virtual ~CXFA_FFField(); | |
23 | |
24 virtual FX_BOOL GetBBox(CFX_RectF& rtBox, | |
25 FX_DWORD dwStatus, | |
26 FX_BOOL bDrawFocus = FALSE); | |
27 virtual void RenderWidget(CFX_Graphics* pGS, | |
28 CFX_Matrix* pMatrix = NULL, | |
29 FX_DWORD dwStatus = 0, | |
30 int32_t iRotate = 0); | |
31 virtual FX_BOOL IsLoaded(); | |
32 virtual FX_BOOL LoadWidget(); | |
33 virtual void UnloadWidget(); | |
34 virtual FX_BOOL PerformLayout(); | |
35 virtual void UpdateFWL(); | |
36 FX_DWORD UpdateUIProperty(); | |
37 virtual FX_BOOL OnMouseEnter(); | |
38 virtual FX_BOOL OnMouseExit(); | |
39 virtual FX_BOOL OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | |
40 virtual FX_BOOL OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | |
41 virtual FX_BOOL OnLButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | |
42 virtual FX_BOOL OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | |
43 virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, | |
44 int16_t zDelta, | |
45 FX_FLOAT fx, | |
46 FX_FLOAT fy); | |
47 virtual FX_BOOL OnRButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | |
48 virtual FX_BOOL OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | |
49 virtual FX_BOOL OnRButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | |
50 | |
51 virtual FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget); | |
52 virtual FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget); | |
53 virtual FX_BOOL OnKeyDown(FX_DWORD dwKeyCode, FX_DWORD dwFlags); | |
54 virtual FX_BOOL OnKeyUp(FX_DWORD dwKeyCode, FX_DWORD dwFlags); | |
55 virtual FX_BOOL OnChar(FX_DWORD dwChar, FX_DWORD dwFlags); | |
56 virtual FX_DWORD OnHitTest(FX_FLOAT fx, FX_FLOAT fy); | |
57 virtual FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy); | |
58 | |
59 protected: | |
60 virtual FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy); | |
61 virtual void SetFWLRect(); | |
62 void SetFWLThemeProvider(); | |
63 CFWL_Widget* GetNormalWidget() { return m_pNormalWidget; } | |
64 void FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy); | |
65 void LayoutCaption(); | |
66 void RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL); | |
67 | |
68 int32_t CalculateOverride(); | |
69 int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc); | |
70 FX_BOOL ProcessCommittedData(); | |
71 virtual FX_BOOL CommitData(); | |
72 virtual FX_BOOL IsDataChanged(); | |
73 void DrawHighlight(CFX_Graphics* pGS, | |
74 CFX_Matrix* pMatrix, | |
75 FX_DWORD dwStatus, | |
76 FX_BOOL bEllipse = FALSE); | |
77 void DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix); | |
78 void TranslateFWLMessage(CFWL_Message* pMessage); | |
79 void CapPlacement(); | |
80 void CapTopBottomPlacement(CXFA_Caption caption, | |
81 const CFX_RectF& rtWidget, | |
82 int32_t iCapPlacement); | |
83 void CapLeftRightPlacement(CXFA_Caption caption, | |
84 const CFX_RectF& rtWidget, | |
85 int32_t iCapPlacement); | |
86 void SetEditScrollOffset(); | |
87 | |
88 public: | |
89 virtual int32_t OnProcessMessage(CFWL_Message* pMessage); | |
90 virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent); | |
91 virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | |
92 const CFX_Matrix* pMatrix = NULL); | |
93 | |
94 protected: | |
95 CFWL_Widget* m_pNormalWidget; | |
96 CFX_RectF m_rtUI; | |
97 CFX_RectF m_rtCaption; | |
98 }; | |
99 | |
100 #endif // XFA_SRC_FXFA_APP_XFA_FFFIELD_H_ | |
OLD | NEW |