qskinny/src/inputpanel/QskTextPredictor.h

52 lines
1.1 KiB
C
Raw Normal View History

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
*****************************************************************************/
#ifndef QSK_TEXT_PREDICTOR_H
#define QSK_TEXT_PREDICTOR_H
2017-07-21 18:21:34 +02:00
#include <QskGlobal.h>
2018-07-19 14:10:48 +02:00
#include <qobject.h>
2017-07-21 18:21:34 +02:00
class QStringList;
// 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-07-31 17:32:25 +02:00
~QskTextPredictor() override;
2017-07-21 18:21:34 +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;
virtual QStringList candidates() const;
2018-04-20 08:52:26 +02:00
Attributes attributes() const;
2017-07-21 18:21:34 +02:00
Q_SIGNALS:
void predictionChanged();
2017-07-21 18:21:34 +02:00
protected:
QskTextPredictor( Attributes, QObject* );
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
#endif