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 CompositionMarker_h |
| 6 #define CompositionMarker_h |
| 7 |
| 8 #include "core/editing/markers/DocumentMarker.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 // A subclass of DocumentMarker used to store information specific to |
| 13 // composition markers. We store what color to display the underline (possibly |
| 14 // transparent), whether the underline should be thick or not, and what |
| 15 // background color should be used under the marked text (also possibly |
| 16 // transparent). |
| 17 class CORE_EXPORT CompositionMarker final : public DocumentMarker { |
| 18 public: |
| 19 CompositionMarker(unsigned start_offset, |
| 20 unsigned end_offset, |
| 21 Color underline_color, |
| 22 bool thick, |
| 23 Color background_color); |
| 24 |
| 25 Color UnderlineColor() const; |
| 26 bool Thick() const; |
| 27 Color BackgroundColor() const; |
| 28 |
| 29 private: |
| 30 const Color underline_color_; |
| 31 const Color background_color_; |
| 32 const bool thick_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(CompositionMarker); |
| 35 }; |
| 36 |
| 37 DEFINE_TYPE_CASTS(CompositionMarker, |
| 38 DocumentMarker, |
| 39 marker, |
| 40 marker->GetType() == DocumentMarker::kComposition, |
| 41 marker.GetType() == DocumentMarker::kComposition); |
| 42 |
| 43 } // namespace blink |
| 44 |
| 45 #endif |
OLD | NEW |