OLD | NEW |
(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_ |
OLD | NEW |