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 TextMatchMarkerList_h |
| 6 #define TextMatchMarkerList_h |
| 7 |
| 8 #include "core/editing/markers/DocumentMarkerList.h" |
| 9 |
| 10 #include "core/editing/markers/TextMatchMarker.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class DocumentMarker; |
| 15 |
| 16 // TextMatchMarkerList only supports adding TextMatch markers in sorted order, |
| 17 // and adds some functionality specific to TextMatch markers. |
| 18 class CORE_EXPORT TextMatchMarkerList : public DocumentMarkerList { |
| 19 public: |
| 20 TextMatchMarkerList(); |
| 21 |
| 22 // DocumentMarkerList implementations |
| 23 DocumentMarker::MarkerType allowedMarkerType() const final; |
| 24 TextMatchMarker* at(size_t index) final; |
| 25 void add(DocumentMarker*) final; |
| 26 |
| 27 // TextMatchMarkerList-specific methods |
| 28 void appendRenderedRectsToInputList(const Node&, |
| 29 Vector<IntRect>* result) const; |
| 30 void invalidateRects(); |
| 31 bool setTextMatchMarkersActive(unsigned startOffset, |
| 32 unsigned endOffset, |
| 33 bool active); |
| 34 |
| 35 protected: |
| 36 bool markerListIsSorted() const final; |
| 37 |
| 38 DECLARE_VIRTUAL_TRACE(); |
| 39 DISALLOW_COPY_AND_ASSIGN(TextMatchMarkerList); |
| 40 }; |
| 41 |
| 42 DEFINE_TYPE_CASTS(TextMatchMarkerList, |
| 43 DocumentMarkerList, |
| 44 list, |
| 45 list->allowedMarkerType() == DocumentMarker::TextMatch, |
| 46 list.allowedMarkerType() == DocumentMarker::TextMatch); |
| 47 |
| 48 } // namespace blink |
| 49 |
| 50 #endif // TextMatchMarkerList_h |
OLD | NEW |