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