Chromium Code Reviews| 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 XFA_FDE_CFDE_TXTEDTENGINE_H_ | 7 #ifndef XFA_FDE_CFDE_TXTEDTENGINE_H_ |
| 8 #define XFA_FDE_CFDE_TXTEDTENGINE_H_ | 8 #define XFA_FDE_CFDE_TXTEDTENGINE_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 | 24 |
| 25 void SetEditParams(const FDE_TXTEDTPARAMS& params); | 25 void SetEditParams(const FDE_TXTEDTPARAMS& params); |
| 26 FDE_TXTEDTPARAMS* GetEditParams(); | 26 FDE_TXTEDTPARAMS* GetEditParams(); |
| 27 | 27 |
| 28 int32_t CountPages() const; | 28 int32_t CountPages() const; |
| 29 IFDE_TxtEdtPage* GetPage(int32_t nIndex); | 29 IFDE_TxtEdtPage* GetPage(int32_t nIndex); |
| 30 | 30 |
| 31 void SetTextByStream(IFX_Stream* pStream); | 31 void SetTextByStream(IFX_Stream* pStream); |
| 32 void SetText(const CFX_WideString& wsText); | 32 void SetText(const CFX_WideString& wsText); |
| 33 int32_t GetTextLength() const; | 33 int32_t GetTextLength() const; |
| 34 void GetText(CFX_WideString& wsText, int32_t nStart, int32_t nCount = -1); | 34 void GetText(CFX_WideString& wsText, |
|
Tom Sepez
2016/11/15 18:44:59
if wsText is an out parameter, its cleaner to retu
dsinclair
2016/11/15 19:10:23
Follow up. There are a lot of methods that take ou
| |
| 35 int32_t nStart, | |
| 36 int32_t nCount = -1) const; | |
| 35 void ClearText(); | 37 void ClearText(); |
| 36 | 38 |
| 37 int32_t GetCaretRect(CFX_RectF& rtCaret) const; | 39 int32_t GetCaretRect(CFX_RectF& rtCaret) const; |
| 38 int32_t GetCaretPos() const; | 40 int32_t GetCaretPos() const; |
| 39 int32_t SetCaretPos(int32_t nIndex, bool bBefore); | 41 int32_t SetCaretPos(int32_t nIndex, bool bBefore); |
| 40 int32_t MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, | 42 int32_t MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, |
| 41 bool bShift = false, | 43 bool bShift = false, |
| 42 bool bCtrl = false); | 44 bool bCtrl = false); |
| 43 void Lock(); | 45 void Lock(); |
| 44 void Unlock(); | 46 void Unlock(); |
| 45 bool IsLocked() const; | 47 bool IsLocked() const; |
| 46 | 48 |
| 47 int32_t Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLength); | 49 int32_t Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLength); |
| 48 int32_t Delete(int32_t nStart, bool bBackspace = false); | 50 int32_t Delete(int32_t nStart, bool bBackspace = false); |
| 49 int32_t DeleteRange(int32_t nStart, int32_t nCount = -1); | 51 int32_t DeleteRange(int32_t nStart, int32_t nCount = -1); |
| 50 int32_t Replace(int32_t nStart, | 52 int32_t Replace(int32_t nStart, |
| 51 int32_t nLength, | 53 int32_t nLength, |
| 52 const CFX_WideString& wsReplace); | 54 const CFX_WideString& wsReplace); |
| 53 | 55 |
| 54 void SetLimit(int32_t nLimit); | 56 void SetLimit(int32_t nLimit); |
| 55 void SetAliasChar(FX_WCHAR wcAlias); | 57 void SetAliasChar(FX_WCHAR wcAlias); |
| 56 | 58 |
| 57 void RemoveSelRange(int32_t nStart, int32_t nCount = -1); | 59 void RemoveSelRange(int32_t nStart, int32_t nCount = -1); |
| 58 | 60 |
| 59 void AddSelRange(int32_t nStart, int32_t nCount = -1); | 61 void AddSelRange(int32_t nStart, int32_t nCount = -1); |
| 60 int32_t CountSelRanges(); | 62 int32_t CountSelRanges() const; |
| 61 int32_t GetSelRange(int32_t nIndex, int32_t& nStart); | 63 int32_t GetSelRange(int32_t nIndex, int32_t& nStart) const; |
|
Tom Sepez
2016/11/15 18:44:59
Can this return a FDE_TXTEDITSELRANGE instead of o
dsinclair
2016/11/15 19:10:23
Acknowledged.
| |
| 62 void ClearSelection(); | 64 void ClearSelection(); |
| 63 | 65 |
| 64 bool Redo(const IFDE_TxtEdtDoRecord* pRecord); | 66 bool Redo(const IFDE_TxtEdtDoRecord* pRecord); |
| 65 bool Undo(const IFDE_TxtEdtDoRecord* pRecord); | 67 bool Undo(const IFDE_TxtEdtDoRecord* pRecord); |
| 66 | 68 |
| 67 int32_t StartLayout(); | 69 int32_t StartLayout(); |
| 68 int32_t DoLayout(IFX_Pause* pPause); | 70 int32_t DoLayout(IFX_Pause* pPause); |
| 69 void EndLayout(); | 71 void EndLayout(); |
| 70 | 72 |
| 71 bool Optimize(IFX_Pause* pPause = nullptr); | 73 bool Optimize(IFX_Pause* pPause = nullptr); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 void RebuildParagraphs(); | 121 void RebuildParagraphs(); |
| 120 void RemoveAllParags(); | 122 void RemoveAllParags(); |
| 121 void RemoveAllPages(); | 123 void RemoveAllPages(); |
| 122 void UpdateParags(); | 124 void UpdateParags(); |
| 123 void UpdatePages(); | 125 void UpdatePages(); |
| 124 void UpdateTxtBreak(); | 126 void UpdateTxtBreak(); |
| 125 | 127 |
| 126 bool ReplaceParagEnd(FX_WCHAR*& lpText, | 128 bool ReplaceParagEnd(FX_WCHAR*& lpText, |
| 127 int32_t& nLength, | 129 int32_t& nLength, |
| 128 bool bPreIsCR = false); | 130 bool bPreIsCR = false); |
| 129 void RecoverParagEnd(CFX_WideString& wsText); | 131 void RecoverParagEnd(CFX_WideString& wsText) const; |
|
Tom Sepez
2016/11/15 18:44:59
ditto
dsinclair
2016/11/15 19:10:23
Acknowledged.
| |
| 130 int32_t MovePage2Char(int32_t nIndex); | 132 int32_t MovePage2Char(int32_t nIndex); |
| 131 void TextPos2ParagPos(int32_t nIndex, FDE_TXTEDTPARAGPOS& ParagPos) const; | 133 void TextPos2ParagPos(int32_t nIndex, FDE_TXTEDTPARAGPOS& ParagPos) const; |
| 132 int32_t MoveForward(bool& bBefore); | 134 int32_t MoveForward(bool& bBefore); |
| 133 int32_t MoveBackward(bool& bBefore); | 135 int32_t MoveBackward(bool& bBefore); |
| 134 bool MoveUp(CFX_PointF& ptCaret); | 136 bool MoveUp(CFX_PointF& ptCaret); |
| 135 bool MoveDown(CFX_PointF& ptCaret); | 137 bool MoveDown(CFX_PointF& ptCaret); |
| 136 bool MoveLineStart(); | 138 bool MoveLineStart(); |
| 137 bool MoveLineEnd(); | 139 bool MoveLineEnd(); |
| 138 bool MoveParagStart(); | 140 bool MoveParagStart(); |
| 139 bool MoveParagEnd(); | 141 bool MoveParagEnd(); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 169 bool m_bLock; | 171 bool m_bLock; |
| 170 int32_t m_nLimit; | 172 int32_t m_nLimit; |
| 171 FX_WCHAR m_wcAliasChar; | 173 FX_WCHAR m_wcAliasChar; |
| 172 int32_t m_nFirstLineEnd; | 174 int32_t m_nFirstLineEnd; |
| 173 bool m_bAutoLineEnd; | 175 bool m_bAutoLineEnd; |
| 174 FX_WCHAR m_wLineEnd; | 176 FX_WCHAR m_wLineEnd; |
| 175 FDE_TXTEDT_TEXTCHANGE_INFO m_ChangeInfo; | 177 FDE_TXTEDT_TEXTCHANGE_INFO m_ChangeInfo; |
| 176 }; | 178 }; |
| 177 | 179 |
| 178 #endif // XFA_FDE_CFDE_TXTEDTENGINE_H_ | 180 #endif // XFA_FDE_CFDE_TXTEDTENGINE_H_ |
| OLD | NEW |