2017-07-21 18:21:34 +02:00
|
|
|
/******************************************************************************
|
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
|
|
|
*****************************************************************************/
|
|
|
|
|
2018-03-28 09:01:25 -07:00
|
|
|
#ifndef QSK_VIRTUAL_KEYBOARD_H
|
|
|
|
#define QSK_VIRTUAL_KEYBOARD_H
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-03-28 15:31:44 +02:00
|
|
|
#include "QskBox.h"
|
2018-03-14 17:30:37 +01:00
|
|
|
|
2018-03-28 09:01:25 -07:00
|
|
|
class QSK_EXPORT QskVirtualKeyboard : public QskBox
|
2017-07-21 18:21:34 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2018-03-28 15:31:44 +02:00
|
|
|
using Inherited = QskBox;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
|
|
|
public:
|
2018-04-06 17:30:24 +02:00
|
|
|
QSK_SUBCONTROLS( Panel, ButtonPanel, ButtonText )
|
2017-07-21 18:21:34 +02:00
|
|
|
|
|
|
|
enum Mode
|
|
|
|
{
|
|
|
|
CurrentMode = -1,
|
|
|
|
LowercaseMode,
|
|
|
|
UppercaseMode,
|
|
|
|
SpecialCharacterMode,
|
|
|
|
ModeCount
|
|
|
|
};
|
|
|
|
Q_ENUM( Mode )
|
|
|
|
|
2018-03-28 09:01:25 -07:00
|
|
|
QskVirtualKeyboard( QQuickItem* parent = nullptr );
|
2018-07-31 17:32:25 +02:00
|
|
|
~QskVirtualKeyboard() override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-04-06 17:30:24 +02:00
|
|
|
void setMode( Mode );
|
2017-07-21 18:21:34 +02:00
|
|
|
Mode mode() const;
|
|
|
|
|
2018-05-09 08:20:59 +02:00
|
|
|
void updateLocale( const QLocale& );
|
|
|
|
|
2018-07-31 17:32:25 +02:00
|
|
|
qreal heightForWidth( qreal width ) const override;
|
|
|
|
qreal widthForHeight( qreal height ) const override;
|
2018-05-30 11:47:46 +02:00
|
|
|
|
2018-07-31 17:32:25 +02:00
|
|
|
QSizeF contentsSizeHint() const override;
|
2018-04-12 12:03:51 +02:00
|
|
|
|
2018-07-31 17:32:25 +02:00
|
|
|
QskAspect::Subcontrol effectiveSubcontrol(
|
2018-05-09 08:20:59 +02:00
|
|
|
QskAspect::Subcontrol ) const override;
|
|
|
|
|
2018-06-03 11:01:22 +02:00
|
|
|
bool hasKey( int keyCode ) const;
|
|
|
|
|
2018-04-06 17:30:24 +02:00
|
|
|
Q_SIGNALS:
|
|
|
|
void modeChanged( Mode );
|
2018-04-13 16:32:48 +02:00
|
|
|
void keySelected( int keyCode );
|
2018-03-28 09:01:25 -07:00
|
|
|
|
2017-07-21 18:21:34 +02:00
|
|
|
protected:
|
2018-07-31 17:32:25 +02:00
|
|
|
void updateLayout() override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-05-30 11:47:46 +02:00
|
|
|
private:
|
2018-04-06 17:30:24 +02:00
|
|
|
void buttonPressed();
|
2017-07-21 18:21:34 +02:00
|
|
|
|
|
|
|
class PrivateData;
|
|
|
|
std::unique_ptr< PrivateData > m_data;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|