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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // Moves the cursor to end of the textfield contents. | 174 // Moves the cursor to end of the textfield contents. |
175 // If |select| is true, it updates the selection accordingly. | 175 // If |select| is true, it updates the selection accordingly. |
176 // The current composition text will be confirmed. | 176 // The current composition text will be confirmed. |
177 void MoveCursorToEnd(bool select); | 177 void MoveCursorToEnd(bool select); |
178 | 178 |
179 // Moves the cursor to the specified |position|. | 179 // Moves the cursor to the specified |position|. |
180 // If |select| is true, it updates the selection accordingly. | 180 // If |select| is true, it updates the selection accordingly. |
181 // The current composition text will be confirmed. | 181 // The current composition text will be confirmed. |
182 bool MoveCursorTo(size_t position, bool select); | 182 bool MoveCursorTo(size_t position, bool select); |
183 | 183 |
184 // Returns the bounds of character at the current cursor. | |
185 gfx::Rect GetCursorBounds(const gfx::Font& font) const; | |
186 | |
187 // Returns the bounds of selected text. | 184 // Returns the bounds of selected text. |
188 gfx::Rect GetSelectionBounds(const gfx::Font& font) const; | 185 gfx::Rect GetSelectionBounds(const gfx::Font& font) const; |
189 | 186 |
190 // Selection related method | 187 // Selection related method |
191 | 188 |
192 // Returns the selected text. | 189 // Returns the selected text. |
193 string16 GetSelectedText() const; | 190 string16 GetSelectedText() const; |
194 | 191 |
195 void GetSelectedRange(ui::Range* range) const; | 192 void GetSelectedRange(ui::Range* range) const; |
196 | 193 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 | 401 |
405 // List of style ranges for composition text. | 402 // List of style ranges for composition text. |
406 TextStyleRanges composition_style_ranges_; | 403 TextStyleRanges composition_style_ranges_; |
407 | 404 |
408 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); | 405 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); |
409 }; | 406 }; |
410 | 407 |
411 } // namespace views | 408 } // namespace views |
412 | 409 |
413 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 410 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
OLD | NEW |