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

Side by Side Diff: xfa/fxfa/include/xfa_ffwidget.h

Issue 2071683002: Make code compile with clang_use_chrome_plugin (part V) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: clean up Created 4 years, 6 months 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/include/xfa_ffpageview.h ('k') | xfa/fxfa/include/xfa_fontmgr.h » ('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_INCLUDE_XFA_FFWIDGET_H_ 7 #ifndef XFA_FXFA_INCLUDE_XFA_FFWIDGET_H_
8 #define XFA_FXFA_INCLUDE_XFA_FFWIDGET_H_ 8 #define XFA_FXFA_INCLUDE_XFA_FFWIDGET_H_
9 9
10 #include <vector> 10 #include <vector>
(...skipping 15 matching lines...) Expand all
26 #define XFA_FLOAT_PERCISION 0.001f 26 #define XFA_FLOAT_PERCISION 0.001f
27 enum XFA_WIDGETITEM { 27 enum XFA_WIDGETITEM {
28 XFA_WIDGETITEM_Parent, 28 XFA_WIDGETITEM_Parent,
29 XFA_WIDGETITEM_FirstChild, 29 XFA_WIDGETITEM_FirstChild,
30 XFA_WIDGETITEM_NextSibling, 30 XFA_WIDGETITEM_NextSibling,
31 XFA_WIDGETITEM_PrevSibling, 31 XFA_WIDGETITEM_PrevSibling,
32 }; 32 };
33 33
34 class CXFA_CalcData { 34 class CXFA_CalcData {
35 public: 35 public:
36 CXFA_CalcData() : m_iRefCount(0) {} 36 CXFA_CalcData();
37 ~CXFA_CalcData() { m_Globals.RemoveAll(); } 37 ~CXFA_CalcData();
38 38
39 CFX_ArrayTemplate<CXFA_WidgetAcc*> m_Globals; 39 CFX_ArrayTemplate<CXFA_WidgetAcc*> m_Globals;
40 int32_t m_iRefCount; 40 int32_t m_iRefCount;
41 }; 41 };
42 42
43 class CXFA_FFWidget : public CXFA_ContentLayoutItem { 43 class CXFA_FFWidget : public CXFA_ContentLayoutItem {
44 public: 44 public:
45 CXFA_FFWidget(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); 45 CXFA_FFWidget(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
46 virtual ~CXFA_FFWidget(); 46 ~CXFA_FFWidget() override;
47 CXFA_FFPageView* GetPageView(); 47
48 void SetPageView(CXFA_FFPageView* pPageView);
49 void GetWidgetRect(CFX_RectF& rtWidget);
50 CFX_RectF ReCacheWidgetRect();
51 uint32_t GetStatus();
52 void ModifyStatus(uint32_t dwAdded, uint32_t dwRemoved);
53 virtual FX_BOOL GetBBox(CFX_RectF& rtBox, 48 virtual FX_BOOL GetBBox(CFX_RectF& rtBox,
54 uint32_t dwStatus, 49 uint32_t dwStatus,
55 FX_BOOL bDrawFocus = FALSE); 50 FX_BOOL bDrawFocus = FALSE);
56 CXFA_WidgetAcc* GetDataAcc();
57 FX_BOOL GetToolTip(CFX_WideString& wsToolTip);
58 virtual void RenderWidget(CFX_Graphics* pGS, 51 virtual void RenderWidget(CFX_Graphics* pGS,
59 CFX_Matrix* pMatrix = NULL, 52 CFX_Matrix* pMatrix = NULL,
60 uint32_t dwStatus = 0, 53 uint32_t dwStatus = 0,
61 int32_t iRotate = 0); 54 int32_t iRotate = 0);
62
63 virtual FX_BOOL IsLoaded(); 55 virtual FX_BOOL IsLoaded();
64 virtual FX_BOOL LoadWidget(); 56 virtual FX_BOOL LoadWidget();
65 virtual void UnloadWidget(); 57 virtual void UnloadWidget();
66 virtual FX_BOOL PerformLayout(); 58 virtual FX_BOOL PerformLayout();
67 virtual FX_BOOL UpdateFWLData(); 59 virtual FX_BOOL UpdateFWLData();
68 virtual void UpdateWidgetProperty(); 60 virtual void UpdateWidgetProperty();
69 virtual FX_BOOL OnMouseEnter(); 61 virtual FX_BOOL OnMouseEnter();
70 virtual FX_BOOL OnMouseExit(); 62 virtual FX_BOOL OnMouseExit();
71 virtual FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); 63 virtual FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
72 virtual FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); 64 virtual FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
73 virtual FX_BOOL OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); 65 virtual FX_BOOL OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
74 virtual FX_BOOL OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); 66 virtual FX_BOOL OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
75 virtual FX_BOOL OnMouseWheel(uint32_t dwFlags, 67 virtual FX_BOOL OnMouseWheel(uint32_t dwFlags,
76 int16_t zDelta, 68 int16_t zDelta,
77 FX_FLOAT fx, 69 FX_FLOAT fx,
78 FX_FLOAT fy); 70 FX_FLOAT fy);
79 virtual FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); 71 virtual FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
80 virtual FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); 72 virtual FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
81 virtual FX_BOOL OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); 73 virtual FX_BOOL OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
82 74
83 virtual FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget); 75 virtual FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget);
84 virtual FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget); 76 virtual FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget);
85 virtual FX_BOOL OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags); 77 virtual FX_BOOL OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags);
86 virtual FX_BOOL OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags); 78 virtual FX_BOOL OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags);
87 virtual FX_BOOL OnChar(uint32_t dwChar, uint32_t dwFlags); 79 virtual FX_BOOL OnChar(uint32_t dwChar, uint32_t dwFlags);
88 virtual FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy); 80 virtual FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy);
89 virtual FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy); 81 virtual FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy);
90 virtual FX_BOOL CanUndo() { return FALSE; } 82 virtual FX_BOOL CanUndo();
91 virtual FX_BOOL CanRedo() { return FALSE; } 83 virtual FX_BOOL CanRedo();
92 virtual FX_BOOL Undo() { return FALSE; } 84 virtual FX_BOOL Undo();
93 virtual FX_BOOL Redo() { return FALSE; } 85 virtual FX_BOOL Redo();
94 virtual FX_BOOL CanCopy() { return FALSE; } 86 virtual FX_BOOL CanCopy();
95 virtual FX_BOOL CanCut() { return FALSE; } 87 virtual FX_BOOL CanCut();
96 virtual FX_BOOL CanPaste() { return FALSE; } 88 virtual FX_BOOL CanPaste();
97 virtual FX_BOOL CanSelectAll() { return FALSE; } 89 virtual FX_BOOL CanSelectAll();
98 virtual FX_BOOL CanDelete() { return CanCut(); } 90 virtual FX_BOOL CanDelete();
99 virtual FX_BOOL CanDeSelect() { return CanCopy(); } 91 virtual FX_BOOL CanDeSelect();
100 virtual FX_BOOL Copy(CFX_WideString& wsCopy) { return FALSE; } 92 virtual FX_BOOL Copy(CFX_WideString& wsCopy);
101 virtual FX_BOOL Cut(CFX_WideString& wsCut) { return FALSE; } 93 virtual FX_BOOL Cut(CFX_WideString& wsCut);
102 virtual FX_BOOL Paste(const CFX_WideString& wsPaste) { return FALSE; } 94 virtual FX_BOOL Paste(const CFX_WideString& wsPaste);
103 virtual FX_BOOL SelectAll() { return FALSE; } 95 virtual FX_BOOL SelectAll();
104 virtual FX_BOOL Delete() { return FALSE; } 96 virtual FX_BOOL Delete();
105 virtual FX_BOOL DeSelect() { return FALSE; } 97 virtual FX_BOOL DeSelect();
106 virtual FX_BOOL GetSuggestWords(CFX_PointF pointf, 98 virtual FX_BOOL GetSuggestWords(CFX_PointF pointf,
107 std::vector<CFX_ByteString>& sSuggest) { 99 std::vector<CFX_ByteString>& sSuggest);
108 return FALSE;
109 }
110 virtual FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, 100 virtual FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf,
111 const CFX_ByteStringC& bsReplace) { 101 const CFX_ByteStringC& bsReplace);
112 return FALSE; 102
113 } 103 CXFA_FFPageView* GetPageView();
104 void SetPageView(CXFA_FFPageView* pPageView);
105 void GetWidgetRect(CFX_RectF& rtWidget);
106 CFX_RectF ReCacheWidgetRect();
107 uint32_t GetStatus();
108 void ModifyStatus(uint32_t dwAdded, uint32_t dwRemoved);
109
110 CXFA_WidgetAcc* GetDataAcc();
111 FX_BOOL GetToolTip(CFX_WideString& wsToolTip);
112
114 CXFA_FFDocView* GetDocView(); 113 CXFA_FFDocView* GetDocView();
115 void SetDocView(CXFA_FFDocView* pDocView) { m_pDocView = pDocView; } 114 void SetDocView(CXFA_FFDocView* pDocView);
116 CXFA_FFDoc* GetDoc(); 115 CXFA_FFDoc* GetDoc();
117 CXFA_FFApp* GetApp(); 116 CXFA_FFApp* GetApp();
118 IXFA_AppProvider* GetAppProvider(); 117 IXFA_AppProvider* GetAppProvider();
119 void InvalidateWidget(const CFX_RectF* pRect = NULL); 118 void InvalidateWidget(const CFX_RectF* pRect = NULL);
120 void AddInvalidateRect(const CFX_RectF* pRect = NULL); 119 void AddInvalidateRect(const CFX_RectF* pRect = NULL);
121 FX_BOOL GetCaptionText(CFX_WideString& wsCap); 120 FX_BOOL GetCaptionText(CFX_WideString& wsCap);
122 bool IsFocused(); 121 bool IsFocused();
123 void Rotate2Normal(FX_FLOAT& fx, FX_FLOAT& fy); 122 void Rotate2Normal(FX_FLOAT& fx, FX_FLOAT& fy);
124 void GetRotateMatrix(CFX_Matrix& mt); 123 void GetRotateMatrix(CFX_Matrix& mt);
125 FX_BOOL IsLayoutRectEmpty(); 124 FX_BOOL IsLayoutRectEmpty();
126 CXFA_FFWidget* GetParent(); 125 CXFA_FFWidget* GetParent();
127 FX_BOOL IsAncestorOf(CXFA_FFWidget* pWidget); 126 FX_BOOL IsAncestorOf(CXFA_FFWidget* pWidget);
128 127
129 protected: 128 protected:
130 virtual FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy); 129 virtual FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy);
130
131 void DrawBorder(CFX_Graphics* pGS, 131 void DrawBorder(CFX_Graphics* pGS,
132 CXFA_Box box, 132 CXFA_Box box,
133 const CFX_RectF& rtBorder, 133 const CFX_RectF& rtBorder,
134 CFX_Matrix* pMatrix, 134 CFX_Matrix* pMatrix,
135 uint32_t dwFlags = 0); 135 uint32_t dwFlags = 0);
136 void GetMinMaxWidth(FX_FLOAT fMinWidth, FX_FLOAT fMaxWidth); 136 void GetMinMaxWidth(FX_FLOAT fMinWidth, FX_FLOAT fMaxWidth);
137 void GetMinMaxHeight(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight); 137 void GetMinMaxHeight(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight);
138 void GetRectWithoutRotate(CFX_RectF& rtWidget); 138 void GetRectWithoutRotate(CFX_RectF& rtWidget);
139 bool IsMatchVisibleStatus(uint32_t dwStatus); 139 bool IsMatchVisibleStatus(uint32_t dwStatus);
140
141 void EventKillFocus(); 140 void EventKillFocus();
142 FX_BOOL IsButtonDown(); 141 FX_BOOL IsButtonDown();
143 void SetButtonDown(FX_BOOL bSet); 142 void SetButtonDown(FX_BOOL bSet);
143
144 CXFA_FFDocView* m_pDocView; 144 CXFA_FFDocView* m_pDocView;
145 CXFA_FFPageView* m_pPageView; 145 CXFA_FFPageView* m_pPageView;
146 CXFA_WidgetAcc* m_pDataAcc; 146 CXFA_WidgetAcc* m_pDataAcc;
147 CFX_RectF m_rtWidget; 147 CFX_RectF m_rtWidget;
148 }; 148 };
149
149 int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, 150 int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics,
150 int32_t iStrokeType, 151 int32_t iStrokeType,
151 int32_t iCapType); 152 int32_t iCapType);
152 CFX_GraphStateData::LineCap XFA_LineCapToFXGE(int32_t iLineCap); 153 CFX_GraphStateData::LineCap XFA_LineCapToFXGE(int32_t iLineCap);
153 void XFA_DrawImage(CFX_Graphics* pGS, 154 void XFA_DrawImage(CFX_Graphics* pGS,
154 const CFX_RectF& rtImage, 155 const CFX_RectF& rtImage,
155 CFX_Matrix* pMatrix, 156 CFX_Matrix* pMatrix,
156 CFX_DIBitmap* pDIBitmap, 157 CFX_DIBitmap* pDIBitmap,
157 int32_t iAspect, 158 int32_t iAspect,
158 int32_t iImageXDpi, 159 int32_t iImageXDpi,
(...skipping 18 matching lines...) Expand all
177 FX_BOOL XFA_IsCreateWidget(XFA_ELEMENT iType); 178 FX_BOOL XFA_IsCreateWidget(XFA_ELEMENT iType);
178 #define XFA_DRAWBOX_ForceRound 1 179 #define XFA_DRAWBOX_ForceRound 1
179 #define XFA_DRAWBOX_Lowered3D 2 180 #define XFA_DRAWBOX_Lowered3D 2
180 void XFA_DrawBox(CXFA_Box box, 181 void XFA_DrawBox(CXFA_Box box,
181 CFX_Graphics* pGS, 182 CFX_Graphics* pGS,
182 const CFX_RectF& rtWidget, 183 const CFX_RectF& rtWidget,
183 CFX_Matrix* pMatrix, 184 CFX_Matrix* pMatrix,
184 uint32_t dwFlags = 0); 185 uint32_t dwFlags = 0);
185 186
186 #endif // XFA_FXFA_INCLUDE_XFA_FFWIDGET_H_ 187 #endif // XFA_FXFA_INCLUDE_XFA_FFWIDGET_H_
OLDNEW
« no previous file with comments | « xfa/fxfa/include/xfa_ffpageview.h ('k') | xfa/fxfa/include/xfa_fontmgr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698