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 DocumentMarkerList_h |
| 6 #define DocumentMarkerList_h |
| 7 |
| 8 #include "core/CoreExport.h" |
| 9 #include "platform/heap/Handle.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 class DocumentMarker; |
| 14 class RenderedDocumentMarker; |
| 15 |
| 16 // This is an interface implemented by classes that DocumentMarkerController |
| 17 // uses to store DocumentMarkers. Different implementations can be written |
| 18 // to handle different MarkerTypes (e.g. to provide more optimized handling of |
| 19 // MarkerTypes with different insertion/retrieval patterns, or to provide |
| 20 // different behavior for certain MarkerTypes). |
| 21 class CORE_EXPORT DocumentMarkerList |
| 22 : public GarbageCollectedFinalized<DocumentMarkerList> { |
| 23 public: |
| 24 virtual ~DocumentMarkerList(); |
| 25 |
| 26 virtual bool IsEmpty() const = 0; |
| 27 |
| 28 virtual void Add(DocumentMarker*) = 0; |
| 29 virtual void Clear() = 0; |
| 30 |
| 31 virtual const HeapVector<Member<RenderedDocumentMarker>>& GetMarkers() |
| 32 const = 0; |
| 33 |
| 34 // Returns true if at least one marker is copied, false otherwise |
| 35 virtual bool MoveMarkers(int length, DocumentMarkerList* dst_list) = 0; |
| 36 |
| 37 // Returns true if at least one marker is removed, false otherwise |
| 38 virtual bool RemoveMarkers(unsigned start_offset, int length) = 0; |
| 39 |
| 40 // Returns true if a marker was removed, false otherwise. |
| 41 // TODO(rlanday): remove this method from this interface once we have a |
| 42 // Spelling/Grammar-specific marker list impl to put this on |
| 43 virtual bool RemoveMarkersUnderWords(const String& node_text, |
| 44 const Vector<String>& words) = 0; |
| 45 |
| 46 // Returns true if at least one marker is shifted or removed, false otherwise |
| 47 virtual bool ShiftMarkers(unsigned offset, |
| 48 unsigned old_length, |
| 49 unsigned new_length) = 0; |
| 50 |
| 51 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 52 |
| 53 protected: |
| 54 DocumentMarkerList(); |
| 55 |
| 56 private: |
| 57 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList); |
| 58 }; |
| 59 |
| 60 } // namespace blink |
| 61 |
| 62 #endif // DocumentMarkerList_h |
OLD | NEW |