| 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 DocumentMarkerList_h | 5 #ifndef DocumentMarkerList_h |
| 6 #define DocumentMarkerList_h | 6 #define DocumentMarkerList_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/editing/markers/DocumentMarker.h" | 9 #include "core/editing/markers/DocumentMarker.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // Returns the single marker type supported by the list implementation. | 26 // Returns the single marker type supported by the list implementation. |
| 27 virtual DocumentMarker::MarkerType MarkerType() const = 0; | 27 virtual DocumentMarker::MarkerType MarkerType() const = 0; |
| 28 | 28 |
| 29 virtual bool IsEmpty() const = 0; | 29 virtual bool IsEmpty() const = 0; |
| 30 | 30 |
| 31 virtual void Add(DocumentMarker*) = 0; | 31 virtual void Add(DocumentMarker*) = 0; |
| 32 virtual void Clear() = 0; | 32 virtual void Clear() = 0; |
| 33 | 33 |
| 34 // Returns all markers | 34 // Returns all markers |
| 35 virtual const HeapVector<Member<DocumentMarker>>& GetMarkers() const = 0; | 35 virtual const HeapVector<Member<DocumentMarker>>& GetMarkers() const = 0; |
| 36 // Returns the first marker that has non-empty overlap with the range |
| 37 // [start_offset, end_offset], or null if there is no such marker. |
| 38 virtual DocumentMarker* FirstMarkerIntersectingRange( |
| 39 unsigned start_offset, |
| 40 unsigned end_offset) const = 0; |
| 36 // Returns markers that have non-empty overlap with the range | 41 // Returns markers that have non-empty overlap with the range |
| 37 // [start_offset, end_offset] | 42 // [start_offset, end_offset] |
| 38 virtual HeapVector<Member<DocumentMarker>> MarkersIntersectingRange( | 43 virtual HeapVector<Member<DocumentMarker>> MarkersIntersectingRange( |
| 39 unsigned start_offset, | 44 unsigned start_offset, |
| 40 unsigned end_offset) const = 0; | 45 unsigned end_offset) const = 0; |
| 41 | 46 |
| 42 // Returns true if at least one marker is copied, false otherwise | 47 // Returns true if at least one marker is copied, false otherwise |
| 43 virtual bool MoveMarkers(int length, DocumentMarkerList* dst_list) = 0; | 48 virtual bool MoveMarkers(int length, DocumentMarkerList* dst_list) = 0; |
| 44 | 49 |
| 45 // Returns true if at least one marker is removed, false otherwise | 50 // Returns true if at least one marker is removed, false otherwise |
| 46 virtual bool RemoveMarkers(unsigned start_offset, int length) = 0; | 51 virtual bool RemoveMarkers(unsigned start_offset, int length) = 0; |
| 47 | 52 |
| 48 // Returns true if at least one marker is shifted or removed, false otherwise | 53 // Returns true if at least one marker is shifted or removed, false otherwise |
| 49 virtual bool ShiftMarkers(unsigned offset, | 54 virtual bool ShiftMarkers(unsigned offset, |
| 50 unsigned old_length, | 55 unsigned old_length, |
| 51 unsigned new_length) = 0; | 56 unsigned new_length) = 0; |
| 52 | 57 |
| 53 DEFINE_INLINE_VIRTUAL_TRACE() {} | 58 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 54 | 59 |
| 55 protected: | 60 protected: |
| 56 DocumentMarkerList(); | 61 DocumentMarkerList(); |
| 57 | 62 |
| 58 private: | 63 private: |
| 59 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList); | 64 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList); |
| 60 }; | 65 }; |
| 61 | 66 |
| 62 } // namespace blink | 67 } // namespace blink |
| 63 | 68 |
| 64 #endif // DocumentMarkerList_h | 69 #endif // DocumentMarkerList_h |
| OLD | NEW |