98 lines
3.1 KiB
C++
Executable File
98 lines
3.1 KiB
C++
Executable File
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "LtsKeyPushButton.h"
|
|
#include <LtsVirtualKeyboard/ltsvirtualkeyboard_export.h>
|
|
#include <LtsSession/lts_session.h>
|
|
|
|
class QClipboard;
|
|
class QLabel;
|
|
class QLineEdit;
|
|
class QSize;
|
|
class QTextEdit;
|
|
|
|
namespace LtsVirtualKeyboard
|
|
{
|
|
|
|
class LTSVIRTUALKEYBOARD_EXPORT LtsVirtualKeyboard : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
|
|
private:
|
|
LtsVirtualKeyboard(LtsSession::LtsSession *session, QWidget *activeForm = nullptr, bool onlyNumericPad = false, QWidget *parent = nullptr);
|
|
~LtsVirtualKeyboard();
|
|
|
|
public:
|
|
static LtsVirtualKeyboard *getInstance(LtsSession::LtsSession *session, QWidget *activeForm = nullptr, bool onlyNumericPad = false, QWidget *parent = nullptr);
|
|
static void cleanupLtsVirtualKeyboard();
|
|
|
|
void createKeyboard();
|
|
bool statusEchoMode() const { return (m_echoMode); }
|
|
void setStatusEchoMode(bool echo) { m_echoMode = echo; }
|
|
void receiptChildKey(QWidget *focusThisControl = nullptr, QKeyEvent *event = nullptr, bool reset = false);
|
|
void switchKeyEchoMode(QWidget *control);
|
|
void enableSwitchingEcho(bool status);
|
|
bool isEnabledSwitchingEcho() const;
|
|
void borderFrame(bool visible = true);
|
|
void checkInput();
|
|
QWidget *setDefaultTextStyle(QWidget *control);
|
|
bool isNumericPad() const;
|
|
QLabel *zoomedWidget();
|
|
void setActiveWindw(QWidget *widget) { m_activeWindow = widget; }
|
|
void setSession(LtsSession::LtsSession *session) { m_session= session; }
|
|
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
void show(QWidget *first = nullptr, bool frameless = false);
|
|
void hide(bool changeColor);
|
|
void focusThis(QWidget *control, bool numpad = false);
|
|
|
|
protected:
|
|
void closeEvent(QCloseEvent *event) override;
|
|
|
|
private:
|
|
QSize availableDesktopSize() const;
|
|
void init_keyboard(QWidget *focusThisControl);
|
|
QWidget *setCurrentTextStyle(QWidget *control);
|
|
LtsKeyPushButton *createNewKey(const QString &keyValue, const QString ¬TranslatedValue, const QString ¬TranslatedValueAlt = QString());
|
|
QWidget *getNextTextbox(QWidget *thisControl = nullptr, bool reset = false);
|
|
void controlKeyEcho(QWidget *control);
|
|
void setTextToCurrentWidget(const QString &text);
|
|
QString getTextFromCurrentWidget();
|
|
QString getCurretText()const;
|
|
void setCurrentText(const QString &text);
|
|
int getCurrentTextCursorPosition();
|
|
void setCurrentTextCursorPosition(int cursor);
|
|
bool hasSelection() const;
|
|
QString getSelectedText() const;
|
|
int getSelectionStart() const;
|
|
void reinit();
|
|
private:
|
|
|
|
QTextEdit *m_te;
|
|
QLineEdit *m_le;
|
|
|
|
QWidget *m_nextInput;
|
|
QWidget *m_activeWindow;
|
|
bool m_echoMode;
|
|
bool m_enablePasswordEcho;
|
|
bool m_numericPad;
|
|
bool m_isAlt;
|
|
bool m_isCap;
|
|
bool m_enableEnter;
|
|
bool m_ready;
|
|
|
|
int m_height;
|
|
QClipboard *m_clipboard;
|
|
LtsSession::LtsSession *m_session;
|
|
|
|
};
|
|
|
|
}
|