1 // Copyright 2014 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef XFA_FDE_IFDE_TXTEDTPAGE_H_ 8 #define XFA_FDE_IFDE_TXTEDTPAGE_H_ 9 10 #include <vector> 11 12 #include "xfa/fde/fde_visualset.h" 13 #include "xfa/fgas/layout/fgas_textbreak.h" 14 15 class CFDE_TxtEdtEngine; 16 17 class IFDE_TxtEdtPage : public IFDE_CanvasSet, public IFX_TxtAccess { 18 public: 19 static IFDE_TxtEdtPage* Create(CFDE_TxtEdtEngine* pEngine, int32_t nIndex); ~IFDE_TxtEdtPage()20 ~IFDE_TxtEdtPage() override {} 21 22 virtual CFDE_TxtEdtEngine* GetEngine() const = 0; 23 virtual int32_t GetCharRect(int32_t nIndex, 24 CFX_RectF& rect, 25 bool bBBox = false) const = 0; 26 virtual int32_t GetCharIndex(const CFX_PointF& fPoint, bool& bBefore) = 0; 27 virtual void CalcRangeRectArray(int32_t nStart, 28 int32_t nCount, 29 std::vector<CFX_RectF>* RectFArr) const = 0; 30 virtual int32_t SelectWord(const CFX_PointF& fPoint, int32_t& nCount) = 0; 31 virtual int32_t GetCharStart() const = 0; 32 virtual int32_t GetCharCount() const = 0; 33 34 virtual int32_t GetDisplayPos(const CFX_RectF& rtClip, 35 FXTEXT_CHARPOS*& pCharPos, 36 CFX_RectF* pBBox) const = 0; 37 virtual bool IsLoaded(const CFX_RectF* pClipBox) = 0; 38 virtual int32_t LoadPage(const CFX_RectF* pClipBox, IFX_Pause* pPause) = 0; 39 virtual void UnloadPage(const CFX_RectF* pClipBox) = 0; 40 virtual const CFX_RectF& GetContentsBox() = 0; 41 }; 42 43 #endif // XFA_FDE_IFDE_TXTEDTPAGE_H_ 44