Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: ui/gfx/render_text.h

Issue 2164483006: [MacViews] Implemented text context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/decorated_text_mac.mm ('k') | ui/gfx/render_text.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 const Vector2d& GetUpdatedDisplayOffset(); 520 const Vector2d& GetUpdatedDisplayOffset();
521 void SetDisplayOffset(int horizontal_offset); 521 void SetDisplayOffset(int horizontal_offset);
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 |range| along with its styling information.
537 // |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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 // Lines computed by EnsureLayout. These should be invalidated upon 883 // Lines computed by EnsureLayout. These should be invalidated upon
876 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. 884 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls.
877 std::vector<internal::Line> lines_; 885 std::vector<internal::Line> lines_;
878 886
879 DISALLOW_COPY_AND_ASSIGN(RenderText); 887 DISALLOW_COPY_AND_ASSIGN(RenderText);
880 }; 888 };
881 889
882 } // namespace gfx 890 } // namespace gfx
883 891
884 #endif // UI_GFX_RENDER_TEXT_H_ 892 #endif // UI_GFX_RENDER_TEXT_H_
OLDNEW
« no previous file with comments | « ui/gfx/decorated_text_mac.mm ('k') | ui/gfx/render_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698