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

Unified Diff: ui/gfx/render_text.h

Issue 23228004: Prepare to use gfx::RenderText in views::Label. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix OnBoundsChanged handling. Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/render_text.h
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index 9fb6151697bf12b04fd6739792f595f283f0a2df..0ec4f3190eb74997d5bbbde01c260253294bce02 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -241,6 +241,8 @@ class GFX_EXPORT RenderText {
// cleared when SetText or SetObscured is called.
void SetObscuredRevealIndex(int index);
+ void SetReplaceNewlineCharsWithSymbols(bool replace);
Alexei Svitkine (slow) 2014/07/15 14:42:50 Add a comment.
msw 2014/07/15 16:53:05 Done.
+
// TODO(ckocagil): Multiline text rendering is currently only supported on
// Windows. Support other platforms.
bool multiline() const { return multiline_; }
@@ -255,6 +257,7 @@ class GFX_EXPORT RenderText {
// The layout text will be elided to fit |display_rect| using this behavior.
// The layout text may be shortened further by the truncate length.
void SetElideBehavior(ElideBehavior elide_behavior);
+ ElideBehavior elide_behavior() const { return elide_behavior_; }
const base::string16& layout_text() const { return layout_text_; }
@@ -406,6 +409,7 @@ class GFX_EXPORT RenderText {
// Sets shadows to drawn with text.
void set_shadows(const ShadowValues& shadows) { shadows_ = shadows; }
+ const ShadowValues& shadows() { return shadows_; }
typedef std::pair<Font, Range> FontSpan;
// For testing purposes, returns which fonts were chosen for which parts of
@@ -530,6 +534,9 @@ class GFX_EXPORT RenderText {
// Convert a text space x-coordinate range to rects in view space.
std::vector<Rect> TextBoundsToViewBounds(const Range& x);
+ // Get the alignment, resolving ALIGN_TO_HEAD with the current text direction.
+ HorizontalAlignment GetCurrentHorizontalAlignment();
+
// Returns the line offset from the origin, accounts for text alignment only.
Vector2d GetAlignmentOffset(size_t line_number);
@@ -666,6 +673,9 @@ class GFX_EXPORT RenderText {
// The obscured and/or truncated text that will be displayed.
base::string16 layout_text_;
+ // Whether newline characters should be replaced with newline symbols.
+ bool replace_newline_chars_with_symbols_;
+
// Whether the text should be broken into multiple lines. Uses the width of
// |display_rect_| as the width cap.
bool multiline_;

Powered by Google App Engine
This is Rietveld 408576698