VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.h@ 103131

Last change on this file since 103131 was 100737, checked in by vboxsync, 18 months ago

API/FE/Qt: bugref:10466. bugref:10465. Adding a new event to signal successful uninstallation of extension pack. And GUI side of the code to handl this event.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.8 KB
Line 
1/* $Id: UIVirtualBoxEventHandler.h 100737 2023-07-30 09:48:13Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIVirtualBoxEventHandler class declaration.
4 */
5
6/*
7 * Copyright (C) 2010-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_globals_UIVirtualBoxEventHandler_h
29#define FEQT_INCLUDED_SRC_globals_UIVirtualBoxEventHandler_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QObject>
36
37/* GUI includes: */
38#include "UILibraryDefs.h"
39
40/* COM includes: */
41#include "COMEnums.h"
42#include "CMedium.h"
43#include "CMediumAttachment.h"
44
45/* Forward declarations: */
46class UIVirtualBoxEventHandlerProxy;
47
48/** Singleton QObject extension providing GUI with CVirtualBox event-source. */
49class SHARED_LIBRARY_STUFF UIVirtualBoxEventHandler : public QObject
50{
51 Q_OBJECT;
52
53signals:
54
55 /** Notifies about @a state change event for the machine with @a uId. */
56 void sigMachineStateChange(const QUuid &uId, const KMachineState state);
57 /** Notifies about data change event for the machine with @a uId. */
58 void sigMachineDataChange(const QUuid &uId);
59 /** Notifies about machine with @a uId was @a fRegistered. */
60 void sigMachineRegistered(const QUuid &uId, const bool fRegistered);
61 /** Notifies about machine with @a uId has groups changed. */
62 void sigMachineGroupsChange(const QUuid &uId);
63 /** Notifies about @a state change event for the session of the machine with @a uId. */
64 void sigSessionStateChange(const QUuid &uId, const KSessionState state);
65 /** Notifies about snapshot with @a uSnapshotId was taken for the machine with @a uId. */
66 void sigSnapshotTake(const QUuid &uId, const QUuid &uSnapshotId);
67 /** Notifies about snapshot with @a uSnapshotId was deleted for the machine with @a uId. */
68 void sigSnapshotDelete(const QUuid &uId, const QUuid &uSnapshotId);
69 /** Notifies about snapshot with @a uSnapshotId was changed for the machine with @a uId. */
70 void sigSnapshotChange(const QUuid &uId, const QUuid &uSnapshotId);
71 /** Notifies about snapshot with @a uSnapshotId was restored for the machine with @a uId. */
72 void sigSnapshotRestore(const QUuid &uId, const QUuid &uSnapshotId);
73 /** Notifies about request to uninstall cloud provider with @a uId. */
74 void sigCloudProviderUninstall(const QUuid &uId);
75 /** Notifies about cloud provider list changed. */
76 void sigCloudProviderListChanged();
77 /** Notifies about cloud profile with specified @a strName of provider with specified @a uProviderId is @a fRegistered. */
78 void sigCloudProfileRegistered(const QUuid &uProviderId, const QString &strName, bool fRegistered);
79 /** Notifies about cloud profile with specified @a strName of provider with specified @a uProviderId is changed. */
80 void sigCloudProfileChanged(const QUuid &uProviderId, const QString &strName);
81
82 /** Notifies about storage controller change.
83 * @param uMachineId Brings the ID of machine corresponding controller belongs to.
84 * @param strControllerName Brings the name of controller this event is related to. */
85 void sigStorageControllerChange(const QUuid &uMachineId, const QString &strControllerName);
86 /** Notifies about storage device change.
87 * @param comAttachment Brings corresponding attachment.
88 * @param fRemoved Brings whether medium is removed or added.
89 * @param fSilent Brings whether this change has gone silent for guest. */
90 void sigStorageDeviceChange(CMediumAttachment comAttachment, bool fRemoved, bool fSilent);
91 /** Notifies about storage medium @a comAttachment state change. */
92 void sigMediumChange(CMediumAttachment comAttachment);
93 /** Notifies about storage @a comMedium config change. */
94 void sigMediumConfigChange(CMedium comMedium);
95 /** Notifies about storage medium is (un)registered.
96 * @param uMediumId Brings corresponding medium ID.
97 * @param enmMediumType Brings corresponding medium type.
98 * @param fRegistered Brings whether medium is registered or unregistered. */
99 void sigMediumRegistered(const QUuid &uMediumId, KDeviceType enmMediumType, bool fRegistered);
100 /** Notifies extension pack. install.
101 * @param strName Passes extension pack name. */
102 void sigExtensionPackInstalled(const QString &strName);
103 /** Notifies extension pack. uninstall.
104 * @param strName Passes extension pack name. */
105 void sigExtensionPackUninstalled(const QString &strName);
106
107public:
108
109 /** Returns singleton instance. */
110 static UIVirtualBoxEventHandler *instance();
111 /** Destroys singleton instance. */
112 static void destroy();
113
114protected:
115
116 /** Constructs VirtualBox event handler. */
117 UIVirtualBoxEventHandler();
118
119 /** Prepares all. */
120 void prepare();
121 /** Prepares connections. */
122 void prepareConnections();
123
124private:
125
126 /** Holds the singleton instance. */
127 static UIVirtualBoxEventHandler *s_pInstance;
128
129 /** Holds the VirtualBox event proxy instance. */
130 UIVirtualBoxEventHandlerProxy *m_pProxy;
131};
132
133/** Singleton VirtualBox Event Handler 'official' name. */
134#define gVBoxEvents UIVirtualBoxEventHandler::instance()
135
136#endif /* !FEQT_INCLUDED_SRC_globals_UIVirtualBoxEventHandler_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