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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 const SelectionModel& selection, | 361 const SelectionModel& selection, |
362 VisualCursorDirection direction) = 0; | 362 VisualCursorDirection direction) = 0; |
363 | 363 |
364 // Get the SelectionModels corresponding to visual text ends. | 364 // Get the SelectionModels corresponding to visual text ends. |
365 // The returned value represents a cursor/caret position without a selection. | 365 // The returned value represents a cursor/caret position without a selection. |
366 SelectionModel EdgeSelectionModel(VisualCursorDirection direction); | 366 SelectionModel EdgeSelectionModel(VisualCursorDirection direction); |
367 | 367 |
368 // Sets the selection model, the argument is assumed to be valid. | 368 // Sets the selection model, the argument is assumed to be valid. |
369 virtual void SetSelectionModel(const SelectionModel& model); | 369 virtual void SetSelectionModel(const SelectionModel& model); |
370 | 370 |
371 // Get the height and horizontal bounds (relative to the left of the text, not | 371 // Get the horizontal bounds (relative to the left of the text, not the view) |
372 // the view) of the glyph starting at |index|. If the glyph is RTL then | 372 // of the glyph starting at |index|. If the glyph is RTL then the returned |
373 // xspan->is_reversed(). This does not return a Rect because a Rect can't have | 373 // Range will have is_reversed() true. (This does not return a Rect because a |
374 // a negative width. | 374 // Rect can't have a negative width.) |
375 virtual void GetGlyphBounds(size_t index, ui::Range* xspan, int* height) = 0; | 375 virtual ui::Range GetGlyphBounds(size_t index) = 0; |
376 | 376 |
377 // Get the visual bounds containing the logical substring within the |range|. | 377 // Get the visual bounds containing the logical substring within the |range|. |
378 // If |range| is empty, the result is empty. These bounds could be visually | 378 // If |range| is empty, the result is empty. These bounds could be visually |
379 // discontinuous if the substring is split by a LTR/RTL level change. | 379 // discontinuous if the substring is split by a LTR/RTL level change. |
380 // These bounds are in local coordinates, but may be outside the visible | 380 // These bounds are in local coordinates, but may be outside the visible |
381 // region if the text is longer than the textfield. Subsequent text, cursor, | 381 // region if the text is longer than the textfield. Subsequent text, cursor, |
382 // or bounds changes may invalidate returned values. | 382 // or bounds changes may invalidate returned values. |
383 virtual std::vector<Rect> GetSubstringBounds(const ui::Range& range) = 0; | 383 virtual std::vector<Rect> GetSubstringBounds(const ui::Range& range) = 0; |
384 | 384 |
385 // Convert between indices into |text_| and indices into |obscured_text_|, | 385 // Convert between indices into |text_| and indices into |obscured_text_|, |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 | 556 |
557 // Text shadows to be drawn. | 557 // Text shadows to be drawn. |
558 ShadowValues text_shadows_; | 558 ShadowValues text_shadows_; |
559 | 559 |
560 DISALLOW_COPY_AND_ASSIGN(RenderText); | 560 DISALLOW_COPY_AND_ASSIGN(RenderText); |
561 }; | 561 }; |
562 | 562 |
563 } // namespace gfx | 563 } // namespace gfx |
564 | 564 |
565 #endif // UI_GFX_RENDER_TEXT_H_ | 565 #endif // UI_GFX_RENDER_TEXT_H_ |
OLD | NEW |