caret 从纯显示状态升级为查询管线输入:set_caret 量化到最后一个完整 音节单元边界(只消费 segment_raw_boundaries,#187 契约),前缀候选 独立解码、preedit 保持全串拼音风格;纯移动光标同样重算候选。 IInputScheme::set_raw_input 提升为接口方法以支持不动现场组合的 独立前缀查询。runtime_isolation 两处按 R3/R4 新语义改写(caret 在 音节中间 floor 到空前缀、候选为空是预期状态);新增 caret 前缀 会话单测(engine/tests + server CI 目标,隔离词库夹具,覆盖 全拼 floor、双拼贪心配对、五笔无单元模型、boundary=0 空候选)。
22 lines
807 B
C++
22 lines
807 B
C++
#pragma once
|
|
|
|
#include "../core/query_request.h"
|
|
#include "../core/scheme_type.h"
|
|
#include <string>
|
|
|
|
class IInputScheme
|
|
{
|
|
public:
|
|
virtual ~IInputScheme() = default;
|
|
|
|
virtual void reset() = 0;
|
|
virtual void handle_key(ImeKeyCode vk, ImeModifierMask modifiers_down, ImeCharacter wch) = 0;
|
|
// Host-driven replacement of the composed raw string (middle editing, caret prefix
|
|
// decoding). Every scheme implements it; the interface only carries it so callers holding
|
|
// the base pointer can run standalone queries without downcasting.
|
|
virtual void set_raw_input(const std::string &raw_input, const std::string &raw_input_with_cases) = 0;
|
|
virtual QueryRequest build_request() const = 0;
|
|
virtual std::string get_preedit() const = 0;
|
|
virtual SchemeType type() const = 0;
|
|
};
|