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