VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h@ 102493

Last change on this file since 102493 was 99948, checked in by vboxsync, 17 months ago

FE/Qt: bugref:10451. Small cleaning.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 KB
Line 
1/* $Id: UISoftKeyboard.h 99948 2023-05-24 08:11:12Z 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/* COM includes: */
38#include "COMDefs.h"
39
40/* GUI includes: */
41#include "QIWithRestorableGeometry.h"
42#include "QIWithRetranslateUI.h"
43
44/* Forward declarations: */
45class QHBoxLayout;
46class QToolButton;
47class UIKeyboardLayoutEditor;
48class UILayoutSelector;
49class UIMachine;
50class UISoftKeyboardKey;
51class UISoftKeyboardSettingsWidget;
52class UISoftKeyboardStatusBarWidget;
53class UISoftKeyboardWidget;
54class QSplitter;
55class QStackedWidget;
56
57/* Type definitions: */
58typedef QIWithRestorableGeometry<QMainWindow> QMainWindowWithRestorableGeometry;
59typedef QIWithRetranslateUI<QMainWindowWithRestorableGeometry> QMainWindowWithRestorableGeometryAndRetranslateUi;
60
61class UISoftKeyboard : public QMainWindowWithRestorableGeometryAndRetranslateUi
62{
63 Q_OBJECT;
64
65signals:
66
67 void sigClose();
68
69public:
70
71 UISoftKeyboard(QWidget *pParent, UIMachine *pMachine,
72 QWidget *pCenterWidget, QString strMachineName = QString());
73
74protected:
75
76 virtual void retranslateUi() RT_OVERRIDE;
77 virtual bool shouldBeMaximized() const RT_OVERRIDE;
78 virtual void closeEvent(QCloseEvent *event) RT_OVERRIDE;
79 bool event(QEvent *pEvent) RT_OVERRIDE;
80
81private slots:
82
83 void sltKeyboardLedsChange();
84 void sltPutKeyboardSequence(QVector<LONG> sequence);
85 void sltPutUsageCodesPress(QVector<QPair<LONG, LONG> > sequence);
86 void sltPutUsageCodesRelease(QVector<QPair<LONG, LONG> > sequence);
87
88 /** Handles the signal we get from the layout selector widget.
89 * Selection changed is forwarded to the keyboard widget. */
90 void sltLayoutSelectionChanged(const QUuid &layoutUid);
91 /** Handles the signal we get from the keyboard widget. */
92 void sltCurentLayoutChanged();
93 void sltShowLayoutSelector();
94 void sltShowLayoutEditor();
95 void sltKeyToEditChanged(UISoftKeyboardKey* pKey);
96 void sltLayoutEdited();
97 /** Make th necessary changes to data structures when th key captions updated. */
98 void sltKeyCaptionsEdited(UISoftKeyboardKey* pKey);
99 void sltShowHideSidePanel();
100 void sltShowHideSettingsWidget();
101 void sltHandleColorThemeListSelection(const QString &strColorThemeName);
102 void sltHandleKeyboardWidgetColorThemeChange();
103 void sltCopyLayout();
104 void sltSaveLayout();
105 void sltDeleteLayout();
106 void sltStatusBarMessage(const QString &strMessage);
107 void sltShowHideOSMenuKeys(bool fShow);
108 void sltShowHideNumPad(bool fShow);
109 void sltShowHideMultimediaKeys(bool fHide);
110 void sltHandleColorCellClick(int iColorRow);
111 void sltResetKeyboard();
112 void sltHandleHelpRequest();
113 void sltSaveSettings();
114 void sltReleaseKeys();
115
116private:
117
118 void prepareObjects();
119 void prepareConnections();
120 void loadSettings();
121 void saveCustomColorTheme();
122 void saveSelectedColorThemeName();
123 void saveCurrentLayout();
124 void saveDialogGeometry();
125 void configure();
126 void updateStatusBarMessage(const QString &strLayoutName);
127 void updateLayoutSelectorList();
128
129 UIMachine *m_pMachine;
130 QWidget *m_pCenterWidget;
131 QHBoxLayout *m_pMainLayout;
132 QString m_strMachineName;
133 QSplitter *m_pSplitter;
134 QStackedWidget *m_pSidePanelWidget;
135 UISoftKeyboardWidget *m_pKeyboardWidget;
136 UIKeyboardLayoutEditor *m_pLayoutEditor;
137 UILayoutSelector *m_pLayoutSelector;
138
139 UISoftKeyboardSettingsWidget *m_pSettingsWidget;
140 UISoftKeyboardStatusBarWidget *m_pStatusBarWidget;
141 int m_iGeometrySaveTimerId;
142};
143
144#endif /* !FEQT_INCLUDED_SRC_softkeyboard_UISoftKeyboard_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette