QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskInputPanel.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_INPUT_PANEL_H
7#define QSK_INPUT_PANEL_H
8
9#include "QskControl.h"
10#include <memory>
11
13class QString;
14
15class QSK_EXPORT QskInputPanel : public QskControl
16{
17 Q_OBJECT
18
19 using Inherited = QskControl;
20
21 public:
22 QskInputPanel( QQuickItem* parent = nullptr );
23 ~QskInputPanel() override;
24
25 void attachInputItem( QQuickItem* );
26 void updateInputPanel( Qt::InputMethodQueries );
27
28 virtual QQuickItem* inputProxy() const;
29 QQuickItem* inputItem() const;
30
31 virtual Qt::Alignment alignment() const;
32
33 QStringList candidates() const;
34
35 public Q_SLOTS:
36 void commitKey( int keyCode );
37 void commitPredictiveText( int index );
38
39 Q_SIGNALS:
40 void keySelected( int keyCode );
41 void predictiveTextSelected( int );
42 void inputItemDestroyed();
43
44 void predictionReset();
45 void predictionRequested( const QString& text );
46
47 public Q_SLOTS:
48 virtual void setPrompt( const QString& );
49 virtual void setPrediction( const QStringList& );
50 virtual void setPredictionEnabled( bool );
51
52 protected:
53 virtual void attachItem( QQuickItem* ) = 0;
54
55 private:
56 void updatePrediction( const QString&, const QStringList& candidates );
57 void resetPredictor( const QLocale& );
58 void updateLocale( const QLocale& );
59
60 class PrivateData;
61 std::unique_ptr< PrivateData > m_data;
62};
63
64#endif
Base class of all controls.
Definition QskControl.h:23