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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 | 518 |
519 // Retrieves the word displayed at the given |point| along with its styling | 519 // Retrieves the word displayed at the given |point| along with its styling |
520 // information. |point| is in the view's coordinates. If no word is displayed | 520 // information. |point| is in the view's coordinates. If no word is displayed |
521 // at the point, returns a nearby word. |baseline_point| should correspond to | 521 // at the point, returns a nearby word. |baseline_point| should correspond to |
522 // the baseline point of the leftmost glyph of the |word| in the view's | 522 // the baseline point of the leftmost glyph of the |word| in the view's |
523 // coordinates. Returns false, if no word can be retrieved. | 523 // coordinates. Returns false, if no word can be retrieved. |
524 bool GetDecoratedWordAtPoint(const Point& point, | 524 bool GetDecoratedWordAtPoint(const Point& point, |
525 DecoratedText* decorated_word, | 525 DecoratedText* decorated_word, |
526 Point* baseline_point); | 526 Point* baseline_point); |
527 | 527 |
| 528 // Retrieves the text at the given |range| along with its styling |
| 529 // information. |baseline_point| should correspond to the baseline point of |
| 530 // the leftmost glyph of the |word| in the view's coordinates. Returns |
| 531 // false, if no word can be retrieved. |
| 532 bool GetDecoratedTextAndBaselineForRange(const Range& range, |
| 533 DecoratedText* decorated_text, |
| 534 Point* baseline_point); |
| 535 |
528 // Retrieves the text in the given |range|. | 536 // Retrieves the text in the given |range|. |
529 base::string16 GetTextFromRange(const Range& range) const; | 537 base::string16 GetTextFromRange(const Range& range) const; |
530 | 538 |
531 protected: | 539 protected: |
532 RenderText(); | 540 RenderText(); |
533 | 541 |
534 // NOTE: The value of these accessors may be stale. Please make sure | 542 // NOTE: The value of these accessors may be stale. Please make sure |
535 // that these fields are up to date before accessing them. | 543 // that these fields are up to date before accessing them. |
536 const base::string16& layout_text() const { return layout_text_; } | 544 const base::string16& layout_text() const { return layout_text_; } |
537 const base::string16& display_text() const { return display_text_; } | 545 const base::string16& display_text() const { return display_text_; } |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 // Lines computed by EnsureLayout. These should be invalidated upon | 869 // Lines computed by EnsureLayout. These should be invalidated upon |
862 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. | 870 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. |
863 std::vector<internal::Line> lines_; | 871 std::vector<internal::Line> lines_; |
864 | 872 |
865 DISALLOW_COPY_AND_ASSIGN(RenderText); | 873 DISALLOW_COPY_AND_ASSIGN(RenderText); |
866 }; | 874 }; |
867 | 875 |
868 } // namespace gfx | 876 } // namespace gfx |
869 | 877 |
870 #endif // UI_GFX_RENDER_TEXT_H_ | 878 #endif // UI_GFX_RENDER_TEXT_H_ |
OLD | NEW |