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
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2018-04-26 14:42:33 +02:00
|
|
|
#ifndef QSK_TEXT_PREDICTOR_H
|
|
|
|
#define QSK_TEXT_PREDICTOR_H
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-04-26 14:42:33 +02:00
|
|
|
#include <QskGlobal.h>
|
2017-07-21 18:21:34 +02:00
|
|
|
#include <QObject>
|
|
|
|
|
2018-04-26 14:42:33 +02:00
|
|
|
// abstract base class for input methods for retrieving predictive text
|
|
|
|
|
|
|
|
class QSK_EXPORT QskTextPredictor : public QObject
|
2017-07-21 18:21:34 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-04-20 08:52:26 +02:00
|
|
|
enum Attribute
|
|
|
|
{
|
|
|
|
Words = 1 << 0
|
|
|
|
};
|
|
|
|
|
|
|
|
Q_ENUM( Attribute )
|
|
|
|
Q_DECLARE_FLAGS( Attributes, Attribute )
|
|
|
|
|
2018-04-26 14:42:33 +02:00
|
|
|
virtual ~QskTextPredictor();
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-04-26 14:42:33 +02:00
|
|
|
virtual void request( const QString& text ) = 0;
|
|
|
|
virtual void reset() = 0;
|
2018-04-20 08:52:26 +02:00
|
|
|
|
|
|
|
virtual int candidateCount() const = 0;
|
|
|
|
virtual QString candidate( int ) const = 0;
|
2018-03-30 01:15:05 -07:00
|
|
|
|
2018-04-20 08:52:26 +02:00
|
|
|
Attributes attributes() const;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
2018-04-26 14:42:33 +02:00
|
|
|
void predictionChanged();
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-04-23 14:06:40 +02:00
|
|
|
protected:
|
2018-04-26 14:42:33 +02:00
|
|
|
QskTextPredictor( Attributes, QObject* );
|
2018-04-23 14:06:40 +02:00
|
|
|
|
2017-07-21 18:21:34 +02:00
|
|
|
private:
|
2018-04-20 08:52:26 +02:00
|
|
|
const Attributes m_attributes;
|
|
|
|
};
|
2018-04-11 11:02:29 +02:00
|
|
|
|
2018-03-30 18:31:13 +02:00
|
|
|
#endif
|