chromium/third_party/blink/renderer/core/annotation/text_annotation_selector.h

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_ANNOTATION_TEXT_ANNOTATION_SELECTOR_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_ANNOTATION_TEXT_ANNOTATION_SELECTOR_H_

#include <optional>

#include "third_party/blink/renderer/core/annotation/annotation_selector.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/fragment_directive/text_fragment_finder.h"
#include "third_party/blink/renderer/core/fragment_directive/text_fragment_selector.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"

namespace blink {

class Document;

// AnnotationSelector based on TextFragmentFinder. This selector allows
// attaching to DOM based on exact or a range of text with provided prefix or
// suffix.
class CORE_EXPORT TextAnnotationSelector : public AnnotationSelector,
                                           public TextFragmentFinder::Client {};

template <>
struct DowncastTraits<TextAnnotationSelector> {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_ANNOTATION_TEXT_ANNOTATION_SELECTOR_H_