qskinny/src/inputpanel/QskVirtualKeyboard.h

61 lines
1.4 KiB
C
Raw Normal View History

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
*****************************************************************************/
#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
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 )
QskVirtualKeyboard( QQuickItem* parent = nullptr );
virtual ~QskVirtualKeyboard() override;
2017-07-21 18:21:34 +02:00
2018-04-02 17:01:04 +02:00
virtual QskAspect::Subcontrol effectiveSubcontrol(
QskAspect::Subcontrol ) const override;
2018-03-22 15:48:29 +01:00
2018-04-02 17:01:04 +02:00
void updateLocale( const QLocale& );
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-04-12 12:03:51 +02:00
virtual qreal heightForWidth( qreal width ) const override;
virtual qreal widthForHeight( qreal height ) const override;
virtual QSizeF contentsSizeHint() const override;
2018-04-12 12:03:51 +02:00
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 );
2017-07-21 18:21:34 +02:00
protected:
2018-03-21 13:00:24 +01:00
virtual void updateLayout() override;
2017-07-21 18:21:34 +02:00
2018-04-06 17:30:24 +02:00
private Q_SLOTS:
void buttonPressed();
2017-07-21 18:21:34 +02:00
private:
2017-07-21 18:21:34 +02:00
class PrivateData;
std::unique_ptr< PrivateData > m_data;
};
#endif