chromium/ui/base/ime/character_composer.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

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

#include <algorithm>
#include <iterator>
#include <optional>
#include <string>

#include "base/check.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversion_utils.h"
#include "base/strings/utf_string_conversions.h"
#include "base/third_party/icu/icu_utf.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/dom/dom_key.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/events/keycodes/keyboard_codes.h"

namespace {

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

bool CheckCharacterComposeTable(
    const ui::CharacterComposer::ComposeBuffer& compose_sequence,
    uint32_t* composed_character) {}

// Converts |character| to UTF16 string.
// Returns false when |character| is not a valid character.
bool UTF32CharacterToUTF16(uint32_t character, std::u16string* output) {}

// Returns an hexadecimal digit integer (0 to 15) corresponding to |keycode|.
// -1 is returned when |keycode| cannot be a hexadecimal digit.
int KeycodeToHexDigit(unsigned int keycode) {}

// `ui::DomKey` only offers `ToDeadKeyCombiningCharacter()`, but we need the
// non-combining character for the dead key for the preedit string. If we use
// the combining character, it may combine with the character preceding the
// preedit string, which is unwanted and confusing.
std::optional<char16_t> DeadKeyToNonCombiningCharacter(ui::DomKey dom_key) {}

}  // namespace

namespace ui {

CharacterComposer::CharacterComposer(PreeditStringMode mode)
    :{}

CharacterComposer::~CharacterComposer() = default;

void CharacterComposer::Reset() {}

bool CharacterComposer::FilterKeyPress(const ui::KeyEvent& event) {}

bool CharacterComposer::FilterKeyPressSequenceMode(const KeyEvent& event) {}

void CharacterComposer::UpdatePreeditStringSequenceMode() {}

bool CharacterComposer::FilterKeyPressHexMode(const KeyEvent& event) {}

void CharacterComposer::CommitHex() {}

void CharacterComposer::UpdatePreeditStringHexMode() {}

ComposeChecker::CheckSequenceResult TreeComposeChecker::CheckSequence(
    const ui::CharacterComposer::ComposeBuffer& sequence,
    uint32_t* composed_character) const {}

bool TreeComposeChecker::Find(uint16_t index,
                              uint16_t size,
                              uint16_t key,
                              uint16_t* value) const {}

}  // namespace ui