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/editing/markers/DocumentMarker.h" | |
9 #include "platform/heap/Handle.h" | |
10 | |
11 namespace blink { | |
12 | |
13 class DocumentMarkerController; | |
14 | |
15 class CORE_EXPORT DocumentMarkerList | |
16 : public GarbageCollected<DocumentMarkerList> { | |
17 public: | |
18 explicit DocumentMarkerList(DocumentMarkerController*); | |
19 using iterator = Member<DocumentMarker>*; | |
20 using const_iterator = const Member<DocumentMarker>*; | |
21 | |
22 virtual DocumentMarker::MarkerType allowedMarkerType() const = 0; | |
23 virtual bool isEditingMarkerList() const; | |
24 virtual bool isSpellCheckMarkerList() const; | |
25 | |
26 size_t size() const { return m_markers.size(); } | |
27 bool empty() const { return m_markers.isEmpty(); } | |
28 DocumentMarker* at(size_t index) { return m_markers[index].get(); } | |
29 | |
30 virtual void clear() = 0; | |
31 | |
32 iterator begin(); | |
Xiaocheng
2017/03/24 19:43:49
These four should also be inlined.
| |
33 iterator end(); | |
34 const_iterator begin() const; | |
35 const_iterator end() const; | |
36 | |
37 void appendMarkersToInputList(DocumentMarkerVector* list) const; | |
38 | |
39 bool copyMarkers(unsigned startOffset, | |
40 int length, | |
41 Node* dstNode, | |
42 int delta) const; | |
43 void removeMarkers(unsigned startOffset, | |
44 int length, | |
45 bool shouldRemovePartiallyOverlappingMarkers, | |
46 bool* didRemoveMarker); | |
47 bool shiftMarkers(unsigned offset, unsigned oldLength, unsigned newLength); | |
48 | |
49 DECLARE_VIRTUAL_TRACE(); | |
50 | |
51 protected: | |
52 iterator getPosOfFirstMarkerNotEndingBefore(size_t startOffset); | |
53 virtual bool markerListIsSorted() const = 0; | |
54 | |
55 Member<DocumentMarkerController> m_documentMarkerController; | |
56 HeapVector<Member<DocumentMarker>> m_markers; | |
57 | |
58 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList); | |
59 }; | |
60 | |
61 } // namespace blink | |
62 | |
63 #endif // DocumentMarkerList_h | |
OLD | NEW |