OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 5 #ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <vector> | 10 #include <vector> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 // Cursor related methods. | 126 // Cursor related methods. |
127 | 127 |
128 // Returns the current cursor position. | 128 // Returns the current cursor position. |
129 size_t GetCursorPosition() const; | 129 size_t GetCursorPosition() const; |
130 | 130 |
131 // Moves the cursor, see RenderText for additional details. | 131 // Moves the cursor, see RenderText for additional details. |
132 // The current composition text will be confirmed. | 132 // The current composition text will be confirmed. |
133 void MoveCursorLeft(gfx::BreakType break_type, bool select); | 133 void MoveCursorLeft(gfx::BreakType break_type, bool select); |
134 void MoveCursorRight(gfx::BreakType break_type, bool select); | 134 void MoveCursorRight(gfx::BreakType break_type, bool select); |
135 | 135 |
136 // Moves the cursor to the specified |position|. | 136 // Moves the cursor to the specified |position|. |
msw
2011/08/01 05:02:23
Comment needs updating at the very least.
| |
137 // If |select| is true, it updates the selection accordingly. | 137 // If |select| is true, it updates the selection accordingly. |
138 // The current composition text will be confirmed. | 138 // The current composition text will be confirmed. |
139 bool MoveCursorTo(size_t position, bool select); | 139 bool MoveCursorTo(const gfx::SelectionModel& selection, bool select); |
140 | 140 |
141 // Helper function to call MoveCursorTo on the TextfieldViewsModel. | 141 // Helper function to call MoveCursorTo on the TextfieldViewsModel. |
142 bool MoveCursorTo(const gfx::Point& point, bool select); | 142 bool MoveCursorTo(const gfx::Point& point, bool select); |
143 | 143 |
144 // Returns the bounds of selected text. | 144 // Returns the bounds of selected text. |
145 std::vector<gfx::Rect> GetSelectionBounds() const; | 145 std::vector<gfx::Rect> GetSelectionBounds() const; |
146 | 146 |
147 // Selection related method | 147 // Selection related method |
148 | 148 |
149 // Returns the selected text. | 149 // Returns the selected text. |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 // 2) new edit is added. (redo history is cleared) | 319 // 2) new edit is added. (redo history is cleared) |
320 // 3) redone all undone edits. | 320 // 3) redone all undone edits. |
321 EditHistory::iterator current_edit_; | 321 EditHistory::iterator current_edit_; |
322 | 322 |
323 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); | 323 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); |
324 }; | 324 }; |
325 | 325 |
326 } // namespace views | 326 } // namespace views |
327 | 327 |
328 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 328 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
OLD | NEW |