diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-11-10 02:13:15 +0100 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-18 16:53:47 +0100 |
commit | 5454494adbfad3148e75b45653a255004ca989b3 (patch) | |
tree | 6767a10a20d2ade594354c9d6918cf4948d3f5a8 /src/yuzu/applets/software_keyboard.h | |
parent | am/applets: Add connector between frontend and AM applet classes (diff) | |
download | yuzu-5454494adbfad3148e75b45653a255004ca989b3.tar yuzu-5454494adbfad3148e75b45653a255004ca989b3.tar.gz yuzu-5454494adbfad3148e75b45653a255004ca989b3.tar.bz2 yuzu-5454494adbfad3148e75b45653a255004ca989b3.tar.lz yuzu-5454494adbfad3148e75b45653a255004ca989b3.tar.xz yuzu-5454494adbfad3148e75b45653a255004ca989b3.tar.zst yuzu-5454494adbfad3148e75b45653a255004ca989b3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/yuzu/applets/software_keyboard.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/yuzu/applets/software_keyboard.h b/src/yuzu/applets/software_keyboard.h new file mode 100644 index 000000000..2a18419db --- /dev/null +++ b/src/yuzu/applets/software_keyboard.h @@ -0,0 +1,62 @@ +// Copyright 2018 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once +#include <QDialog> +#include <QValidator> +#include "common/assert.h" +#include "core/frontend/applets/software_keyboard.h" + +class QDialogButtonBox; +class QLabel; +class QLineEdit; +class QVBoxLayout; +class QtSoftwareKeyboard; + +class QtSoftwareKeyboardValidator final : public QValidator { +public: + explicit QtSoftwareKeyboardValidator(Frontend::SoftwareKeyboardApplet::Parameters parameters); + State validate(QString&, int&) const override; + +private: + Frontend::SoftwareKeyboardApplet::Parameters parameters; +}; + +class QtSoftwareKeyboardDialog final : public QDialog { + Q_OBJECT + +public: + QtSoftwareKeyboardDialog(QWidget* parent, + Frontend::SoftwareKeyboardApplet::Parameters parameters); + void Submit(); + void Reject(); + +private: + bool ok = false; + std::u16string text; + + QDialogButtonBox* buttons; + QLabel* header_label; + QLabel* sub_label; + QLabel* guide_label; + QLineEdit* line_edit; + QVBoxLayout* layout; + + Frontend::SoftwareKeyboardApplet::Parameters parameters; + + friend class QtSoftwareKeyboard; +}; + +class QtSoftwareKeyboard final : public QObject, public Frontend::SoftwareKeyboardApplet { +public: + explicit QtSoftwareKeyboard(QWidget& parent); + bool GetText(Parameters parameters, std::u16string& text) override; + + ~QtSoftwareKeyboard() { + UNREACHABLE(); + } + +private: + QWidget& parent; +}; |