QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskInputPanelBox.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_INPUT_PANEL_BOX_H
7#define QSK_INPUT_PANEL_BOX_H
8
9#include "QskBox.h"
10
11class QskInputEngine;
13
14class QString;
15class QLocale;
16
17class QSK_EXPORT QskInputPanelBox : public QskBox
18{
19 Q_OBJECT
20
21 using Inherited = QskBox;
22
23 Q_PROPERTY( PanelHints panelHints READ panelHints
24 WRITE setPanelHints NOTIFY panelHintsChanged )
25
26 Q_PROPERTY( QString inputPrompt READ inputPrompt
27 WRITE setInputPrompt NOTIFY inputPromptChanged )
28
29 public:
30 QSK_SUBCONTROLS( Panel, ProxyPanel, ProxyText )
31
32 enum PanelHint
33 {
34 InputProxy = 1 << 0,
35 Prediction = 1 << 1
36 };
37
38 Q_ENUM( PanelHint )
39 Q_DECLARE_FLAGS( PanelHints, PanelHint )
40
41 QskInputPanelBox( QQuickItem* parent = nullptr );
42 ~QskInputPanelBox() override;
43
44 void attachInputItem( QQuickItem* );
45 QQuickItem* attachedInputItem() const;
46
47 void setPanelHint( PanelHint, bool on );
48
49 void setPanelHints( PanelHints );
50 PanelHints panelHints() const;
51
52 QQuickItem* inputProxy() const;
53
54 QString inputPrompt() const;
55
56 void setKeyboard( QskVirtualKeyboard* );
57
58 Q_SIGNALS:
59 void panelHintsChanged();
60 void inputPromptChanged( const QString& );
61
62 void keySelected( int keyCode );
63 void predictiveTextSelected( int );
64
65 public Q_SLOTS:
66 void setInputPrompt( const QString& );
67 void setPrediction( const QStringList& );
68
69 protected:
70 void keyPressEvent( QKeyEvent* ) override;
71
72 QskAspect::Subcontrol substitutedSubcontrol(
73 QskAspect::Subcontrol ) const override;
74
75 private:
76 class PrivateData;
77 std::unique_ptr< PrivateData > m_data;
78};
79
80Q_DECLARE_OPERATORS_FOR_FLAGS( QskInputPanelBox::PanelHints )
81Q_DECLARE_METATYPE( QskInputPanelBox::PanelHints )
82
83#endif
Subcontrol
For use within the rendering or lay-outing of a specific QskSkinnable.
Definition QskAspect.h:104