blob: b1dc79cfc7a285ddb4ff7e328d98f59a288b650f [file] [log] [blame]
Tom Sepez99ffdb02016-01-26 14:51:21 -08001// 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
Tom Sepezab277682016-02-17 10:07:21 -08007#ifndef FWL_LIGHTWIDGET_EDIT_H_
8#define FWL_LIGHTWIDGET_EDIT_H_
9
10#include <vector>
11
12#include "xfa/include/fwl/lightwidget/widget.h"
13
Tom Sepez99ffdb02016-01-26 14:51:21 -080014class CFWL_WidgetProperties;
Tom Sepezab277682016-02-17 10:07:21 -080015
Tom Sepez99ffdb02016-01-26 14:51:21 -080016class CFWL_Edit : public CFWL_Widget {
17 public:
18 static CFWL_Edit* Create();
19 FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
20 FWL_ERR SetText(const CFX_WideString& wsText);
21 int32_t GetTextLength() const;
22 FWL_ERR GetText(CFX_WideString& wsText,
23 int32_t nStart = 0,
24 int32_t nCount = -1) const;
25 FWL_ERR ClearText();
26 int32_t GetCaretPos() const;
27 int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE);
28 FWL_ERR AddSelRange(int32_t nStart, int32_t nCount = -1);
29 int32_t CountSelRanges();
30 int32_t GetSelRange(int32_t nIndex, int32_t& nStart);
31 FWL_ERR ClearSelections();
32 int32_t GetLimit();
33 FWL_ERR SetLimit(int32_t nLimit);
34 FWL_ERR SetAliasChar(FX_WCHAR wAlias);
35 FWL_ERR SetFormatString(const CFX_WideString& wsFormat);
36 FWL_ERR Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLen);
37 FWL_ERR DeleteSelections();
38 FWL_ERR DeleteRange(int32_t nStart, int32_t nCount = -1);
39 FWL_ERR ReplaceSelections(const CFX_WideStringC& wsReplace);
40 FWL_ERR Replace(int32_t nStart,
41 int32_t nLen,
42 const CFX_WideStringC& wsReplace);
43 FWL_ERR DoClipboard(int32_t iCmd);
44 FX_BOOL Redo(const CFX_ByteStringC& bsRecord);
45 FX_BOOL Undo(const CFX_ByteStringC& bsRecord);
46 FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant);
47 FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax);
48 FWL_ERR SetBackColor(FX_DWORD dwColor);
49 FWL_ERR SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize);
50 FX_BOOL CanUndo();
51 FX_BOOL CanRedo();
52 FX_BOOL Undo();
53 FX_BOOL Redo();
54 FX_BOOL Copy(CFX_WideString& wsCopy);
55 FX_BOOL Cut(CFX_WideString& wsCut);
56 FX_BOOL Paste(const CFX_WideString& wsPaste);
57 FX_BOOL Delete();
58 void SetScrollOffset(FX_FLOAT fScrollOffset);
Tom Sepezab277682016-02-17 10:07:21 -080059 FX_BOOL GetSuggestWords(CFX_PointF pointf,
60 std::vector<CFX_ByteString>& sSuggest);
Tom Sepez99ffdb02016-01-26 14:51:21 -080061 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf,
62 const CFX_ByteStringC& bsReplace);
63 CFWL_Edit();
64 virtual ~CFWL_Edit();
65};
Tom Sepezab277682016-02-17 10:07:21 -080066
67#endif // FWL_LIGHTWIDGET_EDIT_H_