diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-09 11:30:25 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-09 11:30:25 -0700 |
commit | bb17868d736f698d5217c30d52c5bbfed62c5936 (patch) | |
tree | 9d4d3e2538a81e6241d4992570bc3f3c1af71d28 /fpdfsdk/include/fxedit | |
parent | bf6c2a4873f8cc12ad910fb904218a78087a3735 (diff) | |
download | pdfium-bb17868d736f698d5217c30d52c5bbfed62c5936.tar.xz |
Use stdint.h types throughout PDFium.
It's redundant nowadays to provide our own equivalents, now
that this is done for us by the system header.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1177483002
Diffstat (limited to 'fpdfsdk/include/fxedit')
-rw-r--r-- | fpdfsdk/include/fxedit/fx_edit.h | 86 | ||||
-rw-r--r-- | fpdfsdk/include/fxedit/fxet_edit.h | 122 | ||||
-rw-r--r-- | fpdfsdk/include/fxedit/fxet_list.h | 90 |
3 files changed, 149 insertions, 149 deletions
diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h index 31ede0564b..0da6fe6f9e 100644 --- a/fpdfsdk/include/fxedit/fx_edit.h +++ b/fpdfsdk/include/fxedit/fx_edit.h @@ -65,15 +65,15 @@ class IFX_Edit_FontMap public: virtual ~IFX_Edit_FontMap() { } //map a fontindex to pdf font. - virtual CPDF_Font * GetPDFFont(FX_INT32 nFontIndex) = 0; + virtual CPDF_Font * GetPDFFont(int32_t nFontIndex) = 0; //get the alias of a pdf font. - virtual CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex) = 0; + virtual CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) = 0; //get the index of a font that can show a word. - virtual FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex) = 0; + virtual int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex) = 0; //get the charcode of word from unicode - virtual FX_INT32 CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word) = 0; + virtual int32_t CharCodeFromUnicode(int32_t nFontIndex, FX_WORD word) = 0; //get the charset of unicode - virtual FX_INT32 CharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset) = 0; + virtual int32_t CharSetFromUnicode(FX_WORD word, int32_t nOldCharset) = 0; }; class IFX_Edit_Notify @@ -151,7 +151,7 @@ public: //get the information of the current section. virtual FX_BOOL GetSection(CPVT_Section & section) const = 0; //set the current position. - virtual void SetAt(FX_INT32 nWordIndex) = 0; + virtual void SetAt(int32_t nWordIndex) = 0; //set the current position. virtual void SetAt(const CPVT_WordPlace & place) = 0; //get the current position. @@ -200,19 +200,19 @@ public: virtual void SetScrollPos(const CPDF_Point & point) = 0; //set the horizontal text alignment in text box, nFormat (0:left 1:middle 2:right). - virtual void SetAlignmentH(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE) = 0; + virtual void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; //set the vertical text alignment in text box, nFormat (0:top 1:center 2:bottom). - virtual void SetAlignmentV(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE) = 0; + virtual void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; //if the text is shown in secret , set a character for substitute. virtual void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE) = 0; //set the maximal count of words of the text. - virtual void SetLimitChar(FX_INT32 nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0; + virtual void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0; //if set the count of charArray , then all words is shown in equal space. - virtual void SetCharArray(FX_INT32 nCharArray = 0, FX_BOOL bPaint = TRUE) = 0; + virtual void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE) = 0; //set the space of two characters. virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE) = 0; //set the horizontal scale of all characters. - virtual void SetHorzScale(FX_INT32 nHorzScale = 100, FX_BOOL bPaint = TRUE) = 0; + virtual void SetHorzScale(int32_t nHorzScale = 100, FX_BOOL bPaint = TRUE) = 0; //set the leading of all lines virtual void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) = 0; //if set, CRLF is allowed. @@ -235,11 +235,11 @@ public: //set the fontsize of selected text. virtual FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) = 0; //set the fontindex of selected text, user can change the font of selected text. - virtual FX_BOOL SetRichFontIndex(FX_INT32 nFontIndex) = 0; + virtual FX_BOOL SetRichFontIndex(int32_t nFontIndex) = 0; //set the textcolor of selected text. virtual FX_BOOL SetRichTextColor(FX_COLORREF dwColor) = 0; //set the text script type of selected text. (0:normal 1:superscript 2:subscript) - virtual FX_BOOL SetRichTextScript(FX_INT32 nScriptType) = 0; + virtual FX_BOOL SetRichTextScript(int32_t nScriptType) = 0; //set the bold font style of selected text. virtual FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE) = 0; //set the italic font style of selected text. @@ -251,25 +251,25 @@ public: //set the charspace of selected text, in user coordinate. virtual FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0; //set the horizontal scale of selected text, default value is 100. - virtual FX_BOOL SetRichTextHorzScale(FX_INT32 nHorzScale = 100) = 0; + virtual FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100) = 0; //set the leading of selected section, in user coordinate. virtual FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0; //set the indent of selected section, in user coordinate. virtual FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0; //set the alignment of selected section, nAlignment(0:left 1:middle 2:right) - virtual FX_BOOL SetRichTextAlignment(FX_INT32 nAlignment) = 0; + virtual FX_BOOL SetRichTextAlignment(int32_t nAlignment) = 0; //set the selected range of text. //if nStartChar == 0 and nEndChar == -1, select all the text. - virtual void SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar) = 0; + virtual void SetSel(int32_t nStartChar,int32_t nEndChar) = 0; //get the selected range of text. - virtual void GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const = 0; + virtual void GetSel(int32_t & nStartChar, int32_t & nEndChar) const = 0; //select all the text. virtual void SelectAll() = 0; //set text is not selected. virtual void SelectNone() = 0; //get the caret position. - virtual FX_INT32 GetCaret() const = 0; + virtual int32_t GetCaret() const = 0; virtual CPVT_WordPlace GetCaretWordPlace() const = 0; //get the string of selected text. virtual CFX_WideString GetSelText() const = 0; @@ -309,14 +309,14 @@ public: virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0; //put text into edit. - virtual void SetText(FX_LPCWSTR text,FX_INT32 charset = DEFAULT_CHARSET, + virtual void SetText(FX_LPCWSTR text,int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; //insert a word into the edit. - virtual FX_BOOL InsertWord(FX_WORD word, FX_INT32 charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL) = 0; + virtual FX_BOOL InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL) = 0; //insert a return into the edit. virtual FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; //insert text into the edit. - virtual FX_BOOL InsertText(FX_LPCWSTR text, FX_INT32 charset = DEFAULT_CHARSET, + virtual FX_BOOL InsertText(FX_LPCWSTR text, int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; //do backspace operation. virtual FX_BOOL Backspace() = 0; @@ -330,7 +330,7 @@ public: //do Undo operation. virtual FX_BOOL Undo() = 0; //move caret - virtual void SetCaret(FX_INT32 nPos) = 0; + virtual void SetCaret(int32_t nPos) = 0; //arrange all words over again virtual void Paint() = 0; @@ -350,9 +350,9 @@ public: virtual void EnableOprNotify(FX_BOOL bNotify) = 0; //map word place to word index. - virtual FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0; + virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0; //map word index to word place. - virtual CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const = 0; + virtual CPVT_WordPlace WordIndexToWordPlace(int32_t index) const = 0; //get the beginning position of a line virtual CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const = 0; @@ -374,9 +374,9 @@ public: //get the mask character. virtual FX_WORD GetPasswordChar() const = 0; //get the count of charArray - virtual FX_INT32 GetCharArray() const = 0; + virtual int32_t GetCharArray() const = 0; //get the horizontal scale of all characters - virtual FX_INT32 GetHorzScale() const = 0; + virtual int32_t GetHorzScale() const = 0; //get the space of two characters virtual FX_FLOAT GetCharSpace() const = 0; //get the latin words of specified range @@ -388,7 +388,7 @@ public: //if the content is changed after settext? virtual FX_BOOL IsModified() const = 0; //get the total words in edit - virtual FX_INT32 GetTotalWords() const = 0; + virtual int32_t GetTotalWords() const = 0; virtual void AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0; @@ -449,29 +449,29 @@ public: virtual CPDF_Rect GetContentRect() const = 0; virtual FX_FLOAT GetFontSize() const = 0; - virtual IFX_Edit* GetItemEdit(FX_INT32 nIndex) const = 0; - virtual FX_INT32 GetCount() const = 0; - virtual FX_BOOL IsItemSelected(FX_INT32 nIndex) const = 0; + virtual IFX_Edit* GetItemEdit(int32_t nIndex) const = 0; + virtual int32_t GetCount() const = 0; + virtual FX_BOOL IsItemSelected(int32_t nIndex) const = 0; virtual FX_FLOAT GetFirstHeight() const = 0; virtual void SetMultipleSel(FX_BOOL bMultiple) = 0; virtual FX_BOOL IsMultipleSel() const = 0; - virtual FX_BOOL IsValid(FX_INT32 nItemIndex) const = 0; - virtual FX_INT32 FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const = 0; + virtual FX_BOOL IsValid(int32_t nItemIndex) const = 0; + virtual int32_t FindNext(int32_t nIndex,FX_WCHAR nChar) const = 0; virtual void SetScrollPos(const CPDF_Point & point) = 0; - virtual void ScrollToListItem(FX_INT32 nItemIndex) = 0; - virtual CPDF_Rect GetItemRect(FX_INT32 nIndex) const = 0; - virtual FX_INT32 GetCaret() const = 0; - virtual FX_INT32 GetSelect() const = 0; - virtual FX_INT32 GetTopItem() const = 0; - virtual FX_INT32 GetItemIndex(const CPDF_Point & point) const = 0; - virtual FX_INT32 GetFirstSelected() const = 0; + virtual void ScrollToListItem(int32_t nItemIndex) = 0; + virtual CPDF_Rect GetItemRect(int32_t nIndex) const = 0; + virtual int32_t GetCaret() const = 0; + virtual int32_t GetSelect() const = 0; + virtual int32_t GetTopItem() const = 0; + virtual int32_t GetItemIndex(const CPDF_Point & point) const = 0; + virtual int32_t GetFirstSelected() const = 0; virtual void AddString(FX_LPCWSTR string) = 0; - virtual void SetTopItem(FX_INT32 nIndex) = 0; - virtual void Select(FX_INT32 nItemIndex) = 0; - virtual void SetCaret(FX_INT32 nItemIndex) = 0; + virtual void SetTopItem(int32_t nIndex) = 0; + virtual void Select(int32_t nItemIndex) = 0; + virtual void SetCaret(int32_t nItemIndex) = 0; virtual void Empty() = 0; virtual void Cancel() = 0; virtual CFX_WideString GetText() const = 0; @@ -485,7 +485,7 @@ public: virtual void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) = 0; virtual void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) = 0; virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0; - virtual void OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) = 0; + virtual void OnVK(int32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) = 0; virtual FX_BOOL OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl) = 0; protected: diff --git a/fpdfsdk/include/fxedit/fxet_edit.h b/fpdfsdk/include/fxedit/fxet_edit.h index 237aa66b53..6fd7b9a4ee 100644 --- a/fpdfsdk/include/fxedit/fxet_edit.h +++ b/fpdfsdk/include/fxedit/fxet_edit.h @@ -111,7 +111,7 @@ public: void Empty() { - for (FX_INT32 i = 0, sz = m_LineRects.GetSize(); i < sz; i++) + for (int32_t i = 0, sz = m_LineRects.GetSize(); i < sz; i++) delete m_LineRects.GetAt(i); m_LineRects.RemoveAll(); @@ -125,7 +125,7 @@ public: void operator = (CFX_Edit_LineRectArray & rects) { Empty(); - for (FX_INT32 i = 0, sz = rects.GetSize(); i < sz; i++) + for (int32_t i = 0, sz = rects.GetSize(); i < sz; i++) m_LineRects.Add(rects.GetAt(i)); rects.RemoveAll(); @@ -137,12 +137,12 @@ public: m_LineRects.Add(pRect); } - FX_INT32 GetSize() const + int32_t GetSize() const { return m_LineRects.GetSize(); } - CFX_Edit_LineRect * GetAt(FX_INT32 nIndex) const + CFX_Edit_LineRect * GetAt(int32_t nIndex) const { if (nIndex < 0 || nIndex >= m_LineRects.GetSize()) return NULL; @@ -167,7 +167,7 @@ public: void Empty() { - for (FX_INT32 i = 0, sz = m_Rects.GetSize(); i < sz; i++) + for (int32_t i = 0, sz = m_Rects.GetSize(); i < sz; i++) delete m_Rects.GetAt(i); this->m_Rects.RemoveAll(); @@ -176,7 +176,7 @@ public: void Add(const CPDF_Rect & rect) { //check for overlaped area - for (FX_INT32 i = 0, sz = m_Rects.GetSize(); i < sz; i++) + for (int32_t i = 0, sz = m_Rects.GetSize(); i < sz; i++) if (CPDF_Rect * pRect = m_Rects.GetAt(i)) if (pRect->Contains(rect))return; @@ -184,12 +184,12 @@ public: m_Rects.Add(pNewRect); } - FX_INT32 GetSize() const + int32_t GetSize() const { return m_Rects.GetSize(); } - CPDF_Rect * GetAt(FX_INT32 nIndex) const + CPDF_Rect * GetAt(int32_t nIndex) const { if (nIndex < 0 || nIndex >= m_Rects.GetSize()) return NULL; @@ -209,7 +209,7 @@ public: void BeginRefresh(); void Push(const CPVT_WordRange & linerange,const CPDF_Rect & rect); void NoAnalyse(); - void Analyse(FX_INT32 nAlignment); + void Analyse(int32_t nAlignment); void AddRefresh(const CPDF_Rect & rect); const CFX_Edit_RectArray * GetRefreshRects() const; void EndRefresh(); @@ -285,7 +285,7 @@ public: class CFX_Edit_Undo { public: - CFX_Edit_Undo(FX_INT32 nBufsize = 10000); + CFX_Edit_Undo(int32_t nBufsize = 10000); virtual ~CFX_Edit_Undo(); void Undo(); @@ -300,13 +300,13 @@ public: void Reset(); - IFX_Edit_UndoItem* GetItem(FX_INT32 nIndex); - FX_INT32 GetItemCount(){return m_UndoItemStack.GetSize();} - FX_INT32 GetCurUndoPos(){return m_nCurUndoPos;} + IFX_Edit_UndoItem* GetItem(int32_t nIndex); + int32_t GetItemCount(){return m_UndoItemStack.GetSize();} + int32_t GetCurUndoPos(){return m_nCurUndoPos;} private: - void SetBufSize(FX_INT32 nSize){m_nBufSize = nSize;} - FX_INT32 GetBufSize(){return m_nBufSize;} + void SetBufSize(int32_t nSize){m_nBufSize = nSize;} + int32_t GetBufSize(){return m_nBufSize;} void RemoveHeads(); void RemoveTails(); @@ -314,8 +314,8 @@ private: private: CFX_ArrayTemplate<IFX_Edit_UndoItem*> m_UndoItemStack; - FX_INT32 m_nCurUndoPos; - FX_INT32 m_nBufSize; + int32_t m_nCurUndoPos; + int32_t m_nBufSize; FX_BOOL m_bModified; FX_BOOL m_bVirgin; FX_BOOL m_bWorking; @@ -362,7 +362,7 @@ class CFXEU_InsertWord : public CFX_Edit_UndoItem { public: CFXEU_InsertWord(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, - FX_WORD word, FX_INT32 charset, const CPVT_WordProps * pWordProps); + FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps); virtual ~CFXEU_InsertWord(); void Redo(); @@ -374,7 +374,7 @@ private: CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; FX_WORD m_Word; - FX_INT32 m_nCharset; + int32_t m_nCharset; CPVT_WordProps m_WordProps; }; @@ -401,7 +401,7 @@ class CFXEU_Backspace : public CFX_Edit_UndoItem { public: CFXEU_Backspace(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, - FX_WORD word, FX_INT32 charset, + FX_WORD word, int32_t charset, const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps); virtual ~CFXEU_Backspace(); @@ -414,7 +414,7 @@ private: CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; FX_WORD m_Word; - FX_INT32 m_nCharset; + int32_t m_nCharset; CPVT_SecProps m_SecProps; CPVT_WordProps m_WordProps; }; @@ -423,7 +423,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, FX_INT32 charset, + FX_WORD word, int32_t charset, const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, FX_BOOL bSecEnd); virtual ~CFXEU_Delete(); @@ -436,7 +436,7 @@ private: CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; FX_WORD m_Word; - FX_INT32 m_nCharset; + int32_t m_nCharset; CPVT_SecProps m_SecProps; CPVT_WordProps m_WordProps; FX_BOOL m_bSecEnd; @@ -463,7 +463,7 @@ class CFXEU_ClearRich : public CFX_Edit_UndoItem public: CFXEU_ClearRich(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, const CPVT_WordRange & wrSel, - FX_WORD word, FX_INT32 charset, + FX_WORD word, int32_t charset, const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps); virtual ~CFXEU_ClearRich(); @@ -477,7 +477,7 @@ private: CPVT_WordPlace m_wpNew; CPVT_WordRange m_wrSel; FX_WORD m_Word; - FX_INT32 m_nCharset; + int32_t m_nCharset; CPVT_SecProps m_SecProps; CPVT_WordProps m_WordProps; }; @@ -486,7 +486,7 @@ class CFXEU_InsertText : public CFX_Edit_UndoItem { public: CFXEU_InsertText(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, - const CFX_WideString & swText, FX_INT32 charset, + const CFX_WideString & swText, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps); virtual ~CFXEU_InsertText(); @@ -499,7 +499,7 @@ private: CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; CFX_WideString m_swText; - FX_INT32 m_nCharset; + int32_t m_nCharset; CPVT_SecProps m_SecProps; CPVT_WordProps m_WordProps; }; @@ -578,13 +578,13 @@ public: void SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint = TRUE); void SetScrollPos(const CPDF_Point & point); - void SetAlignmentH(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE); - void SetAlignmentV(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE); + 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(FX_INT32 nLimitChar = 0, FX_BOOL bPaint = TRUE); - void SetCharArray(FX_INT32 nCharArray = 0, 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(FX_INT32 nHorzScale = 100, 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); @@ -596,18 +596,18 @@ public: FX_BOOL IsRichText() const; void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE); FX_BOOL SetRichFontSize(FX_FLOAT fFontSize); - FX_BOOL SetRichFontIndex(FX_INT32 nFontIndex); + FX_BOOL SetRichFontIndex(int32_t nFontIndex); FX_BOOL SetRichTextColor(FX_COLORREF dwColor); - FX_BOOL SetRichTextScript(FX_INT32 nScriptType); + 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(FX_INT32 nHorzScale = 100); + FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100); FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading); FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent); - FX_BOOL SetRichTextAlignment(FX_INT32 nAlignment); + 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); @@ -618,24 +618,24 @@ public: void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl); void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl); - void SetText(FX_LPCWSTR text,FX_INT32 charset = DEFAULT_CHARSET, + void SetText(FX_LPCWSTR text,int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); - FX_BOOL InsertWord(FX_WORD word, FX_INT32 charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL); + 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(FX_LPCWSTR text, FX_INT32 charset = DEFAULT_CHARSET, + FX_BOOL InsertText(FX_LPCWSTR text, int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); FX_BOOL Redo(); FX_BOOL Undo(); - CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR text, FX_INT32 charset, + CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR text, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps); - FX_INT32 GetCharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset); + int32_t GetCharSetFromUnicode(FX_WORD word, int32_t nOldCharset); - FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const; - CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const; + int32_t WordPlaceToWordIndex(const CPVT_WordPlace & place) const; + CPVT_WordPlace WordIndexToWordPlace(int32_t index) const; CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const; CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace & place) const; @@ -643,24 +643,24 @@ public: CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace & place) const; CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const; - FX_INT32 GetCaret() const; + int32_t GetCaret() const; CPVT_WordPlace GetCaretWordPlace() const; CFX_WideString GetSelText() const; CFX_WideString GetText() const; FX_FLOAT GetFontSize() const; FX_WORD GetPasswordChar() const; CPDF_Point GetScrollPos() const; - FX_INT32 GetCharArray() const; + int32_t GetCharArray() const; CPDF_Rect GetPlateRect() const; CPDF_Rect GetContentRect() const; CFX_WideString GetRangeText(const CPVT_WordRange & range) const; - FX_INT32 GetHorzScale() const; + int32_t GetHorzScale() const; FX_FLOAT GetCharSpace() const; - FX_INT32 GetTotalWords() const; - FX_INT32 GetTotalLines() const; + int32_t GetTotalWords() const; + int32_t GetTotalLines() const; - void SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar); - void GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const; + void SetSel(int32_t nStartChar,int32_t nEndChar); + void GetSel(int32_t & nStartChar, int32_t & nEndChar) const; private: void SelectAll(); @@ -679,14 +679,14 @@ private: void SetContentChanged(); void EnableNotify(FX_BOOL bNotify); - void SetText(FX_LPCWSTR text,FX_INT32 charset, + void SetText(FX_LPCWSTR text,int32_t charset, const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); - FX_BOOL InsertWord(FX_WORD word, FX_INT32 charset, 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(FX_LPCWSTR text, FX_INT32 charset, + FX_BOOL InsertText(FX_LPCWSTR 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); @@ -708,7 +708,7 @@ private: void RefreshPushRandomRects(const CPVT_WordRange & wr); void RefreshWordRange(const CPVT_WordRange& wr); - void SetCaret(FX_INT32 nPos); + void SetCaret(int32_t nPos); void SetCaret(const CPVT_WordPlace & place); void SetCaretInfo(); void SetCaretOrigin(); @@ -756,7 +756,7 @@ private: CFX_Edit_Refresh m_Refresh; CPDF_Point m_ptCaret; CFX_Edit_Undo m_Undo; - FX_INT32 m_nAlignment; + int32_t m_nAlignment; FX_BOOL m_bNotifyFlag; FX_BOOL m_bEnableOverflow; FX_BOOL m_bEnableRefresh; @@ -785,7 +785,7 @@ public: FX_BOOL GetWord(CPVT_Word & word) const; FX_BOOL GetLine(CPVT_Line & line) const; FX_BOOL GetSection(CPVT_Section & section) const; - void SetAt(FX_INT32 nWordIndex); + void SetAt(int32_t nWordIndex); void SetAt(const CPVT_WordPlace & place); const CPVT_WordPlace & GetAt() const; IFX_Edit* GetEdit() const; @@ -803,11 +803,11 @@ public: IFX_Edit_FontMap* GetFontMap(); - FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle); - FX_INT32 GetTypeAscent(FX_INT32 nFontIndex); - FX_INT32 GetTypeDescent(FX_INT32 nFontIndex); - FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex); - FX_INT32 GetDefaultFontIndex(); + int32_t GetCharWidth(int32_t nFontIndex, FX_WORD word, int32_t nWordStyle); + int32_t GetTypeAscent(int32_t nFontIndex); + int32_t GetTypeDescent(int32_t nFontIndex); + int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex); + int32_t GetDefaultFontIndex(); FX_BOOL IsLatinWord(FX_WORD word); private: diff --git a/fpdfsdk/include/fxedit/fxet_list.h b/fpdfsdk/include/fxedit/fxet_list.h index 5c689ed439..b7888eaf3b 100644 --- a/fpdfsdk/include/fxedit/fxet_list.h +++ b/fpdfsdk/include/fxedit/fxet_list.h @@ -209,8 +209,8 @@ template<class TYPE> class CLST_ArrayTemplate : public CFX_ArrayTemplate<TYPE> { public: FX_BOOL IsEmpty() { return CFX_ArrayTemplate<TYPE>::GetSize() <= 0; } - TYPE GetAt(FX_INT32 nIndex) const { if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) return CFX_ArrayTemplate<TYPE>::GetAt(nIndex); return NULL;} - void RemoveAt(FX_INT32 nIndex){if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex);} + TYPE GetAt(int32_t nIndex) const { if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) return CFX_ArrayTemplate<TYPE>::GetAt(nIndex); return NULL;} + void RemoveAt(int32_t nIndex){if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex);} }; class CFX_List : protected CFX_ListContainer , public IFX_List @@ -227,31 +227,31 @@ public: virtual CPDF_Rect GetContentRect() const; virtual FX_FLOAT GetFontSize() const; - virtual IFX_Edit* GetItemEdit(FX_INT32 nIndex) const; - virtual FX_INT32 GetCount() const; - virtual FX_BOOL IsItemSelected(FX_INT32 nIndex) const; + virtual IFX_Edit* GetItemEdit(int32_t nIndex) const; + virtual int32_t GetCount() const; + virtual FX_BOOL IsItemSelected(int32_t nIndex) const; virtual FX_FLOAT GetFirstHeight() const; virtual void SetMultipleSel(FX_BOOL bMultiple); virtual FX_BOOL IsMultipleSel() const; - virtual FX_BOOL IsValid(FX_INT32 nItemIndex) const; - virtual FX_INT32 FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const; + virtual FX_BOOL IsValid(int32_t nItemIndex) const; + virtual int32_t FindNext(int32_t nIndex,FX_WCHAR nChar) const; protected: virtual void Empty(); void AddItem(FX_LPCWSTR str); - virtual void ReArrange(FX_INT32 nItemIndex); + virtual void ReArrange(int32_t nItemIndex); - virtual CPDF_Rect GetItemRect(FX_INT32 nIndex) const; - CFX_WideString GetItemText(FX_INT32 nIndex) const; + virtual CPDF_Rect GetItemRect(int32_t nIndex) const; + CFX_WideString GetItemText(int32_t nIndex) const; - void SetItemSelect(FX_INT32 nItemIndex, FX_BOOL bSelected); - void SetItemCaret(FX_INT32 nItemIndex, FX_BOOL bCaret); + void SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected); + void SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret); - virtual FX_INT32 GetItemIndex(const CPDF_Point & point) const; - FX_INT32 GetFirstSelected() const; - FX_INT32 GetLastSelected() const; + virtual int32_t GetItemIndex(const CPDF_Point & point) const; + int32_t GetFirstSelected() const; + int32_t GetLastSelected() const; FX_WCHAR Toupper(FX_WCHAR c) const; private: @@ -263,14 +263,14 @@ private: struct CPLST_Select_Item { - CPLST_Select_Item(FX_INT32 nItemIndex,FX_INT32 nState) + CPLST_Select_Item(int32_t nItemIndex,int32_t nState) { this->nItemIndex = nItemIndex; this->nState = nState; } - FX_INT32 nItemIndex; - FX_INT32 nState; //0:normal select -1:to deselect 1: to select + int32_t nItemIndex; + int32_t nState; //0:normal select -1:to deselect 1: to select }; class CPLST_Select @@ -280,15 +280,15 @@ public: virtual ~CPLST_Select(); public: - void Add(FX_INT32 nItemIndex); - void Add(FX_INT32 nBeginIndex, FX_INT32 nEndIndex); - void Sub(FX_INT32 nItemIndex); - void Sub(FX_INT32 nBeginIndex, FX_INT32 nEndIndex); - FX_BOOL IsExist(FX_INT32 nItemIndex) const; - FX_INT32 Find(FX_INT32 nItemIndex) const; - FX_INT32 GetCount() const; - FX_INT32 GetItemIndex(FX_INT32 nIndex) const; - FX_INT32 GetState(FX_INT32 nIndex) const; + void Add(int32_t nItemIndex); + void Add(int32_t nBeginIndex, int32_t nEndIndex); + void Sub(int32_t nItemIndex); + void Sub(int32_t nBeginIndex, int32_t nEndIndex); + FX_BOOL IsExist(int32_t nItemIndex) const; + int32_t Find(int32_t nItemIndex) const; + int32_t GetCount() const; + int32_t GetItemIndex(int32_t nIndex) const; + int32_t GetState(int32_t nIndex) const; void Done(); void DeselectAll(); @@ -313,7 +313,7 @@ public: 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 OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl); + void OnVK(int32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl); FX_BOOL OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl); virtual CPDF_Point InToOut(const CPDF_Point & point) const; @@ -323,41 +323,41 @@ public: virtual void SetPlateRect(const CPDF_Rect & rect); void SetScrollPos(const CPDF_Point & point); - void ScrollToListItem(FX_INT32 nItemIndex); - virtual CPDF_Rect GetItemRect(FX_INT32 nIndex) const; - FX_INT32 GetCaret() const {return m_nCaretIndex;} - FX_INT32 GetSelect() const {return m_nSelItem;} - FX_INT32 GetTopItem() const; + void ScrollToListItem(int32_t nItemIndex); + virtual CPDF_Rect GetItemRect(int32_t nIndex) const; + int32_t GetCaret() const {return m_nCaretIndex;} + int32_t GetSelect() const {return m_nSelItem;} + int32_t GetTopItem() const; virtual CPDF_Rect GetContentRect() const; - virtual FX_INT32 GetItemIndex(const CPDF_Point & point) const; + virtual int32_t GetItemIndex(const CPDF_Point & point) const; void AddString(FX_LPCWSTR string); - void SetTopItem(FX_INT32 nIndex); - void Select(FX_INT32 nItemIndex); - virtual void SetCaret(FX_INT32 nItemIndex); + void SetTopItem(int32_t nIndex); + void Select(int32_t nItemIndex); + virtual void SetCaret(int32_t nItemIndex); virtual void Empty(); virtual void Cancel(); CFX_WideString GetText() const; private: - void SetMultipleSelect(FX_INT32 nItemIndex, FX_BOOL bSelected); - void SetSingleSelect(FX_INT32 nItemIndex); - void InvalidateItem(FX_INT32 nItemIndex); + void SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected); + void SetSingleSelect(int32_t nItemIndex); + void InvalidateItem(int32_t nItemIndex); void SelectItems(); - FX_BOOL IsItemVisible(FX_INT32 nItemIndex) const; + FX_BOOL IsItemVisible(int32_t nItemIndex) const; void SetScrollInfo(); void SetScrollPosY(FX_FLOAT fy); - virtual void ReArrange(FX_INT32 nItemIndex); + virtual void ReArrange(int32_t nItemIndex); private: IFX_List_Notify* m_pNotify; FX_BOOL m_bNotifyFlag; CPDF_Point m_ptScrollPos; CPLST_Select m_aSelItems; //for multiple - FX_INT32 m_nSelItem; //for single - FX_INT32 m_nFootIndex; //for multiple + int32_t m_nSelItem; //for single + int32_t m_nFootIndex; //for multiple FX_BOOL m_bCtrlSel; //for multiple - FX_INT32 m_nCaretIndex; //for multiple + int32_t m_nCaretIndex; //for multiple }; #endif // FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ |