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

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: Revert Label implementation changes. 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
« no previous file with comments | « chrome/browser/ui/views/validation_message_bubble_delegate.cc ('k') | ui/gfx/render_text.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.h
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index 9fb6151697bf12b04fd6739792f595f283f0a2df..ced7069d5d20ec58d38f8a0039f809335e036227 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -241,6 +241,9 @@ class GFX_EXPORT RenderText {
// cleared when SetText or SetObscured is called.
void SetObscuredRevealIndex(int index);
+ // Set whether newline characters should be replaced with newline symbols.
+ void SetReplaceNewlineCharsWithSymbols(bool replace);
+
// TODO(ckocagil): Multiline text rendering is currently only supported on
// Windows. Support other platforms.
bool multiline() const { return multiline_; }
@@ -255,6 +258,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 +410,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 +535,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 +674,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_;
« no previous file with comments | « chrome/browser/ui/views/validation_message_bubble_delegate.cc ('k') | ui/gfx/render_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698