summaryrefslogtreecommitdiff
path: root/xfa/fee/fde_txtedtengine.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-05-18 11:09:47 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-18 11:09:47 -0700
commit653951828cf934afb48b57989089a99b38620d02 (patch)
tree8a91b6f3ffac3d992e47e5d6fd4da31245597ff9 /xfa/fee/fde_txtedtengine.h
parent3b093630d55ad97807bcc710227b03819944605b (diff)
downloadpdfium-653951828cf934afb48b57989089a99b38620d02.tar.xz
Split xfa/fee files into individual class files.
This CL splits the xfa/fee files into individual class files and moves them into the xfa/fde directory where they belong. Review-Url: https://codereview.chromium.org/1994693002
Diffstat (limited to 'xfa/fee/fde_txtedtengine.h')
-rw-r--r--xfa/fee/fde_txtedtengine.h231
1 files changed, 0 insertions, 231 deletions
diff --git a/xfa/fee/fde_txtedtengine.h b/xfa/fee/fde_txtedtengine.h
deleted file mode 100644
index 585caa1eb6..0000000000
--- a/xfa/fee/fde_txtedtengine.h
+++ /dev/null
@@ -1,231 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FEE_FDE_TXTEDTENGINE_H_
-#define XFA_FEE_FDE_TXTEDTENGINE_H_
-
-#include "core/fxcrt/include/fx_string.h"
-#include "xfa/fee/fde_txtedtbuf.h"
-#include "xfa/fee/ifde_txtedtengine.h"
-#include "xfa/fgas/layout/fgas_textbreak.h"
-
-class CFX_TxtBreak;
-class IFX_CharIter;
-class CFDE_TxtEdtParag;
-class CFDE_TxtEdtDoRecord_Insert;
-class CFDE_TxtEdtDoRecord_DeleteRange;
-
-class IFDE_TxtEdtDoRecord {
- public:
- virtual ~IFDE_TxtEdtDoRecord() {}
-
- virtual FX_BOOL Redo() const = 0;
- virtual FX_BOOL Undo() const = 0;
-};
-
-class CFDE_TxtEdtEngine {
- public:
- CFDE_TxtEdtEngine();
-
- void Release();
-
- void SetEditParams(const FDE_TXTEDTPARAMS& params);
- FDE_TXTEDTPARAMS* GetEditParams();
-
- int32_t CountPages() const;
- IFDE_TxtEdtPage* GetPage(int32_t nIndex);
-
- FX_BOOL SetBufChunkSize(int32_t nChunkSize);
- void SetTextByStream(IFX_Stream* pStream);
- void SetText(const CFX_WideString& wsText);
- int32_t GetTextLength() const;
- void GetText(CFX_WideString& wsText, int32_t nStart, int32_t nCount = -1);
- void ClearText();
-
- int32_t GetCaretRect(CFX_RectF& rtCaret) const;
- int32_t GetCaretPos() const;
- int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore);
- int32_t MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
- FX_BOOL bShift = FALSE,
- FX_BOOL bCtrl = FALSE);
- void Lock();
- void Unlock();
- FX_BOOL IsLocked() const;
-
- int32_t Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLength);
- int32_t Delete(int32_t nStart, FX_BOOL bBackspace = FALSE);
- int32_t DeleteRange(int32_t nStart, int32_t nCount = -1);
- int32_t Replace(int32_t nStart,
- int32_t nLength,
- const CFX_WideString& wsReplace);
-
- void SetLimit(int32_t nLimit);
- void SetAliasChar(FX_WCHAR wcAlias);
-
- void RemoveSelRange(int32_t nStart, int32_t nCount = -1);
-
- void AddSelRange(int32_t nStart, int32_t nCount = -1);
- int32_t CountSelRanges();
- int32_t GetSelRange(int32_t nIndex, int32_t& nStart);
- void ClearSelection();
-
- FX_BOOL Redo(const IFDE_TxtEdtDoRecord* pRecord);
- FX_BOOL Undo(const IFDE_TxtEdtDoRecord* pRecord);
-
- int32_t StartLayout();
- int32_t DoLayout(IFX_Pause* pPause);
- void EndLayout();
-
- FX_BOOL Optimize(IFX_Pause* pPause = NULL);
- int32_t CountParags() const;
- CFDE_TxtEdtParag* GetParag(int32_t nParagIndex) const;
- IFX_CharIter* CreateCharIter();
- CFDE_TxtEdtBuf* GetTextBuf() const;
- int32_t GetTextBufLength() const;
- CFX_TxtBreak* GetTextBreak() const;
- int32_t GetLineCount() const;
- int32_t GetPageLineCount() const;
-
- int32_t Line2Parag(int32_t nStartParag,
- int32_t nStartLineofParag,
- int32_t nLineIndex,
- int32_t& nStartLine) const;
- FX_WCHAR GetAliasChar() const { return m_wcAliasChar; }
-
- protected:
- ~CFDE_TxtEdtEngine();
-
- private:
- friend class CFDE_TxtEdtDoRecord_Insert;
- friend class CFDE_TxtEdtDoRecord_DeleteRange;
- friend class CFDE_TxtEdtPage;
-
- struct FDE_TXTEDTSELRANGE {
- int32_t nStart;
- int32_t nCount;
- };
-
- struct FDE_TXTEDTPARAGPOS {
- int32_t nParagIndex;
- int32_t nCharIndex;
- };
-
- void Inner_Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLength);
- void GetPreDeleteText(CFX_WideString& wsText,
- int32_t nIndex,
- int32_t nLength);
- void GetPreInsertText(CFX_WideString& wsText,
- int32_t nIndex,
- const FX_WCHAR* lpText,
- int32_t nLength);
- void GetPreReplaceText(CFX_WideString& wsText,
- int32_t nIndex,
- int32_t nOriginLength,
- const FX_WCHAR* lpText,
- int32_t nLength);
-
- void Inner_DeleteRange(int32_t nStart, int32_t nCount = -1);
- void DeleteRange_DoRecord(int32_t nStart,
- int32_t nCount,
- FX_BOOL bSel = FALSE);
- void ResetEngine();
- void RebuildParagraphs();
- void RemoveAllParags();
- void RemoveAllPages();
- void UpdateParags();
- void UpdatePages();
- void UpdateTxtBreak();
-
- FX_BOOL ReplaceParagEnd(FX_WCHAR*& lpText,
- int32_t& nLength,
- FX_BOOL bPreIsCR = FALSE);
- void RecoverParagEnd(CFX_WideString& wsText);
- int32_t MovePage2Char(int32_t nIndex);
- void TextPos2ParagPos(int32_t nIndex, FDE_TXTEDTPARAGPOS& ParagPos) const;
- int32_t MoveForward(FX_BOOL& bBefore);
- int32_t MoveBackward(FX_BOOL& bBefore);
- FX_BOOL MoveUp(CFX_PointF& ptCaret);
- FX_BOOL MoveDown(CFX_PointF& ptCaret);
- FX_BOOL MoveLineStart();
- FX_BOOL MoveLineEnd();
- FX_BOOL MoveParagStart();
- FX_BOOL MoveParagEnd();
- FX_BOOL MoveHome();
- FX_BOOL MoveEnd();
- FX_BOOL IsFitArea(CFX_WideString& wsText);
- void UpdateCaretRect(int32_t nIndex, FX_BOOL bBefore = TRUE);
- void GetCaretRect(CFX_RectF& rtCaret,
- int32_t nPageIndex,
- int32_t nCaret,
- FX_BOOL bBefore = TRUE);
- void UpdateCaretIndex(const CFX_PointF& ptCaret);
-
- FX_BOOL IsSelect();
- void DeleteSelect();
-
- CFDE_TxtEdtBuf* m_pTxtBuf;
- CFX_TxtBreak* m_pTextBreak;
- FDE_TXTEDTPARAMS m_Param;
- CFX_ArrayTemplate<IFDE_TxtEdtPage*> m_PagePtrArray;
- CFX_ArrayTemplate<CFDE_TxtEdtParag*> m_ParagPtrArray;
- CFX_ArrayTemplate<FDE_TXTEDTSELRANGE*> m_SelRangePtrArr;
- int32_t m_nPageLineCount;
- int32_t m_nLineCount;
- int32_t m_nAnchorPos;
- int32_t m_nLayoutPos;
- FX_FLOAT m_fCaretPosReserve;
- int32_t m_nCaret;
- FX_BOOL m_bBefore;
- int32_t m_nCaretPage;
- CFX_RectF m_rtCaret;
- uint32_t m_dwFindFlags;
- FX_BOOL m_bLock;
- int32_t m_nLimit;
- FX_WCHAR m_wcAliasChar;
- int32_t m_nFirstLineEnd;
- FX_BOOL m_bAutoLineEnd;
- FX_WCHAR m_wLineEnd;
- FDE_TXTEDT_TEXTCHANGE_INFO m_ChangeInfo;
-};
-
-class CFDE_TxtEdtDoRecord_Insert : public IFDE_TxtEdtDoRecord {
- public:
- CFDE_TxtEdtDoRecord_Insert(CFDE_TxtEdtEngine* pEngine,
- int32_t nCaret,
- const FX_WCHAR* lpText,
- int32_t nLength);
- ~CFDE_TxtEdtDoRecord_Insert() override;
-
- FX_BOOL Undo() const override;
- FX_BOOL Redo() const override;
-
- private:
- CFDE_TxtEdtEngine* m_pEngine;
- int32_t m_nCaret;
- CFX_WideString m_wsInsert;
-};
-
-class CFDE_TxtEdtDoRecord_DeleteRange : public IFDE_TxtEdtDoRecord {
- public:
- CFDE_TxtEdtDoRecord_DeleteRange(CFDE_TxtEdtEngine* pEngine,
- int32_t nIndex,
- int32_t nCaret,
- const CFX_WideString& wsRange,
- FX_BOOL bSel = FALSE);
- ~CFDE_TxtEdtDoRecord_DeleteRange() override;
-
- FX_BOOL Undo() const override;
- FX_BOOL Redo() const override;
-
- private:
- CFDE_TxtEdtEngine* m_pEngine;
- FX_BOOL m_bSel;
- int32_t m_nIndex;
- int32_t m_nCaret;
- CFX_WideString m_wsRange;
-};
-
-#endif // XFA_FEE_FDE_TXTEDTENGINE_H_