| 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" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 class CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify { | 45 class CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify { |
| 46 public: | 46 public: |
| 47 CPWL_Edit(); | 47 CPWL_Edit(); |
| 48 ~CPWL_Edit() override; | 48 ~CPWL_Edit() override; |
| 49 | 49 |
| 50 // CPWL_EditCtrl | 50 // CPWL_EditCtrl |
| 51 CFX_ByteString GetClassName() const override; | 51 CFX_ByteString GetClassName() const override; |
| 52 void OnDestroy() override; | 52 void OnDestroy() override; |
| 53 void OnCreated() override; | 53 void OnCreated() override; |
| 54 void RePosChildWnd() override; | 54 void RePosChildWnd() override; |
| 55 CFX_FloatRect GetClientRect() const override; | 55 CPDF_Rect GetClientRect() const override; |
| 56 void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override; | 56 void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override; |
| 57 void DrawThisAppearance(CFX_RenderDevice* pDevice, | 57 void DrawThisAppearance(CFX_RenderDevice* pDevice, |
| 58 CFX_Matrix* pUser2Device) override; | 58 CFX_Matrix* pUser2Device) override; |
| 59 FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; | 59 FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; |
| 60 FX_BOOL OnLButtonDblClk(const CFX_FloatPoint& point, FX_DWORD nFlag) override; | 60 FX_BOOL OnLButtonDblClk(const CPDF_Point& point, FX_DWORD nFlag) override; |
| 61 FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; | 61 FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; |
| 62 FX_BOOL OnMouseWheel(short zDelta, | 62 FX_BOOL OnMouseWheel(short zDelta, |
| 63 const CFX_FloatPoint& point, | 63 const CPDF_Point& point, |
| 64 FX_DWORD nFlag) override; | 64 FX_DWORD nFlag) override; |
| 65 FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override; | 65 FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override; |
| 66 FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override; | 66 FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override; |
| 67 CFX_FloatRect GetFocusRect() const override; | 67 CPDF_Rect GetFocusRect() const override; |
| 68 void OnSetFocus() override; | 68 void OnSetFocus() override; |
| 69 void OnKillFocus() override; | 69 void OnKillFocus() override; |
| 70 | 70 |
| 71 void SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat = PEAH_LEFT, | 71 void SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat = PEAH_LEFT, |
| 72 FX_BOOL bPaint = TRUE); // 0:left 1:right 2:middle | 72 FX_BOOL bPaint = TRUE); // 0:left 1:right 2:middle |
| 73 void SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat = PEAV_TOP, | 73 void SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat = PEAV_TOP, |
| 74 FX_BOOL bPaint = TRUE); // 0:top 1:bottom 2:center | 74 FX_BOOL bPaint = TRUE); // 0:top 1:bottom 2:center |
| 75 | 75 |
| 76 void SetCharArray(int32_t nCharArray); | 76 void SetCharArray(int32_t nCharArray); |
| 77 void SetLimitChar(int32_t nLimitChar); | 77 void SetLimitChar(int32_t nLimitChar); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 89 FX_BOOL CanCut() const; | 89 FX_BOOL CanCut() const; |
| 90 FX_BOOL CanPaste() const; | 90 FX_BOOL CanPaste() const; |
| 91 | 91 |
| 92 virtual void CopyText(); | 92 virtual void CopyText(); |
| 93 virtual void PasteText(); | 93 virtual void PasteText(); |
| 94 virtual void CutText(); | 94 virtual void CutText(); |
| 95 | 95 |
| 96 virtual void SetText(const FX_WCHAR* csText); | 96 virtual void SetText(const FX_WCHAR* csText); |
| 97 void ReplaceSel(const FX_WCHAR* csText); | 97 void ReplaceSel(const FX_WCHAR* csText); |
| 98 | 98 |
| 99 CFX_ByteString GetTextAppearanceStream(const CFX_FloatPoint& ptOffset) const; | 99 CFX_ByteString GetTextAppearanceStream(const CPDF_Point& ptOffset) const; |
| 100 CFX_ByteString GetCaretAppearanceStream(const CFX_FloatPoint& ptOffset) const; | 100 CFX_ByteString GetCaretAppearanceStream(const CPDF_Point& ptOffset) const; |
| 101 CFX_ByteString GetSelectAppearanceStream( | 101 CFX_ByteString GetSelectAppearanceStream(const CPDF_Point& ptOffset) const; |
| 102 const CFX_FloatPoint& ptOffset) const; | |
| 103 | 102 |
| 104 FX_BOOL IsTextFull() const; | 103 FX_BOOL IsTextFull() const; |
| 105 | 104 |
| 106 static FX_FLOAT GetCharArrayAutoFontSize(CPDF_Font* pFont, | 105 static FX_FLOAT GetCharArrayAutoFontSize(CPDF_Font* pFont, |
| 107 const CFX_FloatRect& rcPlate, | 106 const CPDF_Rect& rcPlate, |
| 108 int32_t nCharArray); | 107 int32_t nCharArray); |
| 109 | 108 |
| 110 void SetFillerNotify(IPWL_Filler_Notify* pNotify) { | 109 void SetFillerNotify(IPWL_Filler_Notify* pNotify) { |
| 111 m_pFillerNotify = pNotify; | 110 m_pFillerNotify = pNotify; |
| 112 } | 111 } |
| 113 | 112 |
| 114 void GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, | 113 void GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, |
| 115 const CFX_FloatPoint& ptOffset, | 114 const CPDF_Point& ptOffset, |
| 116 CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); | 115 CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); |
| 117 void GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, | 116 void GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, |
| 118 const CFX_FloatPoint& ptOffset); | 117 const CPDF_Point& ptOffset); |
| 119 | 118 |
| 120 protected: | 119 protected: |
| 121 // IFX_Edit_OprNotify | 120 // IFX_Edit_OprNotify |
| 122 void OnInsertWord(const CPVT_WordPlace& place, | 121 void OnInsertWord(const CPVT_WordPlace& place, |
| 123 const CPVT_WordPlace& oldplace) override; | 122 const CPVT_WordPlace& oldplace) override; |
| 124 void OnInsertReturn(const CPVT_WordPlace& place, | 123 void OnInsertReturn(const CPVT_WordPlace& place, |
| 125 const CPVT_WordPlace& oldplace) override; | 124 const CPVT_WordPlace& oldplace) override; |
| 126 void OnBackSpace(const CPVT_WordPlace& place, | 125 void OnBackSpace(const CPVT_WordPlace& place, |
| 127 const CPVT_WordPlace& oldplace) override; | 126 const CPVT_WordPlace& oldplace) override; |
| 128 void OnDelete(const CPVT_WordPlace& place, | 127 void OnDelete(const CPVT_WordPlace& place, |
| 129 const CPVT_WordPlace& oldplace) override; | 128 const CPVT_WordPlace& oldplace) override; |
| 130 void OnClear(const CPVT_WordPlace& place, | 129 void OnClear(const CPVT_WordPlace& place, |
| 131 const CPVT_WordPlace& oldplace) override; | 130 const CPVT_WordPlace& oldplace) override; |
| 132 void OnSetText(const CPVT_WordPlace& place, | 131 void OnSetText(const CPVT_WordPlace& place, |
| 133 const CPVT_WordPlace& oldplace) override; | 132 const CPVT_WordPlace& oldplace) override; |
| 134 void OnInsertText(const CPVT_WordPlace& place, | 133 void OnInsertText(const CPVT_WordPlace& place, |
| 135 const CPVT_WordPlace& oldplace) override; | 134 const CPVT_WordPlace& oldplace) override; |
| 136 void OnAddUndo(IFX_Edit_UndoItem* pUndoItem) override; | 135 void OnAddUndo(IFX_Edit_UndoItem* pUndoItem) override; |
| 137 | 136 |
| 138 private: | 137 private: |
| 139 CPVT_WordRange GetSelectWordRange() const; | 138 CPVT_WordRange GetSelectWordRange() const; |
| 140 virtual void ShowVScrollBar(FX_BOOL bShow); | 139 virtual void ShowVScrollBar(FX_BOOL bShow); |
| 141 FX_BOOL IsVScrollBarVisible() const; | 140 FX_BOOL IsVScrollBarVisible() const; |
| 142 void SetParamByFlag(); | 141 void SetParamByFlag(); |
| 143 | 142 |
| 144 FX_FLOAT GetCharArrayAutoFontSize(int32_t nCharArray); | 143 FX_FLOAT GetCharArrayAutoFontSize(int32_t nCharArray); |
| 145 CFX_FloatPoint GetWordRightBottomPoint(const CPVT_WordPlace& wpWord); | 144 CPDF_Point GetWordRightBottomPoint(const CPVT_WordPlace& wpWord); |
| 146 | 145 |
| 147 CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1, | 146 CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1, |
| 148 const CPVT_WordRange& wr2); | 147 const CPVT_WordRange& wr2); |
| 149 CPVT_WordRange GetLatinWordsRange(const CFX_FloatPoint& point) const; | 148 CPVT_WordRange GetLatinWordsRange(const CPDF_Point& point) const; |
| 150 CPVT_WordRange GetLatinWordsRange(const CPVT_WordPlace& place) const; | 149 CPVT_WordRange GetLatinWordsRange(const CPVT_WordPlace& place) const; |
| 151 CPVT_WordRange GetArabicWordsRange(const CPVT_WordPlace& place) const; | 150 CPVT_WordRange GetArabicWordsRange(const CPVT_WordPlace& place) const; |
| 152 CPVT_WordRange GetSameWordsRange(const CPVT_WordPlace& place, | 151 CPVT_WordRange GetSameWordsRange(const CPVT_WordPlace& place, |
| 153 FX_BOOL bLatin, | 152 FX_BOOL bLatin, |
| 154 FX_BOOL bArabic) const; | 153 FX_BOOL bArabic) const; |
| 155 | 154 |
| 156 public: | 155 public: |
| 157 FX_BOOL IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag); | 156 FX_BOOL IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag); |
| 158 | 157 |
| 159 private: | 158 private: |
| 160 IPWL_Filler_Notify* m_pFillerNotify; | 159 IPWL_Filler_Notify* m_pFillerNotify; |
| 161 IPWL_SpellCheck* m_pSpellCheck; | 160 IPWL_SpellCheck* m_pSpellCheck; |
| 162 FX_BOOL m_bFocus; | 161 FX_BOOL m_bFocus; |
| 163 CFX_FloatRect m_rcOldWindow; | 162 CPDF_Rect m_rcOldWindow; |
| 164 | 163 |
| 165 public: | 164 public: |
| 166 void AttachFFLData(void* pData) { m_pFormFiller = pData; } | 165 void AttachFFLData(void* pData) { m_pFormFiller = pData; } |
| 167 | 166 |
| 168 private: | 167 private: |
| 169 void* m_pFormFiller; | 168 void* m_pFormFiller; |
| 170 }; | 169 }; |
| 171 | 170 |
| 172 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDIT_H_ | 171 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDIT_H_ |
| OLD | NEW |