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 13 matching lines...) Expand all Loading... |
24 virtual ~DocumentMarkerList(); | 24 virtual ~DocumentMarkerList(); |
25 | 25 |
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 virtual const HeapVector<Member<DocumentMarker>>& GetMarkers() const = 0; | 35 virtual const HeapVector<Member<DocumentMarker>>& GetMarkers() const = 0; |
| 36 // Returns markers that have non-empty overlap with the range |
| 37 // [start_offset, end_offset] |
| 38 virtual HeapVector<Member<DocumentMarker>> MarkersIntersectingRange( |
| 39 unsigned start_offset, |
| 40 unsigned end_offset) const = 0; |
35 | 41 |
36 // Returns true if at least one marker is copied, false otherwise | 42 // Returns true if at least one marker is copied, false otherwise |
37 virtual bool MoveMarkers(int length, DocumentMarkerList* dst_list) = 0; | 43 virtual bool MoveMarkers(int length, DocumentMarkerList* dst_list) = 0; |
38 | 44 |
39 // Returns true if at least one marker is removed, false otherwise | 45 // Returns true if at least one marker is removed, false otherwise |
40 virtual bool RemoveMarkers(unsigned start_offset, int length) = 0; | 46 virtual bool RemoveMarkers(unsigned start_offset, int length) = 0; |
41 | 47 |
42 // Returns true if at least one marker is shifted or removed, false otherwise | 48 // Returns true if at least one marker is shifted or removed, false otherwise |
43 virtual bool ShiftMarkers(unsigned offset, | 49 virtual bool ShiftMarkers(unsigned offset, |
44 unsigned old_length, | 50 unsigned old_length, |
45 unsigned new_length) = 0; | 51 unsigned new_length) = 0; |
46 | 52 |
47 DEFINE_INLINE_VIRTUAL_TRACE() {} | 53 DEFINE_INLINE_VIRTUAL_TRACE() {} |
48 | 54 |
49 protected: | 55 protected: |
50 DocumentMarkerList(); | 56 DocumentMarkerList(); |
51 | 57 |
52 private: | 58 private: |
53 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList); | 59 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList); |
54 }; | 60 }; |
55 | 61 |
56 } // namespace blink | 62 } // namespace blink |
57 | 63 |
58 #endif // DocumentMarkerList_h | 64 #endif // DocumentMarkerList_h |
OLD | NEW |