OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 StyleableMarker_h |
| 6 #define StyleableMarker_h |
| 7 |
| 8 #include "core/editing/markers/DocumentMarker.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 // An abstract subclass of DocumentMarker to be subclassed by DocumentMarkers |
| 13 // that should be renderable with customizable formatting. |
| 14 class CORE_EXPORT StyleableMarker : public DocumentMarker { |
| 15 public: |
| 16 enum class Thickness { kThin, kThick }; |
| 17 |
| 18 StyleableMarker(unsigned start_offset, |
| 19 unsigned end_offset, |
| 20 Color underline_color, |
| 21 Thickness, |
| 22 Color background_color); |
| 23 |
| 24 // StyleableMarker-specific |
| 25 Color UnderlineColor() const; |
| 26 bool IsThick() const; |
| 27 Color BackgroundColor() const; |
| 28 |
| 29 private: |
| 30 const Color underline_color_; |
| 31 const Color background_color_; |
| 32 const Thickness thickness_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(StyleableMarker); |
| 35 }; |
| 36 |
| 37 bool CORE_EXPORT IsStyleableMarker(const DocumentMarker&); |
| 38 |
| 39 DEFINE_TYPE_CASTS(StyleableMarker, |
| 40 DocumentMarker, |
| 41 marker, |
| 42 IsStyleableMarker(*marker), |
| 43 IsStyleableMarker(marker)); |
| 44 |
| 45 } // namespace blink |
| 46 |
| 47 #endif |
OLD | NEW |