Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: ui/views/controls/textfield/textfield.h

Issue 11535014: Replace StyleRange with BreakList; update RenderText, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify OmniboxResultView; Rename StyleBreak; cleanup. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium 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 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "third_party/skia/include/core/SkColor.h" 14 #include "third_party/skia/include/core/SkColor.h"
15 #include "ui/base/ime/text_input_type.h" 15 #include "ui/base/ime/text_input_type.h"
16 #include "ui/base/keycodes/keyboard_codes.h" 16 #include "ui/base/keycodes/keyboard_codes.h"
17 #include "ui/gfx/font.h" 17 #include "ui/gfx/font.h"
18 #include "ui/gfx/native_widget_types.h" 18 #include "ui/gfx/native_widget_types.h"
19 #include "ui/gfx/text_constants.h"
19 #include "ui/views/controls/textfield/native_textfield_wrapper.h" 20 #include "ui/views/controls/textfield/native_textfield_wrapper.h"
20 #include "ui/views/view.h" 21 #include "ui/views/view.h"
21 22
22 #if !defined(OS_LINUX) 23 #if !defined(OS_LINUX)
23 #include "base/logging.h" 24 #include "base/logging.h"
24 #endif 25 #endif
25 26
26 namespace gfx {
27 struct StyleRange;
28 } // namespace gfx
29
30 namespace ui { 27 namespace ui {
31 class Range; 28 class Range;
32 class TextInputClient; 29 class TextInputClient;
33 } // namespace ui 30 } // namespace ui
34 31
35 namespace views { 32 namespace views {
36 33
37 class TextfieldController; 34 class TextfieldController;
38 35
39 // This class implements a View that wraps a native text (edit) field. 36 // This class implements a View that wraps a native text (edit) field.
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 void GetSelectionModel(gfx::SelectionModel* sel) const; 199 void GetSelectionModel(gfx::SelectionModel* sel) const;
203 200
204 // Selects the text given by |sel|. This is views-implementation only and 201 // Selects the text given by |sel|. This is views-implementation only and
205 // has to be called after the wrapper is created. 202 // has to be called after the wrapper is created.
206 void SelectSelectionModel(const gfx::SelectionModel& sel); 203 void SelectSelectionModel(const gfx::SelectionModel& sel);
207 204
208 // Returns the current cursor position. This is views-implementation 205 // Returns the current cursor position. This is views-implementation
209 // only and has to be called after the wrapper is created. 206 // only and has to be called after the wrapper is created.
210 size_t GetCursorPosition() const; 207 size_t GetCursorPosition() const;
211 208
212 // Applies |style| to the text specified by its range. The style will be 209 // Set the text color over the entire text or a logical character range.
213 // ignored if range is empty or invalid. This is views-implementation only and 210 // Empty and invalid ranges are ignored. This is views-implementation only and
214 // has to be called after the wrapper is created. 211 // has to be called after the wrapper is created.
215 void ApplyStyleRange(const gfx::StyleRange& style); 212 void SetColor(SkColor value);
213 void ApplyColor(SkColor value, const ui::Range& range);
216 214
217 // Applies the default style to the textfield. This is views-implementation 215 // Set various text styles over the entire text or a logical character range.
218 // only and has to be called after the wrapper is created. 216 // Empty and invalid ranges are ignored. This is views-implementation only and
219 void ApplyDefaultStyle(); 217 // has to be called after the wrapper is created.
218 void SetStyle(gfx::TextStyle style, bool value);
Alexei Svitkine (slow) 2013/01/22 19:20:21 Please document the |value| parameter better. It w
msw 2013/01/22 22:27:24 Done.
219 void ApplyStyle(gfx::TextStyle style, bool value, const ui::Range& range);
220 220
221 // Clears Edit history. 221 // Clears Edit history.
222 void ClearEditHistory(); 222 void ClearEditHistory();
223 223
224 // Set the accessible name of the text field. 224 // Set the accessible name of the text field.
225 void SetAccessibleName(const string16& name); 225 void SetAccessibleName(const string16& name);
226 226
227 // Performs the action associated with the specified command id. 227 // Performs the action associated with the specified command id.
228 void ExecuteCommand(int command_id); 228 void ExecuteCommand(int command_id);
229 229
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 322
323 // The input type of this text field. 323 // The input type of this text field.
324 ui::TextInputType text_input_type_; 324 ui::TextInputType text_input_type_;
325 325
326 DISALLOW_COPY_AND_ASSIGN(Textfield); 326 DISALLOW_COPY_AND_ASSIGN(Textfield);
327 }; 327 };
328 328
329 } // namespace views 329 } // namespace views
330 330
331 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 331 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698