- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
112 lines
3.0 KiB
C++
112 lines
3.0 KiB
C++
|
|
|
|
#pragma once
|
|
#include "LtsKeyPushButton.h"
|
|
#include "ltsvirtualkeyboard_export.h"
|
|
|
|
#include <LtsSession/lts_session.h>
|
|
#include <QObject>
|
|
|
|
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& notTranslatedValue,
|
|
const QString& notTranslatedValueAlt = 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;
|
|
};
|
|
|
|
} // namespace LtsVirtualKeyboard
|