OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MODEL_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ |
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ | 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // If there is composition text, it'll be deleted instead. | 111 // If there is composition text, it'll be deleted instead. |
112 bool Backspace(bool add_to_kill_buffer = false); | 112 bool Backspace(bool add_to_kill_buffer = false); |
113 | 113 |
114 // Cursor related methods. | 114 // Cursor related methods. |
115 | 115 |
116 // Returns the current cursor position. | 116 // Returns the current cursor position. |
117 size_t GetCursorPosition() const; | 117 size_t GetCursorPosition() const; |
118 | 118 |
119 // Moves the cursor, see RenderText for additional details. | 119 // Moves the cursor, see RenderText for additional details. |
120 // The current composition text will be confirmed. | 120 // The current composition text will be confirmed. |
121 void MoveCursor(gfx::BreakType break_type, | 121 void MoveCursor( |
122 gfx::VisualCursorDirection direction, | 122 gfx::BreakType break_type, |
123 bool select); | 123 gfx::VisualCursorDirection direction, |
| 124 bool select, |
| 125 gfx::SelectionReversedBehavior select_behavior = gfx::SELECTION_DEFAULT); |
124 | 126 |
125 // Updates the cursor to the specified selection model. Any composition text | 127 // Updates the cursor to the specified selection model. Any composition text |
126 // will be confirmed, which may alter the specified selection range start. | 128 // will be confirmed, which may alter the specified selection range start. |
127 bool MoveCursorTo(const gfx::SelectionModel& cursor); | 129 bool MoveCursorTo(const gfx::SelectionModel& cursor); |
128 | 130 |
129 // Helper function to call MoveCursorTo on the TextfieldModel. | 131 // Helper function to call MoveCursorTo on the TextfieldModel. |
130 bool MoveCursorTo(const gfx::Point& point, bool select); | 132 bool MoveCursorTo(const gfx::Point& point, bool select); |
131 | 133 |
132 // Selection related methods. | 134 // Selection related methods. |
133 | 135 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 // 2) new edit is added. (redo history is cleared) | 312 // 2) new edit is added. (redo history is cleared) |
311 // 3) redone all undone edits. | 313 // 3) redone all undone edits. |
312 EditHistory::iterator current_edit_; | 314 EditHistory::iterator current_edit_; |
313 | 315 |
314 DISALLOW_COPY_AND_ASSIGN(TextfieldModel); | 316 DISALLOW_COPY_AND_ASSIGN(TextfieldModel); |
315 }; | 317 }; |
316 | 318 |
317 } // namespace views | 319 } // namespace views |
318 | 320 |
319 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ | 321 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ |
OLD | NEW |