Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1274)

Unified Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.h

Issue 2808363005: Add DocumentMarkerList interface (Closed)
Patch Set: s/copied/moved, add comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..384b60b86ca4c4709389d181aa26d55fa091d42f
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.h
@@ -0,0 +1,55 @@
+// 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 DocumentMarkerList
+ : public GarbageCollectedFinalized<DocumentMarkerList> {
+ public:
+ DocumentMarkerList();
+
+ virtual ~DocumentMarkerList();
+
+ virtual bool Empty() const = 0;
+
+ virtual void Add(DocumentMarker*) = 0;
+ virtual void Clear() = 0;
+
+ virtual void AppendMarkersToInputList(DocumentMarkerVector* list) const = 0;
+
+ // Moves markers from src_node to dst_node. Markers are moved if their start
+ // offset is less than length. Markers that run past that point are truncated.
+
+ // Returns true if at least one marker is moved, false otherwise
+ virtual bool MoveMarkers(int length, DocumentMarkerList* dst_list) = 0;
+
+ // Removes markers that have non-zero intersection with the range
+ // [start_offset, start_offset + length] (i.e., it's not enough that an
+ // endpoint touches this range, there must be overlap).
+
+ // Returns true if at least one marker is removed, false otherwise
+ virtual bool RemoveMarkers(unsigned start_offset, int length) = 0;
+
+ // Updates markers in response to a text edit occurring at the specified
+ // offset that changes a range of text (possibly empty) of length old_length
+ // into a new new range of text (also possibly empty) of length new_length.
+
+ // Returns true if at least one marker is shifted or removed, false otherwise
+ virtual bool ShiftMarkers(unsigned offset,
+ unsigned old_length,
+ unsigned new_length) = 0;
+
+ DEFINE_INLINE_VIRTUAL_TRACE() {}
+ DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList);
+};
+
+} // namespace blink
+
+#endif // DocumentMarkerList_h
« no previous file with comments | « third_party/WebKit/Source/core/editing/BUILD.gn ('k') | third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698