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 FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDITCTRL_H_ | 7 #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDITCTRL_H_ |
8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDITCTRL_H_ | 8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDITCTRL_H_ |
9 | 9 |
10 #include "../../../core/include/fxcrt/fx_string.h" | 10 #include "../../../core/include/fxcrt/fx_string.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 friend class CPWL_Edit_Notify; | 61 friend class CPWL_Edit_Notify; |
62 | 62 |
63 public: | 63 public: |
64 CPWL_EditCtrl(); | 64 CPWL_EditCtrl(); |
65 virtual ~CPWL_EditCtrl(); | 65 virtual ~CPWL_EditCtrl(); |
66 | 66 |
67 public: | 67 public: |
68 virtual void OnCreate(PWL_CREATEPARAM
& cp); | 68 virtual void OnCreate(PWL_CREATEPARAM
& cp); |
69 virtual void OnCreated(); | 69 virtual void OnCreated(); |
70 | 70 |
71 » virtual FX_BOOL»» » » » OnKeyDown(FX_WORD nChar,
FX_DWORD nFlag); | 71 » virtual bool» » » » » OnKeyDown(FX_WORD nChar,
FX_DWORD nFlag); |
72 » virtual FX_BOOL»» » » » OnChar(FX_WORD nChar, FX
_DWORD nFlag); | 72 » virtual bool» » » » » OnChar(FX_WORD nChar, FX
_DWORD nFlag); |
73 » virtual FX_BOOL»» » » » OnLButtonDown(const CPDF
_Point & point, FX_DWORD nFlag); | 73 » virtual bool» » » » » OnLButtonDown(const CPDF
_Point & point, FX_DWORD nFlag); |
74 » virtual FX_BOOL»» » » » OnLButtonUp(const CPDF_P
oint & point, FX_DWORD nFlag); | 74 » virtual bool» » » » » OnLButtonUp(const CPDF_P
oint & point, FX_DWORD nFlag); |
75 » virtual FX_BOOL»» » » » OnMouseMove(const CPDF_P
oint & point, FX_DWORD nFlag); | 75 » virtual bool» » » » » OnMouseMove(const CPDF_P
oint & point, FX_DWORD nFlag); |
76 virtual void OnNotify(CPWL_Wnd* pWnd,
FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); | 76 virtual void OnNotify(CPWL_Wnd* pWnd,
FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); |
77 | 77 |
78 virtual void CreateChildWnd(const PWL
_CREATEPARAM & cp); | 78 virtual void CreateChildWnd(const PWL
_CREATEPARAM & cp); |
79 virtual void RePosChildWnd(); | 79 virtual void RePosChildWnd(); |
80 virtual void SetFontSize(FX_FLOAT fFo
ntSize); | 80 virtual void SetFontSize(FX_FLOAT fFo
ntSize); |
81 virtual FX_FLOAT GetFontSize() const; | 81 virtual FX_FLOAT GetFontSize() const; |
82 | 82 |
83 public: | 83 public: |
84 virtual void SetText(const FX_WCHAR*
csText); | 84 virtual void SetText(const FX_WCHAR*
csText); |
85 | 85 |
86 virtual void CopyText(); | 86 virtual void CopyText(); |
87 virtual void PasteText(); | 87 virtual void PasteText(); |
88 virtual void CutText(); | 88 virtual void CutText(); |
89 | 89 |
90 CPDF_Rect GetContentRect()
const; | 90 CPDF_Rect GetContentRect()
const; |
91 void GetCaretPos(int3
2_t& x, int32_t& y) const; | 91 void GetCaretPos(int3
2_t& x, int32_t& y) const; |
92 » FX_BOOL»» » » » » » IsModified() con
st; | 92 » bool» » » » » » » IsModified() con
st; |
93 | 93 |
94 CFX_WideString GetText() const; | 94 CFX_WideString GetText() const; |
95 void SetSel(int32_t n
StartChar,int32_t nEndChar); | 95 void SetSel(int32_t n
StartChar,int32_t nEndChar); |
96 void GetSel(int32_t &
nStartChar, int32_t & nEndChar ) const; | 96 void GetSel(int32_t &
nStartChar, int32_t & nEndChar ) const; |
97 void GetTextRange(con
st CPDF_Rect& rect, int32_t & nStartChar, int32_t & nEndChar) const; | 97 void GetTextRange(con
st CPDF_Rect& rect, int32_t & nStartChar, int32_t & nEndChar) const; |
98 CFX_WideString GetText(int32_t & nStart
Char, int32_t & nEndChar) const; | 98 CFX_WideString GetText(int32_t & nStart
Char, int32_t & nEndChar) const; |
99 void Clear(); | 99 void Clear(); |
100 void SelectAll(); | 100 void SelectAll(); |
101 | 101 |
102 int32_t GetCaret() const; | 102 int32_t GetCaret() const; |
103 void SetCaret(int32_t
nPos); | 103 void SetCaret(int32_t
nPos); |
104 int32_t GetTotalWords() const; | 104 int32_t GetTotalWords() const; |
105 | 105 |
106 void Paint(); | 106 void Paint(); |
107 | 107 |
108 » void» » » » » » » EnableRefresh(FX
_BOOL bRefresh); | 108 » void» » » » » » » EnableRefresh(bo
ol bRefresh); |
109 CPDF_Point GetScrollPos() c
onst; | 109 CPDF_Point GetScrollPos() c
onst; |
110 void SetScrollPos(con
st CPDF_Point& point); | 110 void SetScrollPos(con
st CPDF_Point& point); |
111 | 111 |
112 void SetEditNotify(IP
WL_Edit_Notify* pNotify) {m_pEditNotify = pNotify;} | 112 void SetEditNotify(IP
WL_Edit_Notify* pNotify) {m_pEditNotify = pNotify;} |
113 | 113 |
114 void SetCharSet(uint8
_t nCharSet){m_nCharSet = nCharSet;} | 114 void SetCharSet(uint8
_t nCharSet){m_nCharSet = nCharSet;} |
115 int32_t GetCharSet() const; | 115 int32_t GetCharSet() const; |
116 | 116 |
117 void SetCodePage(int3
2_t nCodePage){m_nCodePage = nCodePage;} | 117 void SetCodePage(int3
2_t nCodePage){m_nCodePage = nCodePage;} |
118 int32_t GetCodePage() const {ret
urn m_nCodePage;} | 118 int32_t GetCodePage() const {ret
urn m_nCodePage;} |
119 | 119 |
120 CPDF_Font * GetCaretFont() c
onst; | 120 CPDF_Font * GetCaretFont() c
onst; |
121 FX_FLOAT GetCaretFontSize
() const; | 121 FX_FLOAT GetCaretFontSize
() const; |
122 | 122 |
123 » FX_BOOL»» » » » » » CanUndo() const; | 123 » bool» » » » » » » CanUndo() const; |
124 » FX_BOOL»» » » » » » CanRedo() const; | 124 » bool» » » » » » » CanRedo() const; |
125 void Redo(); | 125 void Redo(); |
126 void Undo(); | 126 void Undo(); |
127 | 127 |
128 void SetReadyToInput(
); | 128 void SetReadyToInput(
); |
129 protected: | 129 protected: |
130 » virtual void» » » » » ShowVScrollBar(FX_BOOL b
Show); | 130 » virtual void» » » » » ShowVScrollBar(bool bSho
w); |
131 | 131 |
132 virtual void InsertWord(FX_WORD word,
int32_t nCharset); | 132 virtual void InsertWord(FX_WORD word,
int32_t nCharset); |
133 virtual void InsertReturn(); | 133 virtual void InsertReturn(); |
134 virtual void InsertText(const FX_WCHA
R* csText); | 134 virtual void InsertText(const FX_WCHA
R* csText); |
135 | 135 |
136 virtual void SetCursor(); | 136 virtual void SetCursor(); |
137 » FX_BOOL»» » » » » » IsWndHorV(); | 137 » bool» » » » » » » IsWndHorV(); |
138 | 138 |
139 void Delete(); | 139 void Delete(); |
140 void Backspace(); | 140 void Backspace(); |
141 | 141 |
142 protected: | 142 protected: |
143 void GetCaretInfo(CPD
F_Point & ptHead, CPDF_Point & ptFoot) const; | 143 void GetCaretInfo(CPD
F_Point & ptHead, CPDF_Point & ptFoot) const; |
144 » void» » » » » » » SetCaret(FX_BOOL
bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot); | 144 » void» » » » » » » SetCaret(bool bV
isible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot); |
145 | 145 |
146 » void» » » » » » » SetEditCaret(FX_
BOOL bVisible); | 146 » void» » » » » » » SetEditCaret(boo
l bVisible); |
147 | 147 |
148 protected: | 148 protected: |
149 virtual void IOnSetScrollInfoX(FX_FLO
AT fPlateMin, FX_FLOAT fPlateMax, | 149 virtual void IOnSetScrollInfoX(FX_FLO
AT fPlateMin, FX_FLOAT fPlateMax, |
150
FX_FLOAT fContentMin, FX_FLOAT fContentMax, | 150
FX_FLOAT fContentMin, FX_FLOAT fContentMax, |
151
FX_FLOAT fSmallStep, FX_FLOAT fBigStep){} | 151
FX_FLOAT fSmallStep, FX_FLOAT fBigStep){} |
152 virtual void IOnSetScrollInfoY(FX_FLO
AT fPlateMin, FX_FLOAT fPlateMax, | 152 virtual void IOnSetScrollInfoY(FX_FLO
AT fPlateMin, FX_FLOAT fPlateMax, |
153
FX_FLOAT fContentMin, FX_FLOAT fContentMax, | 153
FX_FLOAT fContentMin, FX_FLOAT fContentMax, |
154
FX_FLOAT fSmallStep, FX_FLOAT fBigStep); | 154
FX_FLOAT fSmallStep, FX_FLOAT fBigStep); |
155 virtual void IOnSetScrollPosX(FX_FLOA
T fx){} | 155 virtual void IOnSetScrollPosX(FX_FLOA
T fx){} |
156 virtual void IOnSetScrollPosY(FX_FLOA
T fy); | 156 virtual void IOnSetScrollPosY(FX_FLOA
T fy); |
157 » virtual void» » » » » IOnSetCaret(FX_BOOL bVis
ible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace&
place); | 157 » virtual void» » » » » IOnSetCaret(bool bVisibl
e,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& pla
ce); |
158 virtual void IOnCaretChange(const CPV
T_SecProps & secProps, const CPVT_WordProps & wordProps); | 158 virtual void IOnCaretChange(const CPV
T_SecProps & secProps, const CPVT_WordProps & wordProps); |
159 virtual void IOnContentChange(const C
PDF_Rect& rcContent); | 159 virtual void IOnContentChange(const C
PDF_Rect& rcContent); |
160 virtual void IOnInvalidateRect(CPDF_R
ect * pRect); | 160 virtual void IOnInvalidateRect(CPDF_R
ect * pRect); |
161 | 161 |
162 private: | 162 private: |
163 void CreateEditCaret(
const PWL_CREATEPARAM & cp); | 163 void CreateEditCaret(
const PWL_CREATEPARAM & cp); |
164 | 164 |
165 protected: | 165 protected: |
166 IFX_Edit* m_pEdit; | 166 IFX_Edit* m_pEdit; |
167 CPWL_Caret* m_pEditCaret; | 167 CPWL_Caret* m_pEditCaret; |
168 » FX_BOOL»» » » » » » m_bMouseDown; | 168 » bool» » » » » » » m_bMouseDown; |
169 IPWL_Edit_Notify* m_pEditNotify; | 169 IPWL_Edit_Notify* m_pEditNotify; |
170 | 170 |
171 private: | 171 private: |
172 int32_t m_nCharSet; | 172 int32_t m_nCharSet; |
173 int32_t m_nCodePage; | 173 int32_t m_nCodePage; |
174 }; | 174 }; |
175 | 175 |
176 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDITCTRL_H_ | 176 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDITCTRL_H_ |
OLD | NEW |