1 | /* $Id: UISoftKeyboard.h 103915 2024-03-19 12:34:07Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UISoftKeyboard class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2016-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef FEQT_INCLUDED_SRC_softkeyboard_UISoftKeyboard_h
|
---|
29 | #define FEQT_INCLUDED_SRC_softkeyboard_UISoftKeyboard_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QMainWindow>
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "QIWithRestorableGeometry.h"
|
---|
39 |
|
---|
40 | /* Forward declarations: */
|
---|
41 | class QHBoxLayout;
|
---|
42 | class QToolButton;
|
---|
43 | class UIKeyboardLayoutEditor;
|
---|
44 | class UILayoutSelector;
|
---|
45 | class UIMachine;
|
---|
46 | class UISoftKeyboardKey;
|
---|
47 | class UISoftKeyboardSettingsWidget;
|
---|
48 | class UISoftKeyboardStatusBarWidget;
|
---|
49 | class UISoftKeyboardWidget;
|
---|
50 | class QSplitter;
|
---|
51 | class QStackedWidget;
|
---|
52 |
|
---|
53 | /* Type definitions: */
|
---|
54 | typedef QIWithRestorableGeometry<QMainWindow> QMainWindowWithRestorableGeometry;
|
---|
55 |
|
---|
56 | class UISoftKeyboard : public QMainWindowWithRestorableGeometry
|
---|
57 | {
|
---|
58 | Q_OBJECT;
|
---|
59 |
|
---|
60 | signals:
|
---|
61 |
|
---|
62 | void sigClose();
|
---|
63 |
|
---|
64 | public:
|
---|
65 |
|
---|
66 | UISoftKeyboard(QWidget *pParent, UIMachine *pMachine,
|
---|
67 | QWidget *pCenterWidget, QString strMachineName = QString());
|
---|
68 |
|
---|
69 | protected:
|
---|
70 |
|
---|
71 | virtual bool shouldBeMaximized() const RT_OVERRIDE;
|
---|
72 | virtual void closeEvent(QCloseEvent *event) RT_OVERRIDE;
|
---|
73 | bool event(QEvent *pEvent) RT_OVERRIDE;
|
---|
74 |
|
---|
75 | private slots:
|
---|
76 |
|
---|
77 | /** Handles the signal we get from the layout selector widget.
|
---|
78 | * Selection changed is forwarded to the keyboard widget. */
|
---|
79 | void sltLayoutSelectionChanged(const QUuid &layoutUid);
|
---|
80 | /** Handles the signal we get from the keyboard widget. */
|
---|
81 | void sltCurentLayoutChanged();
|
---|
82 | void sltShowLayoutSelector();
|
---|
83 | void sltShowLayoutEditor();
|
---|
84 | void sltKeyToEditChanged(UISoftKeyboardKey* pKey);
|
---|
85 | void sltLayoutEdited();
|
---|
86 | /** Make th necessary changes to data structures when th key captions updated. */
|
---|
87 | void sltKeyCaptionsEdited(UISoftKeyboardKey* pKey);
|
---|
88 | void sltShowHideSidePanel();
|
---|
89 | void sltShowHideSettingsWidget();
|
---|
90 | void sltHandleColorThemeListSelection(const QString &strColorThemeName);
|
---|
91 | void sltHandleKeyboardWidgetColorThemeChange();
|
---|
92 | void sltCopyLayout();
|
---|
93 | void sltSaveLayout();
|
---|
94 | void sltDeleteLayout();
|
---|
95 | void sltStatusBarMessage(const QString &strMessage);
|
---|
96 | void sltShowHideOSMenuKeys(bool fShow);
|
---|
97 | void sltShowHideNumPad(bool fShow);
|
---|
98 | void sltShowHideMultimediaKeys(bool fHide);
|
---|
99 | void sltHandleColorCellClick(int iColorRow);
|
---|
100 | void sltResetKeyboard();
|
---|
101 | void sltHandleHelpRequest();
|
---|
102 | void sltSaveSettings();
|
---|
103 | void sltReleaseKeys();
|
---|
104 |
|
---|
105 | private:
|
---|
106 |
|
---|
107 | void prepareObjects();
|
---|
108 | void prepareConnections();
|
---|
109 | void loadSettings();
|
---|
110 | void saveCustomColorTheme();
|
---|
111 | void saveSelectedColorThemeName();
|
---|
112 | void saveCurrentLayout();
|
---|
113 | void saveDialogGeometry();
|
---|
114 | void configure();
|
---|
115 | void updateStatusBarMessage(const QString &strLayoutName);
|
---|
116 | void updateLayoutSelectorList();
|
---|
117 |
|
---|
118 | UIMachine *m_pMachine;
|
---|
119 | QWidget *m_pCenterWidget;
|
---|
120 | QHBoxLayout *m_pMainLayout;
|
---|
121 | QString m_strMachineName;
|
---|
122 | QSplitter *m_pSplitter;
|
---|
123 | QStackedWidget *m_pSidePanelWidget;
|
---|
124 | UISoftKeyboardWidget *m_pKeyboardWidget;
|
---|
125 | UIKeyboardLayoutEditor *m_pLayoutEditor;
|
---|
126 | UILayoutSelector *m_pLayoutSelector;
|
---|
127 |
|
---|
128 | UISoftKeyboardSettingsWidget *m_pSettingsWidget;
|
---|
129 | UISoftKeyboardStatusBarWidget *m_pStatusBarWidget;
|
---|
130 | int m_iGeometrySaveTimerId;
|
---|
131 | };
|
---|
132 |
|
---|
133 | #endif /* !FEQT_INCLUDED_SRC_softkeyboard_UISoftKeyboard_h */
|
---|