VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/objects/UIExecutionQueue.h

Last change on this file was 103982, checked in by vboxsync, 8 weeks ago

FE/Qt: bugref:10624. Replacing override and final keywords with RT_OVERRIDE and RT_FINAL defines.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1/* $Id: UIExecutionQueue.h 103982 2024-03-21 11:43:53Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIExecutionQueue class declaration.
4 */
5
6/*
7 * Copyright (C) 2021-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_objects_UIExecutionQueue_h
29#define FEQT_INCLUDED_SRC_objects_UIExecutionQueue_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QObject>
36#include <QQueue>
37
38/* GUI includes: */
39#include "UILibraryDefs.h"
40
41/** QObject subclass providing GUI with
42 * interface for an execution step. */
43class UIExecutionStep : public QObject
44{
45 Q_OBJECT;
46
47signals:
48
49 /** Notifies about step finished. */
50 void sigStepFinished();
51
52public:
53
54 /** Constructs execution step. */
55 UIExecutionStep();
56
57 /** Executes the step. */
58 virtual void exec() = 0;
59};
60
61/** QObject subclass providing GUI with
62 * an object to process queue of execution steps. */
63class UIExecutionQueue : public QObject
64{
65 Q_OBJECT;
66
67signals:
68
69 /** Starts the queue. */
70 void sigStartQueue();
71
72 /** Notifies about queue finished. */
73 void sigQueueFinished();
74
75public:
76
77 /** Constructs execution queue passing @a pParent to the base-class. */
78 UIExecutionQueue(QObject *pParent = 0);
79 /** Destructs execution queue. */
80 virtual ~UIExecutionQueue() RT_OVERRIDE RT_FINAL;
81
82 /** Enqueues pStep into queue. */
83 void enqueue(UIExecutionStep *pStep);
84
85 /** Starts the queue. */
86 void start() { emit sigStartQueue(); }
87
88private slots:
89
90 /** Starts subsequent step. */
91 void sltStartsSubsequentStep();
92
93private:
94
95 /** Holds the execution step queue. */
96 QQueue<UIExecutionStep*> m_queue;
97 /** Holds current step being executed. */
98 UIExecutionStep *m_pExecutedStep;
99};
100
101#endif /* !FEQT_INCLUDED_SRC_objects_UIExecutionQueue_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use