blob: 2a18419db45fc2dcd7be7da7b397fa3587a9ea14 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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;
};
|