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 SpellCheckMarkerListImpl_h | 5 #ifndef SpellCheckMarkerListImpl_h |
6 #define SpellCheckMarkerListImpl_h | 6 #define SpellCheckMarkerListImpl_h |
7 | 7 |
8 #include "core/editing/markers/DocumentMarkerList.h" | 8 #include "core/editing/markers/DocumentMarkerList.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 // Nearly-complete implementation of DocumentMarkerList for Spelling or Grammar | 12 // Nearly-complete implementation of DocumentMarkerList for Spelling or Grammar |
13 // markers (subclassed by SpellingMarkerListImpl and GrammarMarkerListImpl to | 13 // markers (subclassed by SpellingMarkerListImpl and GrammarMarkerListImpl to |
14 // implement the MarkerType() method). Markers with touching endpoints are | 14 // implement the MarkerType() method). Markers with touching endpoints are |
15 // merged on insert. Markers are kept sorted by start offset in order to be able | 15 // merged on insert. Markers are kept sorted by start offset in order to be able |
16 // to do this efficiently. | 16 // to do this efficiently. |
17 class CORE_EXPORT SpellCheckMarkerListImpl : public DocumentMarkerList { | 17 class CORE_EXPORT SpellCheckMarkerListImpl : public DocumentMarkerList { |
18 public: | 18 public: |
19 // DocumentMarkerList implementations | 19 // DocumentMarkerList implementations |
20 bool IsEmpty() const final; | 20 bool IsEmpty() const final; |
21 | 21 |
22 void Add(DocumentMarker*) final; | 22 void Add(DocumentMarker*) final; |
23 void Clear() final; | 23 void Clear() final; |
24 | 24 |
25 const HeapVector<Member<DocumentMarker>>& GetMarkers() const final; | 25 const HeapVector<Member<DocumentMarker>>& GetMarkers() const final; |
| 26 DocumentMarker* FirstMarkerIntersectingRange(unsigned start_offset, |
| 27 unsigned end_offset) const final; |
26 HeapVector<Member<DocumentMarker>> MarkersIntersectingRange( | 28 HeapVector<Member<DocumentMarker>> MarkersIntersectingRange( |
27 unsigned start_offset, | 29 unsigned start_offset, |
28 unsigned end_offset) const final; | 30 unsigned end_offset) const final; |
29 | 31 |
30 bool MoveMarkers(int length, DocumentMarkerList* dst_list) final; | 32 bool MoveMarkers(int length, DocumentMarkerList* dst_list) final; |
31 bool RemoveMarkers(unsigned start_offset, int length) final; | 33 bool RemoveMarkers(unsigned start_offset, int length) final; |
32 bool ShiftMarkers(unsigned offset, | 34 bool ShiftMarkers(unsigned offset, |
33 unsigned old_length, | 35 unsigned old_length, |
34 unsigned new_length) final; | 36 unsigned new_length) final; |
35 | 37 |
(...skipping 17 matching lines...) Expand all Loading... |
53 DocumentMarkerList, | 55 DocumentMarkerList, |
54 list, | 56 list, |
55 list->MarkerType() == DocumentMarker::kSpelling || | 57 list->MarkerType() == DocumentMarker::kSpelling || |
56 list->MarkerType() == DocumentMarker::kGrammar, | 58 list->MarkerType() == DocumentMarker::kGrammar, |
57 list.MarkerType() == DocumentMarker::kSpelling || | 59 list.MarkerType() == DocumentMarker::kSpelling || |
58 list.MarkerType() == DocumentMarker::kGrammar); | 60 list.MarkerType() == DocumentMarker::kGrammar); |
59 | 61 |
60 } // namespace blink | 62 } // namespace blink |
61 | 63 |
62 #endif // SpellCheckMarkerListImpl_h | 64 #endif // SpellCheckMarkerListImpl_h |
OLD | NEW |