| Index: third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.h
|
| diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..19d460b739edee3aeebfea6585bdf87389433edb
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.h
|
| @@ -0,0 +1,69 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef DocumentMarkerList_h
|
| +#define DocumentMarkerList_h
|
| +
|
| +#include "core/editing/markers/DocumentMarker.h"
|
| +#include "platform/heap/Handle.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class DocumentMarkerController;
|
| +
|
| +class DocumentMarkerList : public GarbageCollected<DocumentMarkerList> {
|
| + WTF_MAKE_NONCOPYABLE(DocumentMarkerList);
|
| +
|
| + public:
|
| + explicit DocumentMarkerList(DocumentMarkerController*);
|
| + using iterator = Member<DocumentMarker>*;
|
| + using const_iterator = const Member<DocumentMarker>*;
|
| +
|
| + virtual DocumentMarker::MarkerType allowedMarkerType() const = 0;
|
| +
|
| + virtual size_t size() const = 0;
|
| + virtual bool empty() const = 0;
|
| + virtual DocumentMarker* at(size_t index) = 0;
|
| +
|
| + virtual void clear() = 0;
|
| +
|
| + virtual iterator begin() = 0;
|
| + virtual iterator end() = 0;
|
| + virtual const_iterator begin() const = 0;
|
| + virtual const_iterator end() const = 0;
|
| +
|
| + virtual void appendMarkersToInputList(DocumentMarkerVector* list) const = 0;
|
| + virtual bool copyMarkers(unsigned startOffset,
|
| + int length,
|
| + Node* dstNode,
|
| + int delta) const = 0;
|
| + virtual void removeMarkers(unsigned startOffset,
|
| + int length,
|
| + bool shouldRemovePartiallyOverlappingMarkers,
|
| + bool* didRemoveMarker) = 0;
|
| + virtual bool shiftMarkers(int startOffset, int delta) = 0;
|
| +
|
| + DECLARE_VIRTUAL_TRACE();
|
| +
|
| + protected:
|
| + struct ShiftMarkerResult {
|
| + unsigned newStartOffset;
|
| + unsigned newEndOffset;
|
| + };
|
| +
|
| + static bool startsAfter(const Member<DocumentMarker>&, size_t startOffset);
|
| + static bool endsBefore(size_t startOffset, const Member<DocumentMarker>& rhv);
|
| + static bool compareByStart(const Member<DocumentMarker>& lhv,
|
| + const Member<DocumentMarker>& rhv);
|
| +
|
| + ShiftMarkerResult getShiftedMarkerPosition(const DocumentMarker&,
|
| + unsigned startOffset,
|
| + int delta);
|
| +
|
| + Member<DocumentMarkerController> m_documentMarkerController;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // DocumentMarkerList_h
|
|
|