OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SpellCheckMarker_h | 5 #ifndef SpellCheckMarker_h |
6 #define SpellCheckMarker_h | 6 #define SpellCheckMarker_h |
7 | 7 |
8 #include "core/editing/markers/DocumentMarker.h" | 8 #include "core/editing/markers/DocumentMarker.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 // A subclass of DocumentMarker used to implement functionality shared between | 12 // A subclass of DocumentMarker used to implement functionality shared between |
13 // spelling and grammar markers. These two marker types both store a | 13 // spelling and grammar markers. These two marker types both store a |
14 // description string that can contain suggested replacements for a misspelling | 14 // description string that can contain suggested replacements for a misspelling |
15 // or grammar error. | 15 // or grammar error. |
16 class CORE_EXPORT SpellCheckMarker : public DocumentMarker { | 16 class CORE_EXPORT SpellCheckMarker : public DocumentMarker { |
17 public: | 17 public: |
18 SpellCheckMarker(DocumentMarker::MarkerType, | 18 SpellCheckMarker(unsigned start_offset, |
19 unsigned start_offset, | |
20 unsigned end_offset, | 19 unsigned end_offset, |
21 const String& description); | 20 const String& description); |
22 | 21 |
23 const String& Description() const { return description_; } | 22 const String& Description() const { return description_; } |
24 | 23 |
25 private: | 24 private: |
26 const String description_; | 25 const String description_; |
27 | 26 |
28 DISALLOW_COPY_AND_ASSIGN(SpellCheckMarker); | 27 DISALLOW_COPY_AND_ASSIGN(SpellCheckMarker); |
29 }; | 28 }; |
30 | 29 |
31 bool CORE_EXPORT IsSpellCheckMarker(const DocumentMarker&); | 30 bool CORE_EXPORT IsSpellCheckMarker(const DocumentMarker&); |
32 | 31 |
33 DEFINE_TYPE_CASTS(SpellCheckMarker, | 32 DEFINE_TYPE_CASTS(SpellCheckMarker, |
34 DocumentMarker, | 33 DocumentMarker, |
35 marker, | 34 marker, |
36 IsSpellCheckMarker(*marker), | 35 IsSpellCheckMarker(*marker), |
37 IsSpellCheckMarker(marker)); | 36 IsSpellCheckMarker(marker)); |
38 | 37 |
39 } // namespace blink | 38 } // namespace blink |
40 | 39 |
41 #endif | 40 #endif |
OLD | NEW |