| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 | 522 |
| 523 // Returns the line offset from the origin after applying the text alignment | 523 // Returns the line offset from the origin after applying the text alignment |
| 524 // and the display offset. | 524 // and the display offset. |
| 525 Vector2d GetLineOffset(size_t line_number); | 525 Vector2d GetLineOffset(size_t line_number); |
| 526 | 526 |
| 527 // Retrieves the word displayed at the given |point| along with its styling | 527 // Retrieves the word displayed at the given |point| along with its styling |
| 528 // information. |point| is in the view's coordinates. If no word is displayed | 528 // information. |point| is in the view's coordinates. If no word is displayed |
| 529 // at the point, returns a nearby word. |baseline_point| should correspond to | 529 // at the point, returns a nearby word. |baseline_point| should correspond to |
| 530 // the baseline point of the leftmost glyph of the |word| in the view's | 530 // the baseline point of the leftmost glyph of the |word| in the view's |
| 531 // coordinates. Returns false, if no word can be retrieved. | 531 // coordinates. Returns false, if no word can be retrieved. |
| 532 bool GetDecoratedWordAtPoint(const Point& point, | 532 bool GetDecoratedWordAndBaselineAtPoint(const Point& point, |
| 533 DecoratedText* decorated_word, | 533 DecoratedText* decorated_word, |
| 534 Point* baseline_point); | 534 Point* baseline_point); |
| 535 |
| 536 // Retrieves the text at the given |range| along with its styling |
| 537 // information. |baseline_point| should correspond to the baseline point of |
| 538 // the leftmost glyph of the |word| in the view's coordinates. Returns |
| 539 // false, if no word can be retrieved. |
| 540 bool GetDecoratedTextAndBaselineForRange(const Range& range, |
| 541 DecoratedText* decorated_text, |
| 542 Point* baseline_point); |
| 535 | 543 |
| 536 // Retrieves the text in the given |range|. | 544 // Retrieves the text in the given |range|. |
| 537 base::string16 GetTextFromRange(const Range& range) const; | 545 base::string16 GetTextFromRange(const Range& range) const; |
| 538 | 546 |
| 539 protected: | 547 protected: |
| 540 RenderText(); | 548 RenderText(); |
| 541 | 549 |
| 542 // NOTE: The value of these accessors may be stale. Please make sure | 550 // NOTE: The value of these accessors may be stale. Please make sure |
| 543 // that these fields are up to date before accessing them. | 551 // that these fields are up to date before accessing them. |
| 544 const base::string16& layout_text() const { return layout_text_; } | 552 const base::string16& layout_text() const { return layout_text_; } |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 // Lines computed by EnsureLayout. These should be invalidated upon | 878 // Lines computed by EnsureLayout. These should be invalidated upon |
| 871 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. | 879 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. |
| 872 std::vector<internal::Line> lines_; | 880 std::vector<internal::Line> lines_; |
| 873 | 881 |
| 874 DISALLOW_COPY_AND_ASSIGN(RenderText); | 882 DISALLOW_COPY_AND_ASSIGN(RenderText); |
| 875 }; | 883 }; |
| 876 | 884 |
| 877 } // namespace gfx | 885 } // namespace gfx |
| 878 | 886 |
| 879 #endif // UI_GFX_RENDER_TEXT_H_ | 887 #endif // UI_GFX_RENDER_TEXT_H_ |
| OLD | NEW |