Files
Renderive/Widget/base/Virtual_Keyboard/Input_Core.h
T
2026-07-29 12:30:40 +08:00

51 lines
1.5 KiB
C++

#pragma once
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QObject>
#include "googlepinyin/atomdictbase.h"
#include "googlepinyin/dictbuilder.h"
#include "googlepinyin/dictdef.h"
#include "googlepinyin/dictlist.h"
#include "googlepinyin/dicttrie.h"
#include "googlepinyin/lpicache.h"
#include "googlepinyin/matrixsearch.h"
#include "googlepinyin/mystdlib.h"
#include "googlepinyin/ngram.h"
#include "googlepinyin/pinyinime.h"
#include "googlepinyin/searchutility.h"
#include "googlepinyin/spellingtable.h"
#include "googlepinyin/spellingtrie.h"
#include "googlepinyin/splparser.h"
#include "googlepinyin/sync.h"
#include "googlepinyin/userdict.h"
#include "googlepinyin/utf16char.h"
#include "googlepinyin/utf16reader.h"
using namespace ime_pinyin;
namespace renderive {
class Input_Core : public QObject {
Q_OBJECT
Q_PROPERTY(bool m_able READ get_enable WRITE set_enable NOTIFY signal_input_able)
public:
explicit Input_Core(QObject* parent = nullptr);
~Input_Core() override;
bool init(int max_spell_len = 64, int max_out_len = 64);
void deinit();
unsigned int search(const QString& spell);
int cur_search_pos();
void reset_search();
bool get_enable();
void set_enable(bool able);
QStringList get_candidate(unsigned int cnadnum);
signals :
void signal_input_able(bool);
private:
bool m_able = false;
int m_spell_len;
int m_out_len;
const QString dict_path = "dict_pinyin.dat";
const QString dict_user_path = "dict_pinyin_user.dat";
};
} // namespace renderive