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 DocumentMarkerList : public GarbageCollected<DocumentMarkerList> { | |
16 WTF_MAKE_NONCOPYABLE(DocumentMarkerList); | |
Xiaocheng
2017/03/21 03:59:44
nit: It's a little bit weird to me to have both WT
| |
17 | |
18 public: | |
19 explicit DocumentMarkerList(DocumentMarkerController*); | |
20 using iterator = Member<DocumentMarker>*; | |
21 using const_iterator = const Member<DocumentMarker>*; | |
22 | |
23 virtual DocumentMarker::MarkerType allowedMarkerType() const = 0; | |
24 | |
25 size_t size() const; | |
26 bool empty() const; | |
27 virtual DocumentMarker* at(size_t index); | |
28 | |
29 virtual void clear() = 0; | |
30 | |
31 iterator begin(); | |
32 iterator end(); | |
33 const_iterator begin() const; | |
34 const_iterator end() const; | |
35 | |
36 void appendMarkersToInputList(DocumentMarkerVector* list) const; | |
37 | |
38 virtual bool copyMarkers(unsigned startOffset, | |
39 int length, | |
40 Node* dstNode, | |
41 int delta) const = 0; | |
42 virtual void removeMarkers(unsigned startOffset, | |
43 int length, | |
44 bool shouldRemovePartiallyOverlappingMarkers, | |
45 bool* didRemoveMarker) = 0; | |
46 virtual bool shiftMarkers(unsigned offset, | |
47 unsigned oldLength, | |
48 unsigned newLength) = 0; | |
49 | |
50 DECLARE_VIRTUAL_TRACE(); | |
51 | |
52 protected: | |
53 HeapVector<Member<DocumentMarker>>::iterator | |
54 getPosOfFirstMarkerNotEndingBefore(size_t startOffset); | |
55 | |
56 Member<DocumentMarkerController> m_documentMarkerController; | |
57 HeapVector<Member<DocumentMarker>> m_markers; | |
58 | |
59 private: | |
60 static bool endsBefore(size_t startOffset, const Member<DocumentMarker>& rhv); | |
61 }; | |
62 | |
63 } // namespace blink | |
64 | |
65 #endif // DocumentMarkerList_h | |
OLD | NEW |