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 SpellCheckMarkerList_h |
| 6 #define SpellCheckMarkerList_h |
| 7 |
| 8 #include "core/editing/markers/DocumentMarkerList.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class CORE_EXPORT SpellCheckMarkerList final : public DocumentMarkerList { |
| 13 public: |
| 14 SpellCheckMarkerList(DocumentMarker::MarkerType); |
| 15 |
| 16 DocumentMarker::MarkerType allowedMarkerType() const final; |
| 17 |
| 18 bool empty() const final; |
| 19 DocumentMarker* at(size_t index) final; |
| 20 |
| 21 void add(DocumentMarker*) final; |
| 22 void clear() final; |
| 23 |
| 24 void appendMarkersToInputList(DocumentMarkerVector* list) const; |
| 25 |
| 26 DidCopyMarkerOrNot copyMarkers(unsigned startOffset, |
| 27 int length, |
| 28 DocumentMarkerList* dstList, |
| 29 int delta) final; |
| 30 |
| 31 DidRemoveMarkerOrNot removeMarkers( |
| 32 unsigned startOffset, |
| 33 int length, |
| 34 bool shouldRemovePartiallyOverlappingMarkers) final; |
| 35 |
| 36 DidShiftMarkerOrNot shiftMarkers(unsigned offset, |
| 37 unsigned oldLength, |
| 38 unsigned newLength) final; |
| 39 |
| 40 DECLARE_VIRTUAL_TRACE(); |
| 41 |
| 42 // SpellCheckMarkerList-specific methods |
| 43 void removeMarkersForWords(const String& nodeText, |
| 44 const Vector<String>& words); |
| 45 |
| 46 private: |
| 47 const DocumentMarker::MarkerType m_type; |
| 48 HeapVector<Member<DocumentMarker>> m_markers; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(SpellCheckMarkerList); |
| 51 }; |
| 52 |
| 53 DEFINE_TYPE_CASTS(SpellCheckMarkerList, |
| 54 DocumentMarkerList, |
| 55 list, |
| 56 list->allowedMarkerType() == DocumentMarker::Spelling || |
| 57 list->allowedMarkerType() == DocumentMarker::Grammar, |
| 58 list.allowedMarkerType() == DocumentMarker::Spelling || |
| 59 list.allowedMarkerType() == DocumentMarker::Grammar); |
| 60 |
| 61 } // namespace blink |
| 62 |
| 63 #endif // SpellCheckMarkerList_h |
OLD | NEW |