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 DocumentMarkerList |
| 14 : public GarbageCollectedFinalized<DocumentMarkerList> { |
| 15 public: |
| 16 DocumentMarkerList(); |
| 17 |
| 18 virtual ~DocumentMarkerList(); |
| 19 |
| 20 virtual bool Empty() const = 0; |
| 21 |
| 22 virtual void Add(DocumentMarker*) = 0; |
| 23 virtual void Clear() = 0; |
| 24 |
| 25 virtual void AppendMarkersToInputList(DocumentMarkerVector* list) const = 0; |
| 26 |
| 27 // Moves markers from src_node to dst_node. Markers are moved if their start |
| 28 // offset is less than length. Markers that run past that point are truncated. |
| 29 |
| 30 // Returns true if at least one marker is moved, false otherwise |
| 31 virtual bool MoveMarkers(int length, DocumentMarkerList* dst_list) = 0; |
| 32 |
| 33 // Removes markers that have non-zero intersection with the range |
| 34 // [start_offset, start_offset + length] (i.e., it's not enough that an |
| 35 // endpoint touches this range, there must be overlap). |
| 36 |
| 37 // Returns true if at least one marker is removed, false otherwise |
| 38 virtual bool RemoveMarkers(unsigned start_offset, int length) = 0; |
| 39 |
| 40 // Updates markers in response to a text edit occurring at the specified |
| 41 // offset that changes a range of text (possibly empty) of length old_length |
| 42 // into a new new range of text (also possibly empty) of length new_length. |
| 43 |
| 44 // Returns true if at least one marker is shifted or removed, false otherwise |
| 45 virtual bool ShiftMarkers(unsigned offset, |
| 46 unsigned old_length, |
| 47 unsigned new_length) = 0; |
| 48 |
| 49 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 50 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList); |
| 51 }; |
| 52 |
| 53 } // namespace blink |
| 54 |
| 55 #endif // DocumentMarkerList_h |
OLD | NEW |