2018-02-06 14:55:35 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
|
|
|
* This file may be used under the terms of the QSkinny License, Version 1.0
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2017-07-21 18:21:34 +02:00
|
|
|
#ifndef QSK_PINYIN_COMPOSITION_MODEL_H
|
|
|
|
#define QSK_PINYIN_COMPOSITION_MODEL_H
|
|
|
|
|
|
|
|
#include "QskInputCompositionModel.h"
|
|
|
|
|
|
|
|
class QskPinyinCompositionModel : public QskInputCompositionModel
|
|
|
|
{
|
2018-04-04 12:05:01 +02:00
|
|
|
using Inherited = QskInputCompositionModel;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
|
|
|
public:
|
2018-04-04 12:05:01 +02:00
|
|
|
QskPinyinCompositionModel( QObject* parent = nullptr );
|
2018-03-30 01:15:05 -07:00
|
|
|
virtual ~QskPinyinCompositionModel() override;
|
|
|
|
|
|
|
|
virtual bool supportsSuggestions() const override final;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-03-30 18:31:13 +02:00
|
|
|
virtual int candidateCount() const override;
|
|
|
|
virtual QString candidate( int ) const override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-03-30 18:31:13 +02:00
|
|
|
virtual QVector< Qt::Key > groups() const override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Used for text composition
|
2018-03-30 18:31:13 +02:00
|
|
|
virtual bool hasIntermediate() const override;
|
|
|
|
virtual QString polishPreedit( const QString& preedit ) override;
|
|
|
|
virtual bool isComposable( const QStringRef& preedit ) const override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
void handleGroupIndexChanged();
|
|
|
|
|
|
|
|
class PrivateData;
|
|
|
|
std::unique_ptr< PrivateData > m_data;
|
|
|
|
};
|
|
|
|
|
2018-03-30 18:31:13 +02:00
|
|
|
#endif
|