[55401] | 1 | /* $Id: UIProgressEventHandler.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
[25178] | 2 | /** @file
|
---|
[75369] | 3 | * VBox Qt GUI - UIProgressEventHandler class declaration.
|
---|
[25178] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2009-2023 Oracle and/or its affiliates.
|
---|
[25178] | 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
|
---|
[25178] | 26 | */
|
---|
| 27 |
|
---|
[76581] | 28 | #ifndef FEQT_INCLUDED_SRC_globals_UIProgressEventHandler_h
|
---|
| 29 | #define FEQT_INCLUDED_SRC_globals_UIProgressEventHandler_h
|
---|
[76532] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
[25178] | 33 |
|
---|
[43857] | 34 | /* GUI includes: */
|
---|
[75369] | 35 | #include "UIMainEventListener.h"
|
---|
[25178] | 36 |
|
---|
[75369] | 37 | /* COM includes: */
|
---|
| 38 | # include "CEventListener.h"
|
---|
| 39 | # include "CEventSource.h"
|
---|
| 40 | # include "CProgress.h"
|
---|
[25178] | 41 |
|
---|
[68998] | 42 |
|
---|
[75369] | 43 | /** Private QObject extension
|
---|
| 44 | * providing UIExtraDataManager with the CVirtualBox event-source. */
|
---|
| 45 | class SHARED_LIBRARY_STUFF UIProgressEventHandler : public QObject
|
---|
[25178] | 46 | {
|
---|
| 47 | Q_OBJECT;
|
---|
| 48 |
|
---|
[69000] | 49 | signals:
|
---|
| 50 |
|
---|
[75369] | 51 | /** Notifies about @a iPercent change for progress with @a uProgressId. */
|
---|
| 52 | void sigProgressPercentageChange(const QUuid &uProgressId, const int iPercent);
|
---|
| 53 | /** Notifies about task complete for progress with @a uProgressId. */
|
---|
| 54 | void sigProgressTaskComplete(const QUuid &uProgressId);
|
---|
[86324] | 55 | /** Notifies about handling has finished. */
|
---|
| 56 | void sigHandlingFinished();
|
---|
[69000] | 57 |
|
---|
[25178] | 58 | public:
|
---|
| 59 |
|
---|
[75369] | 60 | /** Constructs event proxy object on the basis of passed @a pParent. */
|
---|
| 61 | UIProgressEventHandler(QObject *pParent, const CProgress &comProgress);
|
---|
| 62 | /** Destructs event proxy object. */
|
---|
[93990] | 63 | virtual ~UIProgressEventHandler() RT_OVERRIDE;
|
---|
[25178] | 64 |
|
---|
| 65 | protected:
|
---|
[34479] | 66 |
|
---|
[75369] | 67 | /** @name Prepare/Cleanup cascade.
|
---|
| 68 | * @{ */
|
---|
| 69 | /** Prepares all. */
|
---|
| 70 | void prepare();
|
---|
| 71 | /** Prepares listener. */
|
---|
| 72 | void prepareListener();
|
---|
| 73 | /** Prepares connections. */
|
---|
| 74 | void prepareConnections();
|
---|
[25178] | 75 |
|
---|
[75369] | 76 | /** Cleanups connections. */
|
---|
| 77 | void cleanupConnections();
|
---|
| 78 | /** Cleanups listener. */
|
---|
| 79 | void cleanupListener();
|
---|
| 80 | /** Cleanups all. */
|
---|
| 81 | void cleanup();
|
---|
| 82 | /** @} */
|
---|
[25178] | 83 |
|
---|
| 84 | private:
|
---|
[34479] | 85 |
|
---|
[75369] | 86 | /** Holds the progress wrapper. */
|
---|
| 87 | CProgress m_comProgress;
|
---|
[69000] | 88 |
|
---|
[75369] | 89 | /** Holds the Qt event listener instance. */
|
---|
| 90 | ComObjPtr<UIMainEventListenerImpl> m_pQtListener;
|
---|
| 91 | /** Holds the COM event listener instance. */
|
---|
| 92 | CEventListener m_comEventListener;
|
---|
[25178] | 93 | };
|
---|
| 94 |
|
---|
[68998] | 95 |
|
---|
[76581] | 96 | #endif /* !FEQT_INCLUDED_SRC_globals_UIProgressEventHandler_h */
|
---|