diff options
Diffstat (limited to 'fpdfsdk/include/fxedit/fxet_edit.h')
-rw-r--r-- | fpdfsdk/include/fxedit/fxet_edit.h | 224 |
1 files changed, 112 insertions, 112 deletions
diff --git a/fpdfsdk/include/fxedit/fxet_edit.h b/fpdfsdk/include/fxedit/fxet_edit.h index f728d8735e..7a2742f0ee 100644 --- a/fpdfsdk/include/fxedit/fxet_edit.h +++ b/fpdfsdk/include/fxedit/fxet_edit.h @@ -68,27 +68,27 @@ struct CFX_Edit_LineRect { } - bool operator != (const CFX_Edit_LineRect & linerect) const + FX_BOOL operator != (const CFX_Edit_LineRect & linerect) const { return FXSYS_memcmp(this, &linerect, sizeof(CFX_Edit_LineRect)) != 0; } - bool IsSameHeight(const CFX_Edit_LineRect & linerect) const + FX_BOOL IsSameHeight(const CFX_Edit_LineRect & linerect) const { return FX_EDIT_IsFloatZero((m_rcLine.top - m_rcLine.bottom) - (linerect.m_rcLine.top -linerect.m_rcLine.bottom)); } - bool IsSameTop(const CFX_Edit_LineRect & linerect) const + FX_BOOL IsSameTop(const CFX_Edit_LineRect & linerect) const { return FX_EDIT_IsFloatZero(m_rcLine.top - linerect.m_rcLine.top); } - bool IsSameLeft(const CFX_Edit_LineRect & linerect) const + FX_BOOL IsSameLeft(const CFX_Edit_LineRect & linerect) const { return FX_EDIT_IsFloatZero(m_rcLine.left - linerect.m_rcLine.left); } - bool IsSameRight(const CFX_Edit_LineRect & linerect) const + FX_BOOL IsSameRight(const CFX_Edit_LineRect & linerect) const { return FX_EDIT_IsFloatZero(m_rcLine.right - linerect.m_rcLine.right); } @@ -267,12 +267,12 @@ public: EndPos = end; } - bool IsExist() const + FX_BOOL IsExist() const { return BeginPos != EndPos; } - bool operator != (const CPVT_WordRange & wr) const + FX_BOOL operator != (const CPVT_WordRange & wr) const { return wr.BeginPos != BeginPos || wr.EndPos != EndPos; } @@ -293,10 +293,10 @@ public: void AddItem(IFX_Edit_UndoItem* pItem); - bool CanUndo() const; - bool CanRedo() const; - bool IsModified() const; - bool IsWorking() const; + FX_BOOL CanUndo() const; + FX_BOOL CanRedo() const; + FX_BOOL IsModified() const; + FX_BOOL IsWorking() const; void Reset(); @@ -316,26 +316,26 @@ private: int32_t m_nCurUndoPos; int32_t m_nBufSize; - bool m_bModified; - bool m_bVirgin; - bool m_bWorking; + FX_BOOL m_bModified; + FX_BOOL m_bVirgin; + FX_BOOL m_bWorking; }; class CFX_Edit_UndoItem : public IFX_Edit_UndoItem { public: - CFX_Edit_UndoItem() : m_bFirst(true), m_bLast(true) {} + CFX_Edit_UndoItem() : m_bFirst(TRUE), m_bLast(TRUE) {} CFX_WideString GetUndoTitle() override { return L""; } - void SetFirst(bool bFirst){m_bFirst = bFirst;} - bool IsFirst(){return m_bFirst;} - void SetLast(bool bLast){m_bLast = bLast;} - bool IsLast(){return m_bLast;} + void SetFirst(FX_BOOL bFirst){m_bFirst = bFirst;} + FX_BOOL IsFirst(){return m_bFirst;} + void SetLast(FX_BOOL bLast){m_bLast = bLast;} + FX_BOOL IsLast(){return m_bLast;} private: - bool m_bFirst; - bool m_bLast; + FX_BOOL m_bFirst; + FX_BOOL m_bLast; }; class CFX_Edit_GroupUndoItem : public IFX_Edit_UndoItem @@ -424,7 +424,7 @@ class CFXEU_Delete : public CFX_Edit_UndoItem public: CFXEU_Delete(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, FX_WORD word, int32_t charset, - const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, bool bSecEnd); + const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, FX_BOOL bSecEnd); virtual ~CFXEU_Delete(); void Redo(); @@ -439,7 +439,7 @@ private: int32_t m_nCharset; CPVT_SecProps m_SecProps; CPVT_WordProps m_WordProps; - bool m_bSecEnd; + FX_BOOL m_bSecEnd; }; class CFXEU_Clear : public CFX_Edit_UndoItem @@ -575,61 +575,61 @@ public: IFX_Edit_FontMap* GetFontMap(); void Initialize(); - void SetPlateRect(const CPDF_Rect & rect, bool bPaint = true); + void SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint = TRUE); void SetScrollPos(const CPDF_Point & point); - void SetAlignmentH(int32_t nFormat = 0, bool bPaint = true); - void SetAlignmentV(int32_t nFormat = 0, bool bPaint = true); - void SetPasswordChar(FX_WORD wSubWord = '*', bool bPaint = true); - void SetLimitChar(int32_t nLimitChar = 0, bool bPaint = true); - void SetCharArray(int32_t nCharArray = 0, bool bPaint = true); - void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, bool bPaint = true); - void SetHorzScale(int32_t nHorzScale = 100, bool bPaint = true); - void SetLineLeading(FX_FLOAT fLineLeading, bool bPaint = true); - void SetMultiLine(bool bMultiLine = true, bool bPaint = true); - void SetAutoReturn(bool bAuto = true, bool bPaint = true); - void SetAutoFontSize(bool bAuto = true, bool bPaint = true); - void SetAutoScroll(bool bAuto = true, bool bPaint = true); - void SetFontSize(FX_FLOAT fFontSize, bool bPaint = true); - void SetTextOverflow(bool bAllowed = false, bool bPaint = true); - - bool IsRichText() const; - void SetRichText(bool bRichText = true, bool bPaint = true); - bool SetRichFontSize(FX_FLOAT fFontSize); - bool SetRichFontIndex(int32_t nFontIndex); - bool SetRichTextColor(FX_COLORREF dwColor); - bool SetRichTextScript(int32_t nScriptType); - bool SetRichTextBold(bool bBold = true); - bool SetRichTextItalic(bool bItalic = true); - bool SetRichTextUnderline(bool bUnderline = true); - bool SetRichTextCrossout(bool bCrossout = true); - bool SetRichTextCharSpace(FX_FLOAT fCharSpace); - bool SetRichTextHorzScale(int32_t nHorzScale = 100); - bool SetRichTextLineLeading(FX_FLOAT fLineLeading); - bool SetRichTextLineIndent(FX_FLOAT fLineIndent); - bool SetRichTextAlignment(int32_t nAlignment); - - void OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl); - void OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl); - void OnVK_UP(bool bShift,bool bCtrl); - void OnVK_DOWN(bool bShift,bool bCtrl); - void OnVK_LEFT(bool bShift,bool bCtrl); - void OnVK_RIGHT(bool bShift,bool bCtrl); - void OnVK_HOME(bool bShift,bool bCtrl); - void OnVK_END(bool bShift,bool bCtrl); + void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE); + void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE); + void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE); + void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE); + void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE); + void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE); + void SetHorzScale(int32_t nHorzScale = 100, FX_BOOL bPaint = TRUE); + void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE); + void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE); + void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); + void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); + void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); + void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE); + void SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE); + + FX_BOOL IsRichText() const; + void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE); + FX_BOOL SetRichFontSize(FX_FLOAT fFontSize); + FX_BOOL SetRichFontIndex(int32_t nFontIndex); + FX_BOOL SetRichTextColor(FX_COLORREF dwColor); + FX_BOOL SetRichTextScript(int32_t nScriptType); + FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE); + FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE); + FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE); + FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE); + FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace); + FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100); + FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading); + FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent); + FX_BOOL SetRichTextAlignment(int32_t nAlignment); + + void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl); + void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl); + void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl); + void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl); + void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl); + void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl); + void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl); + void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl); void SetText(const FX_WCHAR* text,int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); - bool InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL); - bool InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); - bool Backspace(); - bool Delete(); - bool Clear(); - bool Empty(); - bool InsertText(const FX_WCHAR* text, int32_t charset = DEFAULT_CHARSET, + FX_BOOL InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL); + FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); + FX_BOOL Backspace(); + FX_BOOL Delete(); + FX_BOOL Clear(); + FX_BOOL Empty(); + FX_BOOL InsertText(const FX_WCHAR* text, int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); - bool Redo(); - bool Undo(); + FX_BOOL Redo(); + FX_BOOL Undo(); CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place, const FX_WCHAR* text, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps); int32_t GetCharSetFromUnicode(FX_WORD word, int32_t nOldCharset); @@ -666,7 +666,7 @@ private: void SelectAll(); void SelectNone(); void SetSel(const CPVT_WordPlace & begin,const CPVT_WordPlace & end); - bool IsSelected() const; + FX_BOOL IsSelected() const; void RearrangeAll(); void RearrangePart(const CPVT_WordRange & range); @@ -677,23 +677,23 @@ private: void SetScrollPosY(FX_FLOAT fy); void SetScrollLimit(); void SetContentChanged(); - void EnableNotify(bool bNotify); + void EnableNotify(FX_BOOL bNotify); void SetText(const FX_WCHAR* text,int32_t charset, - const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,bool bAddUndo, bool bPaint); - bool InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps,bool bAddUndo, bool bPaint); - bool InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,bool bAddUndo, bool bPaint); - bool Backspace(bool bAddUndo, bool bPaint); - bool Delete(bool bAddUndo, bool bPaint); - bool Clear(bool bAddUndo, bool bPaint); - bool InsertText(const FX_WCHAR* text, int32_t charset, - const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,bool bAddUndo, bool bPaint); - bool SetRichTextProps(EDIT_PROPS_E eProps, + const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); + FX_BOOL InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); + FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); + FX_BOOL Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint); + FX_BOOL Delete(FX_BOOL bAddUndo, FX_BOOL bPaint); + FX_BOOL Clear(FX_BOOL bAddUndo, FX_BOOL bPaint); + FX_BOOL InsertText(const FX_WCHAR* text, int32_t charset, + const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); + FX_BOOL SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps); - bool SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, - const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, bool bAddUndo); - bool SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, - const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, bool bAddUndo); + FX_BOOL SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, + const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo); + FX_BOOL SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, + const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo); void PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr); void PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlace & wpNew); @@ -702,7 +702,7 @@ private: inline CPDF_Rect VTToEdit(const CPDF_Rect & rect) const; inline CPDF_Rect EditToVT(const CPDF_Rect & rect) const; - void EnableRefresh(bool bRefresh); + void EnableRefresh(FX_BOOL bRefresh); void Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1 = NULL,const CPVT_WordRange * pRange2 = NULL); void RefreshPushLineRects(const CPVT_WordRange & wr); void RefreshPushRandomRects(const CPVT_WordRange & wr); @@ -720,14 +720,14 @@ private: CPVT_WordRange CombineWordRange(const CPVT_WordRange & wr1, const CPVT_WordRange & wr2); CPVT_WordRange GetSelectWordRange() const; - void EnableUndo(bool bUndo); - void EnableOprNotify(bool bNotify); + void EnableUndo(FX_BOOL bUndo); + void EnableOprNotify(FX_BOOL bNotify); - bool IsTextFull() const; - bool IsTextOverflow() const; - bool CanUndo() const; - bool CanRedo() const; - bool IsModified() const; + FX_BOOL IsTextFull() const; + FX_BOOL IsTextOverflow() const; + FX_BOOL CanUndo() const; + FX_BOOL CanRedo() const; + FX_BOOL IsModified() const; void BeginGroupUndo(const CFX_WideString& sTitle); void EndGroupUndo(); @@ -751,19 +751,19 @@ private: CPDF_Point m_ptScrollPos; CPDF_Point m_ptRefreshScrollPos; - bool m_bEnableScroll; + FX_BOOL m_bEnableScroll; IFX_Edit_Iterator * m_pIterator; CFX_Edit_Refresh m_Refresh; CPDF_Point m_ptCaret; CFX_Edit_Undo m_Undo; int32_t m_nAlignment; - bool m_bNotifyFlag; - bool m_bEnableOverflow; - bool m_bEnableRefresh; + FX_BOOL m_bNotifyFlag; + FX_BOOL m_bEnableOverflow; + FX_BOOL m_bEnableRefresh; CPDF_Rect m_rcOldContent; - bool m_bEnableUndo; - bool m_bNotify; - bool m_bOprNotify; + FX_BOOL m_bEnableUndo; + FX_BOOL m_bNotify; + FX_BOOL m_bOprNotify; CFX_Edit_GroupUndoItem* m_pGroupUndoItem; }; @@ -775,16 +775,16 @@ public: CFX_Edit_Iterator(CFX_Edit * pEdit,IPDF_VariableText_Iterator * pVTIterator); virtual ~CFX_Edit_Iterator(); - bool NextWord(); - bool NextLine(); - bool NextSection(); - bool PrevWord(); - bool PrevLine(); - bool PrevSection(); + FX_BOOL NextWord(); + FX_BOOL NextLine(); + FX_BOOL NextSection(); + FX_BOOL PrevWord(); + FX_BOOL PrevLine(); + FX_BOOL PrevSection(); - bool GetWord(CPVT_Word & word) const; - bool GetLine(CPVT_Line & line) const; - bool GetSection(CPVT_Section & section) const; + FX_BOOL GetWord(CPVT_Word & word) const; + FX_BOOL GetLine(CPVT_Line & line) const; + FX_BOOL GetSection(CPVT_Section & section) const; void SetAt(int32_t nWordIndex); void SetAt(const CPVT_WordPlace & place); const CPVT_WordPlace & GetAt() const; @@ -808,7 +808,7 @@ public: int32_t GetTypeDescent(int32_t nFontIndex); int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex); int32_t GetDefaultFontIndex(); - bool IsLatinWord(FX_WORD word); + FX_BOOL IsLatinWord(FX_WORD word); private: IFX_Edit_FontMap* m_pFontMap; |