Chromium Code Reviews| 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 }; | |
|
Xiaocheng
2017/06/05 19:21:55
add DISALLOW_COPY_AND_ASSIGN
| |
| 34 | |
| 35 bool CORE_EXPORT IsStyleableMarker(const DocumentMarker&); | |
| 36 | |
| 37 DEFINE_TYPE_CASTS(StyleableMarker, | |
| 38 DocumentMarker, | |
| 39 marker, | |
| 40 IsStyleableMarker(*marker), | |
| 41 IsStyleableMarker(marker)); | |
| 42 | |
| 43 } // namespace blink | |
| 44 | |
| 45 #endif | |
| OLD | NEW |