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 _IFDE_TXTEDTBUF_H 8 #define _IFDE_TXTEDTBUF_H 9 #define FDE_DEFCHUNKLENGTH (1024) 10 11 class IFDE_TxtEdtBuf { 12 public: ~IFDE_TxtEdtBuf()13 virtual ~IFDE_TxtEdtBuf() {} 14 virtual void Release() = 0; 15 16 virtual FX_BOOL SetChunkSize(int32_t nChunkSize) = 0; 17 virtual int32_t GetChunkSize() const = 0; 18 virtual int32_t GetTextLength() const = 0; 19 virtual void SetText(const CFX_WideString& wsText) = 0; 20 virtual void GetText(CFX_WideString& wsText) const = 0; 21 virtual FX_WCHAR GetCharByIndex(int32_t nIndex) const = 0; 22 virtual void GetRange(CFX_WideString& wsText, 23 int32_t nBegin, 24 int32_t nCount = -1) const = 0; 25 26 virtual void Insert(int32_t nPos, 27 const FX_WCHAR* lpText, 28 int32_t nLength = 1) = 0; 29 virtual void Delete(int32_t nIndex, int32_t nLength = 1) = 0; 30 31 virtual void Clear(FX_BOOL bRelease = TRUE) = 0; 32 33 virtual FX_BOOL Optimize(IFX_Pause* pPause = NULL) = 0; 34 }; 35 #endif 36