| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 bool MoveCursorTo(const gfx::SelectionModel& selection); | 141 bool MoveCursorTo(const gfx::SelectionModel& selection); |
| 142 | 142 |
| 143 // Helper function to call MoveCursorTo on the TextfieldViewsModel. | 143 // Helper function to call MoveCursorTo on the TextfieldViewsModel. |
| 144 bool MoveCursorTo(const gfx::Point& point, bool select); | 144 bool MoveCursorTo(const gfx::Point& point, bool select); |
| 145 | 145 |
| 146 // Selection related method | 146 // Selection related method |
| 147 | 147 |
| 148 // Returns the selected text. | 148 // Returns the selected text. |
| 149 string16 GetSelectedText() const; | 149 string16 GetSelectedText() const; |
| 150 | 150 |
| 151 // Gets the selected range. |
| 152 void GetSelectedRange(ui::Range* range) const; |
| 153 |
| 154 // The current composition text will be confirmed. The selection starts with |
| 155 // the range's start position, and ends with the range's end position, |
| 156 // therefore the cursor position becomes the end position. |
| 157 void SelectRange(const ui::Range& range); |
| 158 |
| 151 void GetSelectionModel(gfx::SelectionModel* sel) const; | 159 void GetSelectionModel(gfx::SelectionModel* sel) const; |
| 152 | 160 |
| 153 // The current composition text will be confirmed. | 161 // The current composition text will be confirmed. |
| 154 // render_text_'s selection model is set to |sel|. | 162 // render_text_'s selection model is set to |sel|. |
| 155 void SelectSelectionModel(const gfx::SelectionModel& sel); | 163 void SelectSelectionModel(const gfx::SelectionModel& sel); |
| 156 | 164 |
| 157 // Selects all text. | 165 // Selects all text. |
| 158 // The current composition text will be confirmed. | 166 // The current composition text will be confirmed. |
| 159 void SelectAll(); | 167 void SelectAll(); |
| 160 | 168 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 // 2) new edit is added. (redo history is cleared) | 324 // 2) new edit is added. (redo history is cleared) |
| 317 // 3) redone all undone edits. | 325 // 3) redone all undone edits. |
| 318 EditHistory::iterator current_edit_; | 326 EditHistory::iterator current_edit_; |
| 319 | 327 |
| 320 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); | 328 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); |
| 321 }; | 329 }; |
| 322 | 330 |
| 323 } // namespace views | 331 } // namespace views |
| 324 | 332 |
| 325 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 333 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
| OLD | NEW |