chromium/third_party/blink/renderer/core/fragment_directive/same_block_word_iterator.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_FRAGMENT_DIRECTIVE_SAME_BLOCK_WORD_ITERATOR_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAGMENT_DIRECTIVE_SAME_BLOCK_WORD_ITERATOR_H_

#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/finder/find_buffer.h"
#include "third_party/blink/renderer/core/editing/iterators/text_iterator.h"
#include "third_party/blink/renderer/core/editing/position.h"
#include "third_party/blink/renderer/platform/text/text_boundaries.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"

namespace blink {

class CORE_EXPORT ForwardDirection {};

class CORE_EXPORT BackwardDirection {};

// Word iterator that doesn't cross block boundaries.
// Note that if the start position given to this class is in a middle of a word
// then the first word retuned by this class will be a partial word.
template <typename Direction>
class SameBlockWordIterator
    : public GarbageCollected<SameBlockWordIterator<Direction>> {};

extern template class CORE_EXTERN_TEMPLATE_EXPORT
    SameBlockWordIterator<ForwardDirection>;
extern template class CORE_EXTERN_TEMPLATE_EXPORT
    SameBlockWordIterator<BackwardDirection>;
ForwardSameBlockWordIterator;
BackwardSameBlockWordIterator;

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_FRAGMENT_DIRECTIVE_SAME_BLOCK_WORD_ITERATOR_H_