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

Side by Side Diff: fpdfsdk/pdfwindow/PWL_EditCtrl.h

Issue 2142213002: Remove some IFX_* wrappers. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 5 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 | « fpdfsdk/pdfwindow/PWL_Edit.cpp ('k') | fpdfsdk/pdfwindow/PWL_EditCtrl.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 FPDFSDK_PDFWINDOW_PWL_EDITCTRL_H_ 7 #ifndef FPDFSDK_PDFWINDOW_PWL_EDITCTRL_H_
8 #define FPDFSDK_PDFWINDOW_PWL_EDITCTRL_H_ 8 #define FPDFSDK_PDFWINDOW_PWL_EDITCTRL_H_
9 9
10 #include "core/fxcrt/include/fx_string.h" 10 #include "core/fxcrt/include/fx_string.h"
11 #include "fpdfsdk/fxedit/include/fx_edit.h" 11 #include "fpdfsdk/fxedit/include/fx_edit.h"
12 #include "fpdfsdk/pdfwindow/PWL_Wnd.h" 12 #include "fpdfsdk/pdfwindow/PWL_Wnd.h"
13 13
14 class CFX_Edit;
14 class CPWL_Caret; 15 class CPWL_Caret;
15 class CPWL_Edit; 16 class CPWL_Edit;
16 class CPWL_EditCtrl; 17 class CPWL_EditCtrl;
17 class IFX_Edit;
18 class IPWL_Edit_Notify; 18 class IPWL_Edit_Notify;
19 struct CPVT_SecProps;
19 struct CPVT_WordPlace; 20 struct CPVT_WordPlace;
21 struct CPVT_WordProps;
22 struct CPVT_WordRange;
20 23
21 enum PWL_EDIT_ALIGNFORMAT_H { PEAH_LEFT = 0, PEAH_MIDDLE, PEAH_RIGHT }; 24 enum PWL_EDIT_ALIGNFORMAT_H { PEAH_LEFT = 0, PEAH_MIDDLE, PEAH_RIGHT };
22 25
23 enum PWL_EDIT_ALIGNFORMAT_V { PEAV_TOP = 0, PEAV_CENTER, PEAV_BOTTOM }; 26 enum PWL_EDIT_ALIGNFORMAT_V { PEAV_TOP = 0, PEAV_CENTER, PEAV_BOTTOM };
24 27
25 class IPWL_Edit_Notify { 28 class IPWL_Edit_Notify {
26 public: 29 public:
27 virtual ~IPWL_Edit_Notify() {} 30 virtual ~IPWL_Edit_Notify() {}
28 // when the position of caret is changed in edit 31 // when the position of caret is changed in edit
29 virtual void OnCaretMove(int32_t x1, int32_t y1, int32_t x2, int32_t y2) {} 32 virtual void OnCaretMove(int32_t x1, int32_t y1, int32_t x2, int32_t y2) {}
(...skipping 15 matching lines...) Expand all
45 const CPVT_WordPlace& oldplace) {} 48 const CPVT_WordPlace& oldplace) {}
46 virtual void OnClear(const CPVT_WordPlace& place, 49 virtual void OnClear(const CPVT_WordPlace& place,
47 const CPVT_WordPlace& oldplace) {} 50 const CPVT_WordPlace& oldplace) {}
48 virtual void OnInsertText(const CPVT_WordPlace& place, 51 virtual void OnInsertText(const CPVT_WordPlace& place,
49 const CPVT_WordPlace& oldplace) {} 52 const CPVT_WordPlace& oldplace) {}
50 virtual void OnSetText(const CPVT_WordPlace& place, 53 virtual void OnSetText(const CPVT_WordPlace& place,
51 const CPVT_WordPlace& oldplace) {} 54 const CPVT_WordPlace& oldplace) {}
52 virtual void OnAddUndo(CPWL_Edit* pEdit) {} 55 virtual void OnAddUndo(CPWL_Edit* pEdit) {}
53 }; 56 };
54 57
55 class CPWL_EditCtrl : public CPWL_Wnd, public IFX_Edit_Notify { 58 class CPWL_EditCtrl : public CPWL_Wnd {
56 friend class CPWL_Edit_Notify; 59 friend class CPWL_Edit_Notify;
57 60
58 public: 61 public:
59 CPWL_EditCtrl(); 62 CPWL_EditCtrl();
60 ~CPWL_EditCtrl() override; 63 ~CPWL_EditCtrl() override;
61 64
62 CFX_FloatRect GetContentRect() const; 65 CFX_FloatRect GetContentRect() const;
63 void GetCaretPos(int32_t& x, int32_t& y) const; 66 void GetCaretPos(int32_t& x, int32_t& y) const;
64 67
65 CFX_WideString GetText() const; 68 CFX_WideString GetText() const;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 void OnNotify(CPWL_Wnd* pWnd, 114 void OnNotify(CPWL_Wnd* pWnd,
112 uint32_t msg, 115 uint32_t msg,
113 intptr_t wParam = 0, 116 intptr_t wParam = 0,
114 intptr_t lParam = 0) override; 117 intptr_t lParam = 0) override;
115 void CreateChildWnd(const PWL_CREATEPARAM& cp) override; 118 void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
116 void RePosChildWnd() override; 119 void RePosChildWnd() override;
117 void SetFontSize(FX_FLOAT fFontSize) override; 120 void SetFontSize(FX_FLOAT fFontSize) override;
118 FX_FLOAT GetFontSize() const override; 121 FX_FLOAT GetFontSize() const override;
119 void SetCursor() override; 122 void SetCursor() override;
120 123
121 protected:
122 // IFX_Edit_Notify
123 void IOnSetScrollInfoX(FX_FLOAT fPlateMin,
124 FX_FLOAT fPlateMax,
125 FX_FLOAT fContentMin,
126 FX_FLOAT fContentMax,
127 FX_FLOAT fSmallStep,
128 FX_FLOAT fBigStep) override {}
129 void IOnSetScrollInfoY(FX_FLOAT fPlateMin, 124 void IOnSetScrollInfoY(FX_FLOAT fPlateMin,
130 FX_FLOAT fPlateMax, 125 FX_FLOAT fPlateMax,
131 FX_FLOAT fContentMin, 126 FX_FLOAT fContentMin,
132 FX_FLOAT fContentMax, 127 FX_FLOAT fContentMax,
133 FX_FLOAT fSmallStep, 128 FX_FLOAT fSmallStep,
134 FX_FLOAT fBigStep) override; 129 FX_FLOAT fBigStep);
135 void IOnSetScrollPosX(FX_FLOAT fx) override {} 130 void IOnSetScrollPosY(FX_FLOAT fy);
136 void IOnSetScrollPosY(FX_FLOAT fy) override;
137 void IOnSetCaret(FX_BOOL bVisible, 131 void IOnSetCaret(FX_BOOL bVisible,
138 const CFX_FloatPoint& ptHead, 132 const CFX_FloatPoint& ptHead,
139 const CFX_FloatPoint& ptFoot, 133 const CFX_FloatPoint& ptFoot,
140 const CPVT_WordPlace& place) override; 134 const CPVT_WordPlace& place);
141 void IOnContentChange(const CFX_FloatRect& rcContent) override; 135 void IOnCaretChange(const CPVT_SecProps& secProps,
142 void IOnInvalidateRect(CFX_FloatRect* pRect) override; 136 const CPVT_WordProps& wordProps);
137 void IOnContentChange(const CFX_FloatRect& rcContent);
138 void IOnInvalidateRect(CFX_FloatRect* pRect);
143 139
140 protected:
144 void InsertText(const FX_WCHAR* csText); 141 void InsertText(const FX_WCHAR* csText);
145 void SetText(const FX_WCHAR* csText); 142 void SetText(const FX_WCHAR* csText);
146 void CopyText(); 143 void CopyText();
147 void PasteText(); 144 void PasteText();
148 void CutText(); 145 void CutText();
149 void ShowVScrollBar(FX_BOOL bShow); 146 void ShowVScrollBar(FX_BOOL bShow);
150 void InsertWord(uint16_t word, int32_t nCharset); 147 void InsertWord(uint16_t word, int32_t nCharset);
151 void InsertReturn(); 148 void InsertReturn();
152 149
153 FX_BOOL IsWndHorV(); 150 FX_BOOL IsWndHorV();
154 151
155 void Delete(); 152 void Delete();
156 void Backspace(); 153 void Backspace();
157 154
158 void GetCaretInfo(CFX_FloatPoint& ptHead, CFX_FloatPoint& ptFoot) const; 155 void GetCaretInfo(CFX_FloatPoint& ptHead, CFX_FloatPoint& ptFoot) const;
159 void SetCaret(FX_BOOL bVisible, 156 void SetCaret(FX_BOOL bVisible,
160 const CFX_FloatPoint& ptHead, 157 const CFX_FloatPoint& ptHead,
161 const CFX_FloatPoint& ptFoot); 158 const CFX_FloatPoint& ptFoot);
162 159
163 void SetEditCaret(FX_BOOL bVisible); 160 void SetEditCaret(FX_BOOL bVisible);
164 161
165 private: 162 std::unique_ptr<CFX_Edit> m_pEdit;
166 void CreateEditCaret(const PWL_CREATEPARAM& cp);
167
168 protected:
169 IFX_Edit* m_pEdit;
170 CPWL_Caret* m_pEditCaret; 163 CPWL_Caret* m_pEditCaret;
171 FX_BOOL m_bMouseDown; 164 FX_BOOL m_bMouseDown;
172 IPWL_Edit_Notify* m_pEditNotify; 165 IPWL_Edit_Notify* m_pEditNotify;
173 166
174 private: 167 private:
168 void CreateEditCaret(const PWL_CREATEPARAM& cp);
169
175 int32_t m_nCharSet; 170 int32_t m_nCharSet;
176 int32_t m_nCodePage; 171 int32_t m_nCodePage;
177 }; 172 };
178 173
179 #endif // FPDFSDK_PDFWINDOW_PWL_EDITCTRL_H_ 174 #endif // FPDFSDK_PDFWINDOW_PWL_EDITCTRL_H_
OLDNEW
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_Edit.cpp ('k') | fpdfsdk/pdfwindow/PWL_EditCtrl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698