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

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

Issue 2348143003: MacViews: Implement Force Touch/Mac dictionary lookup for Textfields. (Closed)
Patch Set: Address nits. Created 4 years, 2 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/BUILD.gn ('k') | ui/gfx/decorated_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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_GFX_DECORATED_TEXT_H_
6 #define UI_GFX_DECORATED_TEXT_H_
7
8 #include <vector>
9
10 #include "base/strings/string16.h"
11 #include "ui/gfx/font.h"
12 #include "ui/gfx/gfx_export.h"
13 #include "ui/gfx/range/range.h"
14
15 namespace gfx {
16
17 // Encapsulates styling information for some given text.
18 struct GFX_EXPORT DecoratedText {
19 // Describes the various text decoration attributes applicable to a given
20 // range of text.
21 struct GFX_EXPORT RangedAttribute {
22 // Disallow default construction of Font, since that's slow.
23 RangedAttribute() = delete;
24 RangedAttribute(const Range& range, const Font& font);
25
26 // The range in |text|, this RangedAttribute corresponds to. Should not be
27 // reversed and should lie within the bounds of |text|.
28 Range range;
29 Font font;
30 bool strike;
31 bool diagonal_strike;
32 };
33
34 DecoratedText();
35 ~DecoratedText();
36
37 base::string16 text;
38
39 // Vector of RangedAttribute describing styling of non-overlapping ranges
40 // in |text|.
41 std::vector<RangedAttribute> attributes;
42 };
43
44 }; // namespace gfx
45
46 #endif // UI_GFX_DECORATED_TEXT_H_
OLDNEW
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/gfx/decorated_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698