1 | /* $Id: UINetworkManagerDialog.h 71630 2018-04-03 16:37:08Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UINetworkManagerDialog stuff declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011-2018 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 ___UINetworkManagerDialog_h___
|
---|
19 | #define ___UINetworkManagerDialog_h___
|
---|
20 |
|
---|
21 | /* Qt includes: */
|
---|
22 | #include <QMainWindow>
|
---|
23 | #include <QMap>
|
---|
24 | #include <QUuid>
|
---|
25 |
|
---|
26 | /* GUI includes: */
|
---|
27 | #include "QIWithRetranslateUI.h"
|
---|
28 | #include "UILibraryDefs.h"
|
---|
29 |
|
---|
30 | /* Forward declarations: */
|
---|
31 | class QLabel;
|
---|
32 | class QUuid;
|
---|
33 | class QVBoxLayout;
|
---|
34 | class QIDialogButtonBox;
|
---|
35 | class UINetworkRequest;
|
---|
36 | class UINetworkRequestWidget;
|
---|
37 |
|
---|
38 | /** QMainWindow reimplementation to reflect network-requests. */
|
---|
39 | class SHARED_LIBRARY_STUFF UINetworkManagerDialog : public QIWithRetranslateUI<QMainWindow>
|
---|
40 | {
|
---|
41 | Q_OBJECT;
|
---|
42 |
|
---|
43 | signals:
|
---|
44 |
|
---|
45 | /** Asks listener (network-manager) to cancel all network-requests. */
|
---|
46 | void sigCancelNetworkRequests();
|
---|
47 |
|
---|
48 | public slots:
|
---|
49 |
|
---|
50 | /** Shows the dialog, make sure its visible. */
|
---|
51 | void showNormal();
|
---|
52 |
|
---|
53 | protected:
|
---|
54 |
|
---|
55 | /** Allows creation of UINetworkManagerDialog to UINetworkManager. */
|
---|
56 | friend class UINetworkManager;
|
---|
57 | /** Constructs Network Manager Dialog. */
|
---|
58 | UINetworkManagerDialog();
|
---|
59 |
|
---|
60 | /** Allows adding/removing network-request widgets to UINetworkRequest. */
|
---|
61 | friend class UINetworkRequest;
|
---|
62 | /** Adds network-request widget. */
|
---|
63 | void addNetworkRequestWidget(UINetworkRequest *pNetworkRequest);
|
---|
64 | /** Removes network-request widget. */
|
---|
65 | void removeNetworkRequestWidget(const QUuid &uuid);
|
---|
66 |
|
---|
67 | /** Handles translation event. */
|
---|
68 | virtual void retranslateUi() /* override */;
|
---|
69 |
|
---|
70 | /** Handles show @a pEvent. */
|
---|
71 | virtual void showEvent(QShowEvent *pEvent) /* override */;
|
---|
72 |
|
---|
73 | /** Handles key-press @a pEvent. */
|
---|
74 | virtual void keyPressEvent(QKeyEvent *pEvent) /* override */;
|
---|
75 |
|
---|
76 | private slots:
|
---|
77 |
|
---|
78 | /** Handles 'Cancel All' button-press. */
|
---|
79 | void sltHandleCancelAllButtonPress();
|
---|
80 |
|
---|
81 | private:
|
---|
82 |
|
---|
83 | /** Holds the label instance. */
|
---|
84 | QLabel *m_pLabel;
|
---|
85 | /** Holds the widget layout instance. */
|
---|
86 | QVBoxLayout *m_pWidgetsLayout;
|
---|
87 | /** Holds the dialog-button-box instance. */
|
---|
88 | QIDialogButtonBox *m_pButtonBox;
|
---|
89 | /** Holds the map of the network request widget instances. */
|
---|
90 | QMap<QUuid, UINetworkRequestWidget*> m_widgets;
|
---|
91 | };
|
---|
92 |
|
---|
93 | #endif /* !___UINetworkManagerDialog_h___ */
|
---|
94 |
|
---|