summaryrefslogtreecommitdiff
path: root/xfa/fee/ifde_txtedtengine.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-05-02 06:49:58 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-02 06:49:58 -0700
commitb696f7d616ef397a01af1d6bd01c061922a259f7 (patch)
tree62d36b02b1c59320461235da8ee68009a6f544de /xfa/fee/ifde_txtedtengine.h
parent038bf0b129e56212a6de0989dca1ae023bb17c5d (diff)
downloadpdfium-b696f7d616ef397a01af1d6bd01c061922a259f7.tar.xz
Remove IFDE_TxtEdt interfaces where possible.
This CL removes the following and uses the only instance instead. * IFDE_TxtEdtParag * IFDE_TxtEdtEventSink * IFDE_TxtEdtEngine * IFDE_TxtEdtBuf Review-Url: https://codereview.chromium.org/1927973003
Diffstat (limited to 'xfa/fee/ifde_txtedtengine.h')
-rw-r--r--xfa/fee/ifde_txtedtengine.h129
1 files changed, 15 insertions, 114 deletions
diff --git a/xfa/fee/ifde_txtedtengine.h b/xfa/fee/ifde_txtedtengine.h
index e03a53e1ab..1855f6f769 100644
--- a/xfa/fee/ifde_txtedtengine.h
+++ b/xfa/fee/ifde_txtedtengine.h
@@ -10,10 +10,9 @@
#include "core/fxge/include/fx_dib.h"
#include "xfa/fgas/font/fgas_font.h"
+class CFDE_TxtEdtEngine;
+class CFWL_EditImp;
class IFDE_TxtEdtPage;
-class IFDE_TxtEdtEngine;
-class IFDE_TxtEdtEventSink;
-class IFDE_TxtEdtParag;
typedef struct FDE_HTXTEDTFIND_ { void* pData; } * FDE_HTXTEDTFIND;
@@ -62,6 +61,7 @@ enum FDE_TXTEDTMOVECARET {
MC_Home,
MC_End,
};
+
enum FDE_TXTEDT_MODIFY_RET {
FDE_TXTEDT_MODIFY_RET_F_Tab = -6,
FDE_TXTEDT_MODIFY_RET_F_Locked = -5,
@@ -75,21 +75,23 @@ enum FDE_TXTEDT_MODIFY_RET {
FDE_TXTEDT_MODIFY_RET_S_Empty = 3,
FDE_TXTEDT_MODIFY_RET_T_Tab = 4,
};
+
enum FDE_TXTEDIT_LINEEND {
FDE_TXTEDIT_LINEEND_Auto,
FDE_TXTEDIT_LINEEND_CRLF,
FDE_TXTEDIT_LINEEND_CR,
FDE_TXTEDIT_LINEEND_LF,
};
-struct _FDE_TXTEDTPARAMS {
- _FDE_TXTEDTPARAMS()
+
+struct FDE_TXTEDTPARAMS {
+ FDE_TXTEDTPARAMS()
: fPlateWidth(0),
fPlateHeight(0),
nLineCount(0),
dwLayoutStyles(0),
dwAlignment(0),
dwMode(0),
- pFont(NULL),
+ pFont(nullptr),
fFontSize(10.0f),
dwFontColor(0xff000000),
fLineSpace(10.0f),
@@ -101,7 +103,8 @@ struct _FDE_TXTEDTPARAMS {
nLineEnd(0),
nHorzScale(100),
fCharSpace(0),
- pEventSink(NULL) {}
+ pEventSink(nullptr) {}
+
FX_FLOAT fPlateWidth;
FX_FLOAT fPlateHeight;
int32_t nLineCount;
@@ -120,56 +123,22 @@ struct _FDE_TXTEDTPARAMS {
int32_t nLineEnd;
int32_t nHorzScale;
FX_FLOAT fCharSpace;
- IFDE_TxtEdtEventSink* pEventSink;
+ CFWL_EditImp* pEventSink;
};
-typedef _FDE_TXTEDTPARAMS FDE_TXTEDTPARAMS;
-typedef _FDE_TXTEDTPARAMS* FDE_LPTXTEDTPARAMS;
+
enum FDE_TXTEDT_TEXTCHANGE_TYPE {
FDE_TXTEDT_TEXTCHANGE_TYPE_Insert = 0,
FDE_TXTEDT_TEXTCHANGE_TYPE_Delete,
FDE_TXTEDT_TEXTCHANGE_TYPE_Replace,
};
-struct _FDE_TXTEDT_TEXTCHANGE_INFO {
+
+struct FDE_TXTEDT_TEXTCHANGE_INFO {
int32_t nChangeType;
CFX_WideString wsInsert;
CFX_WideString wsDelete;
CFX_WideString wsPrevText;
};
-typedef _FDE_TXTEDT_TEXTCHANGE_INFO FDE_TXTEDT_TEXTCHANGE_INFO;
-typedef _FDE_TXTEDT_TEXTCHANGE_INFO* FDE_LPTXTEDT_TEXTCHANGE_INFO;
-class IFDE_TxtEdtEventSink {
- public:
- virtual ~IFDE_TxtEdtEventSink() {}
- virtual void On_CaretChanged(IFDE_TxtEdtEngine* pEdit,
- int32_t nPage,
- FX_BOOL bVisible = TRUE) = 0;
- virtual void On_TextChanged(IFDE_TxtEdtEngine* pEdit,
- FDE_TXTEDT_TEXTCHANGE_INFO& ChangeInfo) = 0;
- virtual void On_PageCountChanged(IFDE_TxtEdtEngine* pEdit) = 0;
- virtual void On_SelChanged(IFDE_TxtEdtEngine* pEdit) = 0;
- virtual FX_BOOL On_PageLoad(IFDE_TxtEdtEngine* pEdit,
- int32_t nPageIndex,
- int32_t nPurpose) = 0;
- virtual FX_BOOL On_PageUnload(IFDE_TxtEdtEngine* pEdit,
- int32_t nPageIndex,
- int32_t nPurpose) = 0;
- virtual FX_BOOL On_PageChange(IFDE_TxtEdtEngine* pEdit,
- int32_t nPageIndex) = 0;
- virtual void On_AddDoRecord(IFDE_TxtEdtEngine* pEdit,
- const CFX_ByteStringC& bsDoRecord) = 0;
- virtual FX_BOOL On_ValidateField(IFDE_TxtEdtEngine* pEdit,
- int32_t nBlockIndex,
- int32_t nFieldIndex,
- const CFX_WideString& wsFieldText,
- int32_t nCharIndex) = 0;
- virtual FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine* pEdit,
- int32_t nBlockIndex) = 0;
- virtual FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine* pEdit,
- int32_t nBlockIndex,
- CFX_WideString& wsBlockText) = 0;
- virtual FX_BOOL On_Validate(IFDE_TxtEdtEngine* pEdit,
- CFX_WideString& wsText) = 0;
-};
+
class IFX_CharIter {
public:
virtual ~IFX_CharIter() {}
@@ -181,73 +150,5 @@ class IFX_CharIter {
virtual FX_BOOL IsEOF(FX_BOOL bTail = TRUE) const = 0;
virtual IFX_CharIter* Clone() = 0;
};
-class IFDE_TxtEdtEngine {
- public:
- static IFDE_TxtEdtEngine* Create();
-
- virtual ~IFDE_TxtEdtEngine() {}
- virtual void Release() = 0;
- virtual void SetEditParams(const FDE_TXTEDTPARAMS& params) = 0;
- virtual const FDE_TXTEDTPARAMS* GetEditParams() const = 0;
-
- virtual int32_t CountPages() const = 0;
- virtual IFDE_TxtEdtPage* GetPage(int32_t nIndex) = 0;
- virtual FX_BOOL SetBufChunkSize(int32_t nChunkSize) = 0;
- virtual void SetTextByStream(IFX_Stream* pStream) = 0;
- virtual void SetText(const CFX_WideString& wsText) = 0;
- virtual int32_t GetTextLength() const = 0;
- virtual void GetText(CFX_WideString& wsText,
- int32_t nStart,
- int32_t nCount = -1) = 0;
- virtual void ClearText() = 0;
-
- virtual int32_t GetCaretRect(CFX_RectF& rtCaret) const = 0;
- virtual int32_t GetCaretPos() const = 0;
- virtual int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE) = 0;
- virtual int32_t MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
- FX_BOOL bShift = FALSE,
- FX_BOOL bCtrl = FALSE) = 0;
-
- virtual void Lock() = 0;
- virtual void Unlock() = 0;
- virtual FX_BOOL IsLocked() const = 0;
-
- virtual int32_t Insert(int32_t nStart,
- const FX_WCHAR* lpText,
- int32_t nLength) = 0;
- virtual int32_t Delete(int32_t nStart, FX_BOOL bBackspace = FALSE) = 0;
- virtual int32_t DeleteRange(int32_t nStart, int32_t nCount = -1) = 0;
- virtual int32_t Replace(int32_t nStart,
- int32_t nLength,
- const CFX_WideString& wsReplace) = 0;
- virtual void SetLimit(int32_t nLimit) = 0;
- virtual void SetAliasChar(FX_WCHAR wAlias) = 0;
- virtual void AddSelRange(int32_t nStart, int32_t nCount = -1) = 0;
- virtual int32_t CountSelRanges() = 0;
- virtual int32_t GetSelRange(int32_t nIndex, int32_t& nStart) = 0;
- virtual void ClearSelection() = 0;
-
- virtual FX_BOOL Redo(const CFX_ByteStringC& bsRedo) = 0;
- virtual FX_BOOL Undo(const CFX_ByteStringC& bsUndo) = 0;
-
- virtual int32_t StartLayout() = 0;
- virtual int32_t DoLayout(IFX_Pause* pPause) = 0;
- virtual void EndLayout() = 0;
-
- virtual FX_BOOL Optimize(IFX_Pause* pPause = NULL) = 0;
- virtual int32_t CountParags() const = 0;
- virtual IFDE_TxtEdtParag* GetParag(int32_t nParagIndex) const = 0;
- virtual IFX_CharIter* CreateCharIter() = 0;
-};
-class IFDE_TxtEdtParag {
- public:
- virtual ~IFDE_TxtEdtParag() {}
- virtual int32_t GetTextLength() const = 0;
- virtual int32_t GetStartIndex() const = 0;
- virtual int32_t CountLines() const = 0;
- virtual void GetLineRange(int32_t nLineIndex,
- int32_t& nStart,
- int32_t& nCount) const = 0;
-};
#endif // XFA_FEE_IFDE_TXTEDTENGINE_H_