qskinny/src/inputpanel/QskVirtualKeyboard.h

70 lines
1.5 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 Action
{
Compose = 0x10,
2018-04-04 20:19:47 +02:00
SelectCandidate = 0x11,
2017-07-21 18:21:34 +02:00
};
Q_ENUM( Action )
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-06 17:30:24 +02:00
Q_SIGNALS:
void modeChanged( Mode );
public Q_SLOTS:
2018-04-02 17:01:04 +02:00
void setPreeditCandidates( const QVector< QString >& );
2018-04-06 09:00:09 +02:00
void setCandidateBarVisible( bool visible );
2017-07-21 18:21:34 +02:00
protected:
2018-04-03 20:15:20 +02:00
virtual bool eventFilter( QObject*, QEvent* ) override;
2018-04-09 10:05:59 +02:00
virtual bool event( QEvent* ) override;
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