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 _FWL_EDIT_H | 7 #ifndef _FWL_EDIT_H |
8 #define _FWL_EDIT_H | 8 #define _FWL_EDIT_H |
9 class CFWL_WidgetImpProperties; | 9 class CFWL_WidgetImpProperties; |
10 class IFWL_Widget; | 10 class IFWL_Widget; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 CFX_ByteStringArray bsArraySuggestWords; | 105 CFX_ByteStringArray bsArraySuggestWords; |
106 END_FWL_EVENT_DEF | 106 END_FWL_EVENT_DEF |
107 class IFWL_EditDP : public IFWL_DataProvider {}; | 107 class IFWL_EditDP : public IFWL_DataProvider {}; |
108 #define FWL_EDT_FIND_FLAGS_Prev (0L << 0) | 108 #define FWL_EDT_FIND_FLAGS_Prev (0L << 0) |
109 #define FWL_EDT_FIND_FLAGS_Next (1L << 0) | 109 #define FWL_EDT_FIND_FLAGS_Next (1L << 0) |
110 #define FWL_EDT_FIND_FLAGS_WholeWord (1L << 1) | 110 #define FWL_EDT_FIND_FLAGS_WholeWord (1L << 1) |
111 #define FWL_EDT_FIND_FLAGS_NoCase (1L << 2) | 111 #define FWL_EDT_FIND_FLAGS_NoCase (1L << 2) |
112 typedef struct _FWL_HEDTFIND { void* pData; } * FWL_HEDTFIND; | 112 typedef struct _FWL_HEDTFIND { void* pData; } * FWL_HEDTFIND; |
113 class IFWL_Edit : public IFWL_Widget { | 113 class IFWL_Edit : public IFWL_Widget { |
114 public: | 114 public: |
115 IFWL_Edit(); | 115 static IFWL_Edit* Create(const CFWL_WidgetImpProperties& properties, |
| 116 IFWL_Widget* pOuter); |
| 117 static IFWL_Edit* CreateComboEdit(const CFWL_WidgetImpProperties& properties, |
| 118 IFWL_Widget* pOuter); |
116 | 119 |
117 FWL_ERR Initialize(const CFWL_WidgetImpProperties& properties, | |
118 IFWL_Widget* pOuter); | |
119 FWL_ERR SetText(const CFX_WideString& wsText); | 120 FWL_ERR SetText(const CFX_WideString& wsText); |
120 int32_t GetTextLength() const; | 121 int32_t GetTextLength() const; |
121 FWL_ERR GetText(CFX_WideString& wsText, | 122 FWL_ERR GetText(CFX_WideString& wsText, |
122 int32_t nStart = 0, | 123 int32_t nStart = 0, |
123 int32_t nCount = -1) const; | 124 int32_t nCount = -1) const; |
124 FWL_ERR ClearText(); | 125 FWL_ERR ClearText(); |
125 int32_t GetCaretPos() const; | 126 int32_t GetCaretPos() const; |
126 int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE); | 127 int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE); |
127 FWL_ERR AddSelRange(int32_t nStart, int32_t nCount = -1); | 128 FWL_ERR AddSelRange(int32_t nStart, int32_t nCount = -1); |
128 int32_t CountSelRanges(); | 129 int32_t CountSelRanges(); |
(...skipping 23 matching lines...) Expand all Loading... |
152 FX_BOOL CanRedo(); | 153 FX_BOOL CanRedo(); |
153 FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); | 154 FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); |
154 FWL_ERR SetOuter(IFWL_Widget* pOuter); | 155 FWL_ERR SetOuter(IFWL_Widget* pOuter); |
155 FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax); | 156 FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax); |
156 FWL_ERR SetBackColor(FX_DWORD dwColor); | 157 FWL_ERR SetBackColor(FX_DWORD dwColor); |
157 FWL_ERR SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); | 158 FWL_ERR SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); |
158 void SetScrollOffset(FX_FLOAT fScrollOffset); | 159 void SetScrollOffset(FX_FLOAT fScrollOffset); |
159 FX_BOOL GetSuggestWords(CFX_PointF pointf, CFX_ByteStringArray& sSuggest); | 160 FX_BOOL GetSuggestWords(CFX_PointF pointf, CFX_ByteStringArray& sSuggest); |
160 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, | 161 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, |
161 const CFX_ByteStringC& bsReplace); | 162 const CFX_ByteStringC& bsReplace); |
| 163 |
| 164 protected: |
| 165 IFWL_Edit(); |
162 }; | 166 }; |
163 #endif | 167 #endif |
OLD | NEW |