| OLD | NEW |
| 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_GFX_RENDER_TEXT_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_H_ |
| 6 #define UI_GFX_RENDER_TEXT_H_ | 6 #define UI_GFX_RENDER_TEXT_H_ |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <cstring> | 9 #include <cstring> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 // Set the selection_model_ based on |range|. | 219 // Set the selection_model_ based on |range|. |
| 220 // If the |range| start or end is greater than text length, it is modified | 220 // If the |range| start or end is greater than text length, it is modified |
| 221 // to be the text length. | 221 // to be the text length. |
| 222 // If the |range| start or end is not a cursorable position (not on grapheme | 222 // If the |range| start or end is not a cursorable position (not on grapheme |
| 223 // boundary), it is a NO-OP and returns false. Otherwise, returns true. | 223 // boundary), it is a NO-OP and returns false. Otherwise, returns true. |
| 224 bool SelectRange(const ui::Range& range); | 224 bool SelectRange(const ui::Range& range); |
| 225 | 225 |
| 226 // Returns true if the local point is over selected text. | 226 // Returns true if the local point is over selected text. |
| 227 bool IsPointInSelection(const Point& point); | 227 bool IsPointInSelection(const Point& point); |
| 228 | 228 |
| 229 // Selects no text, all text, or the word at the current cursor position. | 229 // Selects no text, keeping the current cursor position and caret affinity. |
| 230 void ClearSelection(); | 230 void ClearSelection(); |
| 231 void SelectAll(); | 231 |
| 232 // Select the entire text range. If |reversed| is true, the range will end at |
| 233 // the logical beginning of the text; this generally shows the leading portion |
| 234 // of text that overflows its display area. |
| 235 void SelectAll(bool reversed); |
| 236 |
| 237 // Selects the word at the current cursor position. |
| 232 void SelectWord(); | 238 void SelectWord(); |
| 233 | 239 |
| 234 const ui::Range& GetCompositionRange() const; | 240 const ui::Range& GetCompositionRange() const; |
| 235 void SetCompositionRange(const ui::Range& composition_range); | 241 void SetCompositionRange(const ui::Range& composition_range); |
| 236 | 242 |
| 237 // Apply |style_range| to the internal style model. | 243 // Apply |style_range| to the internal style model. |
| 238 void ApplyStyleRange(const StyleRange& style_range); | 244 void ApplyStyleRange(const StyleRange& style_range); |
| 239 | 245 |
| 240 // Apply |default_style_| over the entire text range. | 246 // Apply |default_style_| over the entire text range. |
| 241 void ApplyDefaultStyle(); | 247 void ApplyDefaultStyle(); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 | 508 |
| 503 // Text shadows to be drawn. | 509 // Text shadows to be drawn. |
| 504 ShadowValues text_shadows_; | 510 ShadowValues text_shadows_; |
| 505 | 511 |
| 506 DISALLOW_COPY_AND_ASSIGN(RenderText); | 512 DISALLOW_COPY_AND_ASSIGN(RenderText); |
| 507 }; | 513 }; |
| 508 | 514 |
| 509 } // namespace gfx | 515 } // namespace gfx |
| 510 | 516 |
| 511 #endif // UI_GFX_RENDER_TEXT_H_ | 517 #endif // UI_GFX_RENDER_TEXT_H_ |
| OLD | NEW |