OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef DocumentMarkerListEditor_h | 5 #ifndef DocumentMarkerListEditor_h |
6 #define DocumentMarkerListEditor_h | 6 #define DocumentMarkerListEditor_h |
7 | 7 |
8 #include "core/editing/markers/DocumentMarkerList.h" | 8 #include "core/editing/markers/DocumentMarkerList.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class DocumentMarker; | 13 class DocumentMarker; |
14 class RenderedDocumentMarker; | 14 class RenderedDocumentMarker; |
15 | 15 |
16 class DocumentMarkerListEditor { | 16 class DocumentMarkerListEditor { |
17 public: | 17 public: |
18 using MarkerList = HeapVector<Member<RenderedDocumentMarker>>; | 18 using MarkerList = HeapVector<Member<RenderedDocumentMarker>>; |
19 | 19 |
20 static void AddMarkerAndMergeOverlapping(MarkerList*, const DocumentMarker*); | |
21 static void AddMarkerWithoutMergingOverlapping(MarkerList*, | 20 static void AddMarkerWithoutMergingOverlapping(MarkerList*, |
22 const DocumentMarker*); | 21 const DocumentMarker*); |
23 | 22 |
24 // Returns true if a marker was moved, false otherwise. | 23 // Returns true if a marker was moved, false otherwise. |
25 static bool MoveMarkers(MarkerList* src_list, | 24 static bool MoveMarkers(MarkerList* src_list, |
26 int length, | 25 int length, |
27 DocumentMarkerList* dst_list); | 26 DocumentMarkerList* dst_list); |
28 | 27 |
29 // Returns true if a marker was removed, false otherwise. | 28 // Returns true if a marker was removed, false otherwise. |
30 static bool RemoveMarkers(MarkerList*, unsigned start_offset, int length); | 29 static bool RemoveMarkers(MarkerList*, unsigned start_offset, int length); |
31 | 30 |
32 // Returns true if a marker was removed, false otherwise. | |
33 static bool RemoveMarkersUnderWords(MarkerList*, | |
34 const String& node_text, | |
35 const Vector<String>& words); | |
36 | |
37 // Returns true if a marker was shifted or removed, false otherwise. | 31 // Returns true if a marker was shifted or removed, false otherwise. |
38 static bool ShiftMarkers(MarkerList*, | 32 static bool ShiftMarkers(MarkerList*, |
39 unsigned offset, | 33 unsigned offset, |
40 unsigned old_length, | 34 unsigned old_length, |
41 unsigned new_length); | 35 unsigned new_length); |
42 }; | 36 }; |
43 | 37 |
44 } // namespace blink | 38 } // namespace blink |
45 | 39 |
46 #endif // DocumentMarkerListEditor_h | 40 #endif // DocumentMarkerListEditor_h |
OLD | NEW |