VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.h@ 82781

Last change on this file since 82781 was 81592, checked in by vboxsync, 5 years ago

FE/Qt: bugref:9598: Introducing UIMousePointerShapeData, a separate class for wrapping consolidated mouse pointer shape information; Using it to wrap data received via Main API events and pass through GUI to subscribed listeners.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.2 KB
Line 
1/* $Id: UIConsoleEventHandler.h 81592 2019-10-30 16:39:09Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIConsoleEventHandler class declaration.
4 */
5
6/*
7 * Copyright (C) 2010-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef FEQT_INCLUDED_SRC_runtime_UIConsoleEventHandler_h
19#define FEQT_INCLUDED_SRC_runtime_UIConsoleEventHandler_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/* Qt includes: */
25#include <QObject>
26#include <QRect>
27
28/* COM includes: */
29#include "COMEnums.h"
30#include "CVirtualBoxErrorInfo.h"
31#include "CMediumAttachment.h"
32#include "CNetworkAdapter.h"
33#include "CUSBDevice.h"
34
35/* Forward declarations: */
36class UIConsoleEventHandlerProxy;
37class UIMousePointerShapeData;
38class UISession;
39
40
41/** Singleton QObject extension
42 * providing GUI with the CConsole event-source. */
43class UIConsoleEventHandler : public QObject
44{
45 Q_OBJECT;
46
47signals:
48
49 /** Notifies about mouse pointer @a shapeData change. */
50 void sigMousePointerShapeChange(const UIMousePointerShapeData &shapeData);
51 /** Notifies about mouse capability change to @a fSupportsAbsolute, @a fSupportsRelative, @a fSupportsMultiTouch and @a fNeedsHostCursor. */
52 void sigMouseCapabilityChange(bool fSupportsAbsolute, bool fSupportsRelative, bool fSupportsMultiTouch, bool fNeedsHostCursor);
53 /** Notifies about guest request to change the cursor position to @a uX * @a uY.
54 * @param fContainsData Brings whether the @a uX and @a uY values are valid and could be used by the GUI now. */
55 void sigCursorPositionChange(bool fContainsData, unsigned long uX, unsigned long uY);
56 /** Notifies about keyboard LEDs change for @a fNumLock, @a fCapsLock and @a fScrollLock. */
57 void sigKeyboardLedsChangeEvent(bool fNumLock, bool fCapsLock, bool fScrollLock);
58 /** Notifies about machine @a state change. */
59 void sigStateChange(KMachineState state);
60 /** Notifies about guest additions state change. */
61 void sigAdditionsChange();
62 /** Notifies about network @a adapter state change. */
63 void sigNetworkAdapterChange(CNetworkAdapter adapter);
64 /** Notifies about storage device change for @a attachment, which was @a fRemoved and it was @a fSilent for guest. */
65 void sigStorageDeviceChange(CMediumAttachment attachment, bool fRemoved, bool fSilent);
66 /** Notifies about storage medium @a attachment state change. */
67 void sigMediumChange(CMediumAttachment attachment);
68 /** Notifies about VRDE device state change. */
69 void sigVRDEChange();
70 /** Notifies about recording state change. */
71 void sigRecordingChange();
72 /** Notifies about USB controller state change. */
73 void sigUSBControllerChange();
74 /** Notifies about USB @a device state change to @a fAttached, holding additional @a error information. */
75 void sigUSBDeviceStateChange(CUSBDevice device, bool fAttached, CVirtualBoxErrorInfo error);
76 /** Notifies about shared folder state change. */
77 void sigSharedFolderChange();
78 /** Notifies about CPU execution-cap change. */
79 void sigCPUExecutionCapChange();
80 /** Notifies about guest-screen configuration change of @a type for @a uScreenId with @a screenGeo. */
81 void sigGuestMonitorChange(KGuestMonitorChangedEventType type, ulong uScreenId, QRect screenGeo);
82 /** Notifies about Runtime error with @a strErrorId which is @a fFatal and have @a strMessage. */
83 void sigRuntimeError(bool fFatal, QString strErrorId, QString strMessage);
84#ifdef RT_OS_DARWIN
85 /** Notifies about VM window should be shown. */
86 void sigShowWindow();
87#endif /* RT_OS_DARWIN */
88 /** Notifies about audio adapter state change. */
89 void sigAudioAdapterChange();
90 /** Notifies clipboard mode change. */
91 void sigClipboardModeChange(KClipboardMode enmMode);
92 /** Notifies drag and drop mode change. */
93 void sigDnDModeChange(KDnDMode enmMode);
94
95public:
96
97 /** Returns singleton instance created by the factory. */
98 static UIConsoleEventHandler* instance() { return m_spInstance; }
99 /** Creates singleton instance created by the factory. */
100 static void create(UISession *pSession);
101 /** Destroys singleton instance created by the factory. */
102 static void destroy();
103
104protected:
105
106 /** Constructs console event handler for passed @a pSession. */
107 UIConsoleEventHandler(UISession *pSession);
108
109 /** @name Prepare cascade.
110 * @{ */
111 /** Prepares all. */
112 void prepare();
113 /** Prepares connections. */
114 void prepareConnections();
115 /** @} */
116
117private:
118
119 /** Holds the singleton static console event handler instance. */
120 static UIConsoleEventHandler *m_spInstance;
121
122 /** Holds the console event proxy instance. */
123 UIConsoleEventHandlerProxy *m_pProxy;
124};
125
126/** Defines the globally known name for the console event handler instance. */
127#define gConsoleEvents UIConsoleEventHandler::instance()
128
129#endif /* !FEQT_INCLUDED_SRC_runtime_UIConsoleEventHandler_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use