| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef XFA_FWL_LIGHTWIDGET_CFWL_EDIT_H_ | 7 #ifndef XFA_FWL_LIGHTWIDGET_CFWL_EDIT_H_ |
| 8 #define XFA_FWL_LIGHTWIDGET_CFWL_EDIT_H_ | 8 #define XFA_FWL_LIGHTWIDGET_CFWL_EDIT_H_ |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "xfa/fwl/lightwidget/cfwl_widget.h" | 12 #include "xfa/fwl/lightwidget/cfwl_widget.h" |
| 13 | 13 |
| 14 class CFWL_WidgetProperties; | 14 class CFWL_WidgetProperties; |
| 15 class IFDE_TxtEdtDoRecord; |
| 15 | 16 |
| 16 class CFWL_Edit : public CFWL_Widget { | 17 class CFWL_Edit : public CFWL_Widget { |
| 17 public: | 18 public: |
| 18 static CFWL_Edit* Create(); | 19 static CFWL_Edit* Create(); |
| 19 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); | 20 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); |
| 20 FWL_Error SetText(const CFX_WideString& wsText); | 21 FWL_Error SetText(const CFX_WideString& wsText); |
| 21 int32_t GetTextLength() const; | 22 int32_t GetTextLength() const; |
| 22 FWL_Error GetText(CFX_WideString& wsText, | 23 FWL_Error GetText(CFX_WideString& wsText, |
| 23 int32_t nStart = 0, | 24 int32_t nStart = 0, |
| 24 int32_t nCount = -1) const; | 25 int32_t nCount = -1) const; |
| 25 FWL_Error ClearText(); | 26 FWL_Error ClearText(); |
| 26 int32_t GetCaretPos() const; | 27 int32_t GetCaretPos() const; |
| 27 int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE); | 28 int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE); |
| 28 int32_t AddSelRange(int32_t nStart, int32_t nCount = -1); | 29 int32_t AddSelRange(int32_t nStart, int32_t nCount = -1); |
| 29 int32_t CountSelRanges(); | 30 int32_t CountSelRanges(); |
| 30 int32_t GetSelRange(int32_t nIndex, int32_t& nStart); | 31 int32_t GetSelRange(int32_t nIndex, int32_t& nStart); |
| 31 FWL_Error ClearSelections(); | 32 FWL_Error ClearSelections(); |
| 32 int32_t GetLimit(); | 33 int32_t GetLimit(); |
| 33 FWL_Error SetLimit(int32_t nLimit); | 34 FWL_Error SetLimit(int32_t nLimit); |
| 34 FWL_Error SetAliasChar(FX_WCHAR wAlias); | 35 FWL_Error SetAliasChar(FX_WCHAR wAlias); |
| 35 FWL_Error SetFormatString(const CFX_WideString& wsFormat); | 36 FWL_Error SetFormatString(const CFX_WideString& wsFormat); |
| 36 FWL_Error Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLen); | 37 FWL_Error Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLen); |
| 37 FWL_Error DeleteSelections(); | 38 FWL_Error DeleteSelections(); |
| 38 FWL_Error DeleteRange(int32_t nStart, int32_t nCount = -1); | 39 FWL_Error DeleteRange(int32_t nStart, int32_t nCount = -1); |
| 39 FWL_Error Replace(int32_t nStart, | 40 FWL_Error Replace(int32_t nStart, |
| 40 int32_t nLen, | 41 int32_t nLen, |
| 41 const CFX_WideStringC& wsReplace); | 42 const CFX_WideStringC& wsReplace); |
| 42 FWL_Error DoClipboard(int32_t iCmd); | 43 FWL_Error DoClipboard(int32_t iCmd); |
| 43 FX_BOOL Redo(const CFX_ByteStringC& bsRecord); | 44 FX_BOOL Redo(const IFDE_TxtEdtDoRecord* pRecord); |
| 44 FX_BOOL Undo(const CFX_ByteStringC& bsRecord); | 45 FX_BOOL Undo(const IFDE_TxtEdtDoRecord* pRecord); |
| 45 FWL_Error SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); | 46 FWL_Error SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); |
| 46 FWL_Error SetNumberRange(int32_t iMin, int32_t iMax); | 47 FWL_Error SetNumberRange(int32_t iMin, int32_t iMax); |
| 47 FWL_Error SetBackColor(uint32_t dwColor); | 48 FWL_Error SetBackColor(uint32_t dwColor); |
| 48 FWL_Error SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); | 49 FWL_Error SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); |
| 49 FX_BOOL CanUndo(); | 50 FX_BOOL CanUndo(); |
| 50 FX_BOOL CanRedo(); | 51 FX_BOOL CanRedo(); |
| 51 FX_BOOL Undo(); | 52 FX_BOOL Undo(); |
| 52 FX_BOOL Redo(); | 53 FX_BOOL Redo(); |
| 53 FX_BOOL Copy(CFX_WideString& wsCopy); | 54 FX_BOOL Copy(CFX_WideString& wsCopy); |
| 54 FX_BOOL Cut(CFX_WideString& wsCut); | 55 FX_BOOL Cut(CFX_WideString& wsCut); |
| 55 FX_BOOL Paste(const CFX_WideString& wsPaste); | 56 FX_BOOL Paste(const CFX_WideString& wsPaste); |
| 56 FX_BOOL Delete(); | 57 FX_BOOL Delete(); |
| 57 void SetScrollOffset(FX_FLOAT fScrollOffset); | 58 void SetScrollOffset(FX_FLOAT fScrollOffset); |
| 58 FX_BOOL GetSuggestWords(CFX_PointF pointf, | 59 FX_BOOL GetSuggestWords(CFX_PointF pointf, |
| 59 std::vector<CFX_ByteString>& sSuggest); | 60 std::vector<CFX_ByteString>& sSuggest); |
| 60 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, | 61 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, |
| 61 const CFX_ByteStringC& bsReplace); | 62 const CFX_ByteStringC& bsReplace); |
| 62 CFWL_Edit(); | 63 CFWL_Edit(); |
| 63 virtual ~CFWL_Edit(); | 64 virtual ~CFWL_Edit(); |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 #endif // XFA_FWL_LIGHTWIDGET_CFWL_EDIT_H_ | 67 #endif // XFA_FWL_LIGHTWIDGET_CFWL_EDIT_H_ |
| OLD | NEW |