Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: xfa/fxfa/app/xfa_fffield.h

Issue 2466273003: Change IFWL_Widget to store a single delegate. (Closed)
Patch Set: Fix Mac Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxfa/app/xfa_ffchoicelist.cpp ('k') | xfa/fxfa/app/xfa_fffield.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_FFFIELD_H_ 7 #ifndef XFA_FXFA_APP_XFA_FFFIELD_H_
8 #define XFA_FXFA_APP_XFA_FFFIELD_H_ 8 #define XFA_FXFA_APP_XFA_FFFIELD_H_
9 9
10 #include "xfa/fwl/core/cfwl_widget.h" 10 #include "xfa/fwl/core/cfwl_widget.h"
11 #include "xfa/fwl/core/ifwl_widgetdelegate.h"
12 #include "xfa/fxfa/xfa_ffpageview.h" 11 #include "xfa/fxfa/xfa_ffpageview.h"
13 #include "xfa/fxfa/xfa_ffwidget.h" 12 #include "xfa/fxfa/xfa_ffwidget.h"
14 13
15 #define XFA_MINUI_HEIGHT 4.32f 14 #define XFA_MINUI_HEIGHT 4.32f
16 #define XFA_DEFAULTUI_HEIGHT 2.0f 15 #define XFA_DEFAULTUI_HEIGHT 2.0f
17 16
18 class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { 17 class CXFA_FFField : public CXFA_FFWidget {
19 public: 18 public:
20 CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); 19 CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
21 ~CXFA_FFField() override; 20 ~CXFA_FFField() override;
22 21
23 // CXFA_FFWidget 22 // CXFA_FFWidget
24 FX_BOOL GetBBox(CFX_RectF& rtBox, 23 FX_BOOL GetBBox(CFX_RectF& rtBox,
25 uint32_t dwStatus, 24 uint32_t dwStatus,
26 FX_BOOL bDrawFocus = FALSE) override; 25 FX_BOOL bDrawFocus = FALSE) override;
27 void RenderWidget(CFX_Graphics* pGS, 26 void RenderWidget(CFX_Graphics* pGS,
28 CFX_Matrix* pMatrix, 27 CFX_Matrix* pMatrix,
(...skipping 17 matching lines...) Expand all
46 FX_BOOL OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; 45 FX_BOOL OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
47 46
48 FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget) override; 47 FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget) override;
49 FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override; 48 FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override;
50 FX_BOOL OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) override; 49 FX_BOOL OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) override;
51 FX_BOOL OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) override; 50 FX_BOOL OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) override;
52 FX_BOOL OnChar(uint32_t dwChar, uint32_t dwFlags) override; 51 FX_BOOL OnChar(uint32_t dwChar, uint32_t dwFlags) override;
53 FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy) override; 52 FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy) override;
54 FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) override; 53 FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) override;
55 54
56 // IFWL_WidgetDelegate
57 void OnProcessMessage(CFWL_Message* pMessage) override;
58 void OnProcessEvent(CFWL_Event* pEvent) override;
59 void OnDrawWidget(CFX_Graphics* pGraphics,
60 const CFX_Matrix* pMatrix = nullptr) override;
61
62 void UpdateFWL(); 55 void UpdateFWL();
63 uint32_t UpdateUIProperty(); 56 uint32_t UpdateUIProperty();
64 57
58 CFWL_Widget* GetNormalWidget() { return m_pNormalWidget; }
59 FX_BOOL ProcessCommittedData();
60
65 protected: 61 protected:
66 FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override; 62 FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override;
67 63
68 virtual void SetFWLRect(); 64 virtual void SetFWLRect();
69 void SetFWLThemeProvider(); 65 void SetFWLThemeProvider();
70 CFWL_Widget* GetNormalWidget() { return m_pNormalWidget; }
71 void FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy); 66 void FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy);
72 void LayoutCaption(); 67 void LayoutCaption();
73 void RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = nullptr); 68 void RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = nullptr);
74 69
75 int32_t CalculateOverride(); 70 int32_t CalculateOverride();
76 int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc); 71 int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc);
77 FX_BOOL ProcessCommittedData(); 72
78 virtual FX_BOOL CommitData(); 73 virtual FX_BOOL CommitData();
79 virtual FX_BOOL IsDataChanged(); 74 virtual FX_BOOL IsDataChanged();
80 void DrawHighlight(CFX_Graphics* pGS, 75 void DrawHighlight(CFX_Graphics* pGS,
81 CFX_Matrix* pMatrix, 76 CFX_Matrix* pMatrix,
82 uint32_t dwStatus, 77 uint32_t dwStatus,
83 FX_BOOL bEllipse = FALSE); 78 FX_BOOL bEllipse = FALSE);
84 void DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix); 79 void DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix);
85 void TranslateFWLMessage(CFWL_Message* pMessage); 80 void TranslateFWLMessage(CFWL_Message* pMessage);
86 void CapPlacement(); 81 void CapPlacement();
87 void CapTopBottomPlacement(CXFA_Caption caption, 82 void CapTopBottomPlacement(CXFA_Caption caption,
88 const CFX_RectF& rtWidget, 83 const CFX_RectF& rtWidget,
89 int32_t iCapPlacement); 84 int32_t iCapPlacement);
90 void CapLeftRightPlacement(CXFA_Caption caption, 85 void CapLeftRightPlacement(CXFA_Caption caption,
91 const CFX_RectF& rtWidget, 86 const CFX_RectF& rtWidget,
92 int32_t iCapPlacement); 87 int32_t iCapPlacement);
93 void SetEditScrollOffset(); 88 void SetEditScrollOffset();
94 89
95 CFWL_Widget* m_pNormalWidget; 90 CFWL_Widget* m_pNormalWidget;
96 CFX_RectF m_rtUI; 91 CFX_RectF m_rtUI;
97 CFX_RectF m_rtCaption; 92 CFX_RectF m_rtCaption;
98 }; 93 };
99 94
100 #endif // XFA_FXFA_APP_XFA_FFFIELD_H_ 95 #endif // XFA_FXFA_APP_XFA_FFFIELD_H_
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffchoicelist.cpp ('k') | xfa/fxfa/app/xfa_fffield.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698