OLD | NEW |
| (Empty) |
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 XFA_FWL_LIGHTWIDGET_CFWL_EDIT_H_ | |
8 #define XFA_FWL_LIGHTWIDGET_CFWL_EDIT_H_ | |
9 | |
10 #include <vector> | |
11 | |
12 #include "xfa/fwl/core/ifwl_edit.h" | |
13 #include "xfa/fwl/lightwidget/cfwl_widget.h" | |
14 | |
15 class CFWL_WidgetProperties; | |
16 class IFDE_TxtEdtDoRecord; | |
17 | |
18 class CFWL_Edit : public CFWL_Widget { | |
19 public: | |
20 CFWL_Edit(); | |
21 ~CFWL_Edit() override; | |
22 | |
23 IFWL_Edit* GetWidget() override; | |
24 const IFWL_Edit* GetWidget() const override; | |
25 | |
26 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); | |
27 FWL_Error SetText(const CFX_WideString& wsText); | |
28 int32_t GetTextLength() const; | |
29 FWL_Error GetText(CFX_WideString& wsText, | |
30 int32_t nStart = 0, | |
31 int32_t nCount = -1) const; | |
32 FWL_Error ClearText(); | |
33 int32_t GetCaretPos() const; | |
34 int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE); | |
35 int32_t AddSelRange(int32_t nStart, int32_t nCount = -1); | |
36 int32_t CountSelRanges(); | |
37 int32_t GetSelRange(int32_t nIndex, int32_t& nStart); | |
38 FWL_Error ClearSelections(); | |
39 int32_t GetLimit(); | |
40 FWL_Error SetLimit(int32_t nLimit); | |
41 FWL_Error SetAliasChar(FX_WCHAR wAlias); | |
42 FWL_Error SetFormatString(const CFX_WideString& wsFormat); | |
43 FWL_Error Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLen); | |
44 FWL_Error DeleteSelections(); | |
45 FWL_Error DeleteRange(int32_t nStart, int32_t nCount = -1); | |
46 FWL_Error Replace(int32_t nStart, | |
47 int32_t nLen, | |
48 const CFX_WideStringC& wsReplace); | |
49 FWL_Error DoClipboard(int32_t iCmd); | |
50 FX_BOOL Redo(const IFDE_TxtEdtDoRecord* pRecord); | |
51 FX_BOOL Undo(const IFDE_TxtEdtDoRecord* pRecord); | |
52 FWL_Error SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); | |
53 FWL_Error SetNumberRange(int32_t iMin, int32_t iMax); | |
54 FWL_Error SetBackColor(uint32_t dwColor); | |
55 FWL_Error SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); | |
56 FX_BOOL CanUndo(); | |
57 FX_BOOL CanRedo(); | |
58 FX_BOOL Undo(); | |
59 FX_BOOL Redo(); | |
60 FX_BOOL Copy(CFX_WideString& wsCopy); | |
61 FX_BOOL Cut(CFX_WideString& wsCut); | |
62 FX_BOOL Paste(const CFX_WideString& wsPaste); | |
63 FX_BOOL Delete(); | |
64 void SetScrollOffset(FX_FLOAT fScrollOffset); | |
65 FX_BOOL GetSuggestWords(CFX_PointF pointf, | |
66 std::vector<CFX_ByteString>& sSuggest); | |
67 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, | |
68 const CFX_ByteStringC& bsReplace); | |
69 }; | |
70 | |
71 #endif // XFA_FWL_LIGHTWIDGET_CFWL_EDIT_H_ | |
OLD | NEW |