chromium/ui/base/ime/surrounding_text_tracker.cc

// 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.

#include "ui/base/ime/surrounding_text_tracker.h"

#include <string_view>
#include <utility>

#include "base/check.h"
#include "base/logging.h"
#include "base/notreached.h"

namespace ui {
namespace {

// Replaces the substring of the given str with the offset with replacement.
// If the range is outside of the str, str will not be updated (i.e. final
// result may not contain replacement) but at least offset should be adjusted.
void ReplaceString16WithOffset(std::u16string& str,
                               size_t& offset,
                               size_t pos,
                               size_t n,
                               const std::u16string& replacement) {}

// Erases [pos:pos+n) from the given str with the offset.
void EraseString16WithOffset(std::u16string& str,
                             size_t& offset,
                             size_t pos,
                             size_t n) {}

}  // namespace

gfx::Range SurroundingTextTracker::State::GetSurroundingTextRange() const {}

std::optional<std::u16string_view>
SurroundingTextTracker::State::GetCompositionText() const {}

SurroundingTextTracker::Entry::Entry(State state,
                                     base::RepeatingClosure command)
    :{}

SurroundingTextTracker::Entry::Entry(const Entry&) = default;
SurroundingTextTracker::Entry::Entry(Entry&&) = default;
SurroundingTextTracker::Entry& SurroundingTextTracker::Entry::operator=(
    const Entry&) = default;
SurroundingTextTracker::Entry& SurroundingTextTracker::Entry::operator=(
    Entry&&) = default;
SurroundingTextTracker::Entry::~Entry() = default;

SurroundingTextTracker::SurroundingTextTracker() {}

SurroundingTextTracker::~SurroundingTextTracker() = default;

void SurroundingTextTracker::Reset() {}

void SurroundingTextTracker::CancelComposition() {}

SurroundingTextTracker::UpdateResult SurroundingTextTracker::Update(
    const std::u16string_view surrounding_text,
    size_t utf16_offset,
    const gfx::Range& selection) {}

void SurroundingTextTracker::OnSetEditableSelectionRange(
    const gfx::Range& range) {}

void SurroundingTextTracker::OnSetCompositionText(
    const ui::CompositionText& composition) {}

void SurroundingTextTracker::OnSetCompositionFromExistingText(
    const gfx::Range& range) {}

void SurroundingTextTracker::OnConfirmCompositionText(bool keep_selection) {}

void SurroundingTextTracker::OnClearCompositionText() {}

void SurroundingTextTracker::OnInsertText(
    const std::u16string_view text,
    TextInputClient::InsertTextCursorBehavior cursor_behavior) {}

void SurroundingTextTracker::OnExtendSelectionAndDelete(size_t before,
                                                        size_t after) {}

void SurroundingTextTracker::ResetInternal(std::u16string_view surrounding_text,
                                           size_t utf16_offset,
                                           const gfx::Range& selection) {}

}  // namespace ui