1 | /* $Id: UIConsoleEventHandler.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIConsoleEventHandler class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-2024 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_runtime_UIConsoleEventHandler_h
|
---|
29 | #define FEQT_INCLUDED_SRC_runtime_UIConsoleEventHandler_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QObject>
|
---|
36 | #include <QRect>
|
---|
37 |
|
---|
38 | /* COM includes: */
|
---|
39 | #include "CMediumAttachment.h"
|
---|
40 | #include "CNetworkAdapter.h"
|
---|
41 | #include "CUSBDevice.h"
|
---|
42 | #include "CVirtualBoxErrorInfo.h"
|
---|
43 | #include "KClipboardMode.h"
|
---|
44 | #include "KDnDMode.h"
|
---|
45 | #include "KGuestMonitorChangedEventType.h"
|
---|
46 | #include "KMachineState.h"
|
---|
47 |
|
---|
48 | /* Forward declarations: */
|
---|
49 | class UIConsoleEventHandlerProxy;
|
---|
50 | class UIMousePointerShapeData;
|
---|
51 | class UISession;
|
---|
52 |
|
---|
53 |
|
---|
54 | /** QObject subclass
|
---|
55 | * providing GUI with the CConsole event-source. */
|
---|
56 | class UIConsoleEventHandler : public QObject
|
---|
57 | {
|
---|
58 | Q_OBJECT;
|
---|
59 |
|
---|
60 | signals:
|
---|
61 |
|
---|
62 | /** Notifies about mouse pointer @a shapeData change. */
|
---|
63 | void sigMousePointerShapeChange(const UIMousePointerShapeData &shapeData);
|
---|
64 | /** Notifies about mouse capability change to @a fSupportsAbsolute, @a fSupportsRelative,
|
---|
65 | * @a fSupportsTouchScreen, @a fSupportsTouchPad and @a fNeedsHostCursor. */
|
---|
66 | void sigMouseCapabilityChange(bool fSupportsAbsolute, bool fSupportsRelative,
|
---|
67 | bool fSupportsTouchScreen, bool fSupportsTouchPad,
|
---|
68 | bool fNeedsHostCursor);
|
---|
69 | /** Notifies about guest request to change the cursor position to @a uX * @a uY.
|
---|
70 | * @param fContainsData Brings whether the @a uX and @a uY values are valid and could be used by the GUI now. */
|
---|
71 | void sigCursorPositionChange(bool fContainsData, unsigned long uX, unsigned long uY);
|
---|
72 | /** Notifies about keyboard LEDs change for @a fNumLock, @a fCapsLock and @a fScrollLock. */
|
---|
73 | void sigKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
|
---|
74 | /** Notifies about machine @a state change. */
|
---|
75 | void sigStateChange(KMachineState state);
|
---|
76 | /** Notifies about guest additions state change. */
|
---|
77 | void sigAdditionsChange();
|
---|
78 | /** Notifies about network @a adapter state change. */
|
---|
79 | void sigNetworkAdapterChange(CNetworkAdapter adapter);
|
---|
80 | /** Notifies about storage device change for @a attachment, which was @a fRemoved and it was @a fSilent for guest. */
|
---|
81 | void sigStorageDeviceChange(CMediumAttachment attachment, bool fRemoved, bool fSilent);
|
---|
82 | /** Notifies about storage medium @a attachment state change. */
|
---|
83 | void sigMediumChange(CMediumAttachment attachment);
|
---|
84 | /** Notifies about VRDE device state change. */
|
---|
85 | void sigVRDEChange();
|
---|
86 | /** Notifies about recording state change. */
|
---|
87 | void sigRecordingChange();
|
---|
88 | /** Notifies about USB controller state change. */
|
---|
89 | void sigUSBControllerChange();
|
---|
90 | /** Notifies about USB @a device state change to @a fAttached, holding additional @a error information. */
|
---|
91 | void sigUSBDeviceStateChange(CUSBDevice device, bool fAttached, CVirtualBoxErrorInfo error);
|
---|
92 | /** Notifies about shared folder state change. */
|
---|
93 | void sigSharedFolderChange();
|
---|
94 | /** Notifies about CPU execution-cap change. */
|
---|
95 | void sigCPUExecutionCapChange();
|
---|
96 | /** Notifies about guest-screen configuration change of @a type for @a uScreenId with @a screenGeo. */
|
---|
97 | void sigGuestMonitorChange(KGuestMonitorChangedEventType type, ulong uScreenId, QRect screenGeo);
|
---|
98 | /** Notifies about Runtime error with @a strErrorId which is @a fFatal and have @a strMessage. */
|
---|
99 | void sigRuntimeError(bool fFatal, QString strErrorId, QString strMessage);
|
---|
100 | #ifdef VBOX_WS_MAC
|
---|
101 | /** Notifies about VM window should be shown. */
|
---|
102 | void sigShowWindow();
|
---|
103 | #endif /* VBOX_WS_MAC */
|
---|
104 | /** Notifies about audio adapter state change. */
|
---|
105 | void sigAudioAdapterChange();
|
---|
106 | /** Notifies clipboard mode change. */
|
---|
107 | void sigClipboardModeChange(KClipboardMode enmMode);
|
---|
108 | /** Notifies about a clipboard error. */
|
---|
109 | void sigClipboardError(const QString &strMsg);
|
---|
110 | /** Notifies drag and drop mode change. */
|
---|
111 | void sigDnDModeChange(KDnDMode enmMode);
|
---|
112 |
|
---|
113 | public:
|
---|
114 |
|
---|
115 | /** Constructs console event handler for passed @a pSession. */
|
---|
116 | UIConsoleEventHandler(UISession *pSession);
|
---|
117 |
|
---|
118 | private:
|
---|
119 |
|
---|
120 | /** Prepares all. */
|
---|
121 | void prepare();
|
---|
122 |
|
---|
123 | /** Holds the console event proxy instance. */
|
---|
124 | UIConsoleEventHandlerProxy *m_pProxy;
|
---|
125 | };
|
---|
126 |
|
---|
127 | #endif /* !FEQT_INCLUDED_SRC_runtime_UIConsoleEventHandler_h */
|
---|