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_EDIT_H_ | 7 #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDIT_H_ |
8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDIT_H_ | 8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDIT_H_ |
9 | 9 |
10 #include "../../../core/include/fxcrt/fx_basic.h" | 10 #include "../../../core/include/fxcrt/fx_basic.h" |
11 #include "PWL_EditCtrl.h" | 11 #include "PWL_EditCtrl.h" |
12 #include "PWL_Wnd.h" | 12 #include "PWL_Wnd.h" |
13 | 13 |
14 class CPWL_Edit; | 14 class CPWL_Edit; |
15 class IPWL_Filler_Notify; | 15 class IPWL_Filler_Notify; |
16 class IPWL_SpellCheck; | 16 class IPWL_SpellCheck; |
17 | 17 |
18 class IPWL_Filler_Notify | 18 class IPWL_Filler_Notify |
19 { | 19 { |
20 public: | 20 public: |
21 virtual ~IPWL_Filler_Notify() { } | 21 virtual ~IPWL_Filler_Notify() { } |
22 virtual void QueryWherePopup(void* pP
rivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, | 22 virtual void QueryWherePopup(void* pP
rivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, |
23
int32_t & nRet, FX_FLOAT & fPopupRet) = 0; //nRet: (0:bottom 1:top) | 23
int32_t & nRet, FX_FLOAT & fPopupRet) = 0; //nRet: (0:bottom 1:top) |
24 » virtual void» » » » » OnBeforeKeyStroke(FX_BOO
L bEditOrList, void* pPrivateData, int32_t nKeyCode, | 24 » virtual void» » » » » OnBeforeKeyStroke(bool b
EditOrList, void* pPrivateData, int32_t nKeyCode, |
25
CFX_WideString & strChange, const CFX_WideString& strChangeEx, | 25
CFX_WideString & strChange, const CFX_WideString& strChangeEx, |
26
int nSelStart, int nSelEnd, | 26
int nSelStart, int nSelEnd, |
27 » » » » » » » » » »
FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag) = 0; | 27 » » » » » » » » » »
bool bKeyDown, bool & bRC, bool & bExit, FX_DWORD nFlag) = 0; |
28 » virtual void» » » » » OnAfterKeyStroke(FX_BOOL
bEditOrList, void* pPrivateData, FX_BOOL & bExit, FX_DWORD nFlag) = 0; | 28 » virtual void» » » » » OnAfterKeyStroke(bool bE
ditOrList, void* pPrivateData, bool & bExit, FX_DWORD nFlag) = 0; |
29 }; | 29 }; |
30 | 30 |
31 class PWL_CLASS CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify | 31 class PWL_CLASS CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify |
32 { | 32 { |
33 public: | 33 public: |
34 CPWL_Edit(); | 34 CPWL_Edit(); |
35 virtual ~CPWL_Edit(); | 35 virtual ~CPWL_Edit(); |
36 | 36 |
37 public: | 37 public: |
38 virtual CFX_ByteString GetClassName() const; | 38 virtual CFX_ByteString GetClassName() const; |
39 virtual void OnDestroy(); | 39 virtual void OnDestroy(); |
40 virtual void OnCreated(); | 40 virtual void OnCreated(); |
41 virtual void RePosChildWnd(); | 41 virtual void RePosChildWnd(); |
42 virtual CPDF_Rect GetClientRect() const; | 42 virtual CPDF_Rect GetClientRect() const; |
43 | 43 |
44 virtual void GetThisAppearanceStream(
CFX_ByteTextBuf & sAppStream); | 44 virtual void GetThisAppearanceStream(
CFX_ByteTextBuf & sAppStream); |
45 virtual void DrawThisAppearance(CFX_R
enderDevice* pDevice, CPDF_Matrix* pUser2Device); | 45 virtual void DrawThisAppearance(CFX_R
enderDevice* pDevice, CPDF_Matrix* pUser2Device); |
46 | 46 |
47 » virtual FX_BOOL»» » » » OnLButtonDown(const CPDF
_Point & point, FX_DWORD nFlag); | 47 » virtual bool» » » » » OnLButtonDown(const CPDF
_Point & point, FX_DWORD nFlag); |
48 » virtual FX_BOOL»» » » » OnLButtonDblClk(const CP
DF_Point & point, FX_DWORD nFlag); | 48 » virtual bool» » » » » OnLButtonDblClk(const CP
DF_Point & point, FX_DWORD nFlag); |
49 » virtual FX_BOOL»» » » » OnRButtonUp(const CPDF_P
oint & point, FX_DWORD nFlag); | 49 » virtual bool» » » » » OnRButtonUp(const CPDF_P
oint & point, FX_DWORD nFlag); |
50 » virtual FX_BOOL»» » » » OnMouseWheel(short zDelt
a, const CPDF_Point & point, FX_DWORD nFlag); | 50 » virtual bool» » » » » OnMouseWheel(short zDelt
a, const CPDF_Point & point, FX_DWORD nFlag); |
51 | 51 |
52 » virtual FX_BOOL»» » » » OnKeyDown(FX_WORD nChar,
FX_DWORD nFlag); | 52 » virtual bool» » » » » OnKeyDown(FX_WORD nChar,
FX_DWORD nFlag); |
53 » virtual FX_BOOL»» » » » OnChar(FX_WORD nChar, FX
_DWORD nFlag); | 53 » virtual bool» » » » » OnChar(FX_WORD nChar, FX
_DWORD nFlag); |
54 | 54 |
55 virtual CPDF_Rect GetFocusRect() const; | 55 virtual CPDF_Rect GetFocusRect() const; |
56 | 56 |
57 public: | 57 public: |
58 » void» » » » » » » SetAlignFormatH(
PWL_EDIT_ALIGNFORMAT_H nFormat = PEAH_LEFT, FX_BOOL bPaint = TRUE);» //0:left
1:right 2:middle | 58 » void» » » » » » » SetAlignFormatH(
PWL_EDIT_ALIGNFORMAT_H nFormat = PEAH_LEFT, bool bPaint = true);» //0:left
1:right 2:middle |
59 » void» » » » » » » SetAlignFormatV(
PWL_EDIT_ALIGNFORMAT_V nFormat = PEAV_TOP, FX_BOOL bPaint = TRUE);» //0:top
1:bottom 2:center | 59 » void» » » » » » » SetAlignFormatV(
PWL_EDIT_ALIGNFORMAT_V nFormat = PEAV_TOP, bool bPaint = true);»//0:top 1:bottom
2:center |
60 | 60 |
61 void SetCharArray(int
32_t nCharArray); | 61 void SetCharArray(int
32_t nCharArray); |
62 void SetLimitChar(int
32_t nLimitChar); | 62 void SetLimitChar(int
32_t nLimitChar); |
63 | 63 |
64 » void» » » » » » » SetHorzScale(int
32_t nHorzScale, FX_BOOL bPaint = TRUE); | 64 » void» » » » » » » SetHorzScale(int
32_t nHorzScale, bool bPaint = true); |
65 » void» » » » » » » SetCharSpace(FX_
FLOAT fCharSpace, FX_BOOL bPaint = TRUE); | 65 » void» » » » » » » SetCharSpace(FX_
FLOAT fCharSpace, bool bPaint = true); |
66 | 66 |
67 » void» » » » » » » SetLineLeading(F
X_FLOAT fLineLeading, FX_BOOL bPaint = TRUE); | 67 » void» » » » » » » SetLineLeading(F
X_FLOAT fLineLeading, bool bPaint = true); |
68 | 68 |
69 » void» » » » » » » EnableSpellCheck
(FX_BOOL bEnabled); | 69 » void» » » » » » » EnableSpellCheck
(bool bEnabled); |
70 | 70 |
71 » FX_BOOL»» » » » » » CanSelectAll() c
onst; | 71 » bool» » » » » » » CanSelectAll() c
onst; |
72 » FX_BOOL»» » » » » » CanClear() const
; | 72 » bool» » » » » » » CanClear() const
; |
73 » FX_BOOL»» » » » » » CanCopy() const; | 73 » bool» » » » » » » CanCopy() const; |
74 » FX_BOOL»» » » » » » CanCut() const; | 74 » bool» » » » » » » CanCut() const; |
75 » FX_BOOL»» » » » » » CanPaste() const
; | 75 » bool» » » » » » » CanPaste() const
; |
76 | 76 |
77 virtual void CopyText(); | 77 virtual void CopyText(); |
78 virtual void PasteText(); | 78 virtual void PasteText(); |
79 virtual void CutText(); | 79 virtual void CutText(); |
80 | 80 |
81 virtual void SetText(const FX_WCHAR*
csText); | 81 virtual void SetText(const FX_WCHAR*
csText); |
82 void ReplaceSel(const
FX_WCHAR* csText); | 82 void ReplaceSel(const
FX_WCHAR* csText); |
83 | 83 |
84 CFX_ByteString GetTextAppearanceStream(
const CPDF_Point & ptOffset) const; | 84 CFX_ByteString GetTextAppearanceStream(
const CPDF_Point & ptOffset) const; |
85 CFX_ByteString GetCaretAppearanceStream
(const CPDF_Point & ptOffset) const; | 85 CFX_ByteString GetCaretAppearanceStream
(const CPDF_Point & ptOffset) const; |
86 CFX_ByteString GetSelectAppearanceStrea
m(const CPDF_Point & ptOffset) const; | 86 CFX_ByteString GetSelectAppearanceStrea
m(const CPDF_Point & ptOffset) const; |
87 | 87 |
88 » FX_BOOL»» » » » » » IsTextFull() con
st; | 88 » bool» » » » » » » IsTextFull() con
st; |
89 | 89 |
90 static FX_FLOAT GetCharArrayAutoFontSize
(CPDF_Font* pFont, const CPDF_Rect& rcPlate, int32_t nCharArray); | 90 static FX_FLOAT GetCharArrayAutoFontSize
(CPDF_Font* pFont, const CPDF_Rect& rcPlate, int32_t nCharArray); |
91 | 91 |
92 void SetFillerNotify(
IPWL_Filler_Notify* pNotify) {m_pFillerNotify = pNotify;} | 92 void SetFillerNotify(
IPWL_Filler_Notify* pNotify) {m_pFillerNotify = pNotify;} |
93 | 93 |
94 void GeneratePageObje
cts(CPDF_PageObjects* pPageObjects, | 94 void GeneratePageObje
cts(CPDF_PageObjects* pPageObjects, |
95
const CPDF_Point& ptOffset, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); | 95
const CPDF_Point& ptOffset, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); |
96 void GeneratePageObje
cts(CPDF_PageObjects* pPageObjects, | 96 void GeneratePageObje
cts(CPDF_PageObjects* pPageObjects, |
97
const CPDF_Point& ptOffset); | 97
const CPDF_Point& ptOffset); |
98 | 98 |
99 protected: | 99 protected: |
100 virtual void OnSetFocus(); | 100 virtual void OnSetFocus(); |
101 virtual void OnKillFocus(); | 101 virtual void OnKillFocus(); |
102 | 102 |
103 protected: | 103 protected: |
104 virtual void OnInsertWord(const CPVT_
WordPlace& place, const CPVT_WordPlace& oldplace); | 104 virtual void OnInsertWord(const CPVT_
WordPlace& place, const CPVT_WordPlace& oldplace); |
105 virtual void OnInsertReturn(const CPV
T_WordPlace& place, const CPVT_WordPlace& oldplace); | 105 virtual void OnInsertReturn(const CPV
T_WordPlace& place, const CPVT_WordPlace& oldplace); |
106 virtual void OnBackSpace(const CPVT_W
ordPlace& place, const CPVT_WordPlace& oldplace); | 106 virtual void OnBackSpace(const CPVT_W
ordPlace& place, const CPVT_WordPlace& oldplace); |
107 virtual void OnDelete(const CPVT_Word
Place& place, const CPVT_WordPlace& oldplace); | 107 virtual void OnDelete(const CPVT_Word
Place& place, const CPVT_WordPlace& oldplace); |
108 virtual void OnClear(const CPVT_WordP
lace& place, const CPVT_WordPlace& oldplace); | 108 virtual void OnClear(const CPVT_WordP
lace& place, const CPVT_WordPlace& oldplace); |
109 virtual void OnSetText(const CPVT_Wor
dPlace& place, const CPVT_WordPlace& oldplace); | 109 virtual void OnSetText(const CPVT_Wor
dPlace& place, const CPVT_WordPlace& oldplace); |
110 virtual void OnInsertText(const CPVT_
WordPlace& place, const CPVT_WordPlace& oldplace); | 110 virtual void OnInsertText(const CPVT_
WordPlace& place, const CPVT_WordPlace& oldplace); |
111 virtual void OnAddUndo(IFX_Edit_UndoI
tem* pUndoItem); | 111 virtual void OnAddUndo(IFX_Edit_UndoI
tem* pUndoItem); |
112 | 112 |
113 private: | 113 private: |
114 CPVT_WordRange GetSelectWordRange() con
st; | 114 CPVT_WordRange GetSelectWordRange() con
st; |
115 » virtual void» » » » » ShowVScrollBar(FX_BOOL b
Show); | 115 » virtual void» » » » » ShowVScrollBar(bool bSho
w); |
116 » FX_BOOL»» » » » » » IsVScrollBarVisi
ble() const; | 116 » bool» » » » » » » IsVScrollBarVisi
ble() const; |
117 void SetParamByFlag()
; | 117 void SetParamByFlag()
; |
118 | 118 |
119 FX_FLOAT GetCharArrayAuto
FontSize(int32_t nCharArray); | 119 FX_FLOAT GetCharArrayAuto
FontSize(int32_t nCharArray); |
120 CPDF_Point GetWordRightBott
omPoint(const CPVT_WordPlace& wpWord); | 120 CPDF_Point GetWordRightBott
omPoint(const CPVT_WordPlace& wpWord); |
121 | 121 |
122 CPVT_WordRange CombineWordRange(const C
PVT_WordRange& wr1, const CPVT_WordRange& wr2); | 122 CPVT_WordRange CombineWordRange(const C
PVT_WordRange& wr1, const CPVT_WordRange& wr2); |
123 CPVT_WordRange GetLatinWordsRange(const
CPDF_Point & point) const; | 123 CPVT_WordRange GetLatinWordsRange(const
CPDF_Point & point) const; |
124 CPVT_WordRange GetLatinWordsRange(const
CPVT_WordPlace & place) const; | 124 CPVT_WordRange GetLatinWordsRange(const
CPVT_WordPlace & place) const; |
125 CPVT_WordRange GetArabicWordsRange(cons
t CPVT_WordPlace & place) const; | 125 CPVT_WordRange GetArabicWordsRange(cons
t CPVT_WordPlace & place) const; |
126 » CPVT_WordRange» » » » » GetSameWordsRange(const
CPVT_WordPlace & place, FX_BOOL bLatin, FX_BOOL bArabic) const; | 126 » CPVT_WordRange» » » » » GetSameWordsRange(const
CPVT_WordPlace & place, bool bLatin, bool bArabic) const; |
127 | 127 |
128 void AjustArabicWords
(const CPVT_WordRange& wr); | 128 void AjustArabicWords
(const CPVT_WordRange& wr); |
129 public: | 129 public: |
130 » FX_BOOL»» » » » » » IsProceedtoOnCha
r(FX_WORD nKeyCode, FX_DWORD nFlag); | 130 » bool» » » » » » » IsProceedtoOnCha
r(FX_WORD nKeyCode, FX_DWORD nFlag); |
131 private: | 131 private: |
132 IPWL_Filler_Notify* m_pFillerNotify; | 132 IPWL_Filler_Notify* m_pFillerNotify; |
133 IPWL_SpellCheck* m_pSpellCheck; | 133 IPWL_SpellCheck* m_pSpellCheck; |
134 » FX_BOOL»» » » » » » m_bFocus; | 134 » bool» » » » » » » m_bFocus; |
135 CPDF_Rect m_rcOldWindow; | 135 CPDF_Rect m_rcOldWindow; |
136 public: | 136 public: |
137 void AttachFFLData(vo
id* pData) {m_pFormFiller = pData;} | 137 void AttachFFLData(vo
id* pData) {m_pFormFiller = pData;} |
138 private: | 138 private: |
139 void* m_pFormFiller; | 139 void* m_pFormFiller; |
140 }; | 140 }; |
141 | 141 |
142 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDIT_H_ | 142 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDIT_H_ |
OLD | NEW |