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

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

Issue 2820633002: [DMC #2] Add DocumentMarkerList interface and GenericDocumentMarkerListImpl (Closed)
Patch Set: Respond to comments Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(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/CoreExport.h"
9 #include "platform/heap/Handle.h"
10
11 namespace blink {
12
13 class DocumentMarker;
14 class RenderedDocumentMarker;
15
16 // This is an interface implemented by classes that DocumentMarkerController
17 // uses to store DocumentMarkers. Different implementations can be written
18 // to handle different MarkerTypes (e.g. to provide more optimized handling of
19 // MarkerTypes with different insertion/retrieval patterns, or to provide
20 // different behavior for certain MarkerTypes).
21 class CORE_EXPORT DocumentMarkerList
22 : public GarbageCollectedFinalized<DocumentMarkerList> {
23 protected:
yosin_UTC9 2017/04/26 03:41:51 Please make sections in public, protected and priv
24 DocumentMarkerList();
25
26 public:
27 virtual ~DocumentMarkerList();
28
29 virtual bool IsEmpty() const = 0;
30
31 virtual void Add(DocumentMarker*) = 0;
32 virtual void Clear() = 0;
33
34 virtual const HeapVector<Member<RenderedDocumentMarker>>& GetMarkers()
35 const = 0;
36
37 // Returns true if at least one marker is copied, false otherwise
38 virtual bool MoveMarkers(int length, DocumentMarkerList* dst_list) = 0;
39
40 // Returns true if at least one marker is removed, false otherwise
41 virtual bool RemoveMarkers(unsigned start_offset, int length) = 0;
42
43 // Returns true if a marker was removed, false otherwise.
44 // TODO(rlanday): remove this method from this interface once we have a
45 // Spelling/Grammar-specific marker list impl to put this on
46 virtual bool RemoveMarkersUnderWords(const String& node_text,
47 const Vector<String>& words) = 0;
48
49 // Returns true if at least one marker is shifted or removed, false otherwise
50 virtual bool ShiftMarkers(unsigned offset,
51 unsigned old_length,
52 unsigned new_length) = 0;
53
54 DEFINE_INLINE_VIRTUAL_TRACE() {}
55
56 private:
57 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList);
58 };
59
60 } // namespace blink
61
62 #endif // DocumentMarkerList_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698