VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.h@ 104158

Last change on this file since 104158 was 98103, checked in by vboxsync, 2 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 KB
Line 
1/* $Id: UIMachineSettingsUSB.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIMachineSettingsUSB class declaration.
4 */
5
6/*
7 * Copyright (C) 2006-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_settings_machine_UIMachineSettingsUSB_h
29#define FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsUSB_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "UISettingsPage.h"
36
37/* Forward declarations: */
38class UIUSBSettingsEditor;
39struct UIDataSettingsMachineUSB;
40struct UIDataSettingsMachineUSBFilter;
41typedef UISettingsCache<UIDataSettingsMachineUSBFilter> UISettingsCacheMachineUSBFilter;
42typedef UISettingsCachePool<UIDataSettingsMachineUSB, UISettingsCacheMachineUSBFilter> UISettingsCacheMachineUSB;
43
44/** Machine settings: USB page. */
45class SHARED_LIBRARY_STUFF UIMachineSettingsUSB : public UISettingsPageMachine
46{
47 Q_OBJECT;
48
49public:
50
51 /** Constructs USB settings page. */
52 UIMachineSettingsUSB();
53 /** Destructs USB settings page. */
54 virtual ~UIMachineSettingsUSB() RT_OVERRIDE;
55
56 /** Returns whether the USB is enabled. */
57 bool isUSBEnabled() const;
58
59protected:
60
61 /** Returns whether the page content was changed. */
62 virtual bool changed() const RT_OVERRIDE;
63
64 /** Loads settings from external object(s) packed inside @a data to cache.
65 * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
66 virtual void loadToCacheFrom(QVariant &data) RT_OVERRIDE;
67 /** Loads data from cache to corresponding widgets.
68 * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
69 virtual void getFromCache() RT_OVERRIDE;
70
71 /** Saves data from corresponding widgets to cache.
72 * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
73 virtual void putToCache() RT_OVERRIDE;
74 /** Saves settings from cache to external object(s) packed inside @a data.
75 * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
76 virtual void saveFromCacheTo(QVariant &data) RT_OVERRIDE;
77
78 /** Performs validation, updates @a messages list if something is wrong. */
79 virtual bool validate(QList<UIValidationMessage> &messages) RT_OVERRIDE;
80
81 /** Defines TAB order for passed @a pWidget. */
82 virtual void setOrderAfter(QWidget *pWidget) RT_OVERRIDE;
83
84 /** Handles translation event. */
85 virtual void retranslateUi() RT_OVERRIDE;
86
87 /** Performs final page polishing. */
88 virtual void polishPage() RT_OVERRIDE;
89
90private:
91
92 /** Prepares all. */
93 void prepare();
94 /** Prepares widgets. */
95 void prepareWidgets();
96 /** Prepares connections. */
97 void prepareConnections();
98 /** Cleanups all. */
99 void cleanup();
100
101 /** Saves existing data from cache. */
102 bool saveData();
103 /** Removes USB controllers of passed @a types. */
104 bool removeUSBControllers(const QSet<KUSBControllerType> &types = QSet<KUSBControllerType>());
105 /** Creates USB controllers of passed @a enmType. */
106 bool createUSBControllers(KUSBControllerType enmType);
107 /** Removes USB filter at passed @a iPosition of the @a filtersObject. */
108 bool removeUSBFilter(CUSBDeviceFilters &comFiltersObject, int iPosition);
109 /** Creates USB filter at passed @a iPosition of the @a filtersObject using the @a filterData. */
110 bool createUSBFilter(CUSBDeviceFilters &comFiltersObject, int iPosition, const UIDataSettingsMachineUSBFilter &filterData);
111
112 /** Holds the page data cache instance. */
113 UISettingsCacheMachineUSB *m_pCache;
114
115 /** @name Widgets
116 * @{ */
117 /** Holds the USB settings editor instance. */
118 UIUSBSettingsEditor *m_pEditorUsbSettings;
119 /** @} */
120};
121
122#endif /* !FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsUSB_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