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 markers that have non-empty overlap with the range | 36 // Return markers whose interiors have non-empty overlap with the range |
Xiaocheng
2017/06/23 21:40:32
nit: s/Return/Returns/
Sorry for my typo.
| |
37 // [start_offset, end_offset] | 37 // [start_offset, end_offset]. Note that the range can be collapsed, in which |
38 // case markers containing the offset in their interiors are returned. | |
38 virtual HeapVector<Member<DocumentMarker>> MarkersIntersectingRange( | 39 virtual HeapVector<Member<DocumentMarker>> MarkersIntersectingRange( |
39 unsigned start_offset, | 40 unsigned start_offset, |
40 unsigned end_offset) const = 0; | 41 unsigned end_offset) const = 0; |
41 | 42 |
42 // Returns true if at least one marker is copied, false otherwise | 43 // Returns true if at least one marker is copied, false otherwise |
43 virtual bool MoveMarkers(int length, DocumentMarkerList* dst_list) = 0; | 44 virtual bool MoveMarkers(int length, DocumentMarkerList* dst_list) = 0; |
44 | 45 |
45 // Returns true if at least one marker is removed, false otherwise | 46 // Returns true if at least one marker is removed, false otherwise |
46 virtual bool RemoveMarkers(unsigned start_offset, int length) = 0; | 47 virtual bool RemoveMarkers(unsigned start_offset, int length) = 0; |
47 | 48 |
48 // Returns true if at least one marker is shifted or removed, false otherwise | 49 // Returns true if at least one marker is shifted or removed, false otherwise |
49 virtual bool ShiftMarkers(unsigned offset, | 50 virtual bool ShiftMarkers(unsigned offset, |
50 unsigned old_length, | 51 unsigned old_length, |
51 unsigned new_length) = 0; | 52 unsigned new_length) = 0; |
52 | 53 |
53 DEFINE_INLINE_VIRTUAL_TRACE() {} | 54 DEFINE_INLINE_VIRTUAL_TRACE() {} |
54 | 55 |
55 protected: | 56 protected: |
56 DocumentMarkerList(); | 57 DocumentMarkerList(); |
57 | 58 |
58 private: | 59 private: |
59 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList); | 60 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList); |
60 }; | 61 }; |
61 | 62 |
62 } // namespace blink | 63 } // namespace blink |
63 | 64 |
64 #endif // DocumentMarkerList_h | 65 #endif // DocumentMarkerList_h |
OLD | NEW |