VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElements.h@ 103977

Last change on this file since 103977 was 103977, checked in by vboxsync, 10 months ago

Apply RT_OVERRIDE/NS_OVERRIDE where required to shut up clang.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mergeinfo set to (toggle deleted branches)
    /branches/VBox-3.0/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h58652,​70973
    /branches/VBox-3.2/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h66309,​66318
    /branches/VBox-4.0/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h70873
    /branches/VBox-4.1/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h74233
    /branches/VBox-4.2/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.h91503-91504,​91506-91508,​91510,​91514-91515,​91521
    /branches/VBox-4.3/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.h91223
    /branches/VBox-4.3/trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.h91223
    /branches/dsen/gui/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h79076-79078,​79089,​79109-79110,​79112-79113,​79127-79130,​79134,​79141,​79151,​79155,​79157-79159,​79193,​79197
    /branches/dsen/gui2/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.h79565-79569,​79572-79573,​79578,​79581-79582,​79590-79591,​79598-79599,​79602-79603,​79605-79606,​79632,​79635,​79637,​79644
    /branches/dsen/gui3/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.h79645-79692
    /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h79225,​79271
File size: 18.1 KB
Line 
1/* $Id: UIDetailsElements.h 103977 2024-03-21 02:04:52Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIDetailsElement[Name] classes declaration.
4 */
5
6/*
7 * Copyright (C) 2012-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_manager_details_UIDetailsElements_h
29#define FEQT_INCLUDED_SRC_manager_details_UIDetailsElements_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QMutex>
36
37/* GUI includes: */
38#include "UIDetailsElement.h"
39#include "UITask.h"
40
41/* COM includes: */
42#include "CCloudMachine.h"
43#include "CMachine.h"
44
45/* Forward declarations: */
46class UIMachinePreview;
47class CNetworkAdapter;
48
49
50/** UITask extension used as update task for the details-element. */
51class UIDetailsUpdateTask : public UITask
52{
53 Q_OBJECT;
54
55public:
56
57 /** Constructs update task taking @a comMachine as data. */
58 UIDetailsUpdateTask(const CMachine &comMachine);
59 /** Constructs update task taking @a comCloudMachine as data. */
60 UIDetailsUpdateTask(const CCloudMachine &comCloudMachine);
61
62 /** Returns the machine. */
63 CMachine machine() const;
64 /** Returns the cloud machine. */
65 CCloudMachine cloudMachine() const;
66
67 /** Returns the table. */
68 UITextTable table() const;
69 /** Defines the @a guiTable. */
70 void setTable(const UITextTable &guiTable);
71
72private:
73
74 /** Holds the mutex to access m_comMachine and m_comCloudMachine members. */
75 mutable QMutex m_machineMutex;
76 /** Holds the machine being processed. */
77 CMachine m_comMachine;
78 /** Holds the cloud machine being processed. */
79 CCloudMachine m_comCloudMachine;
80
81 /** Holds the mutex to access m_guiTable member. */
82 mutable QMutex m_tableMutex;
83 /** Holds the machine being filled. */
84 UITextTable m_guiTable;
85};
86
87/** UIDetailsElement extension used as a wrapping interface to
88 * extend base-class with async functionality performed by the COM worker-threads. */
89class UIDetailsElementInterface : public UIDetailsElement
90{
91 Q_OBJECT;
92
93public:
94
95 /** Constructs details-element interface for passed @a pParent set.
96 * @param type brings the details-element type this element belongs to.
97 * @param fOpened brings whether the details-element should be visually opened. */
98 UIDetailsElementInterface(UIDetailsSet *pParent, DetailsElementType type, bool fOpened);
99
100protected:
101
102 /** Performs translation. */
103 virtual void retranslateUi() RT_OVERRIDE;
104
105 /** Updates appearance. */
106 virtual void updateAppearance() RT_OVERRIDE;
107
108 /** Creates update task. */
109 virtual UITask *createUpdateTask() = 0;
110
111private slots:
112
113 /** Handles the signal about update @a pTask is finished. */
114 virtual void sltUpdateAppearanceFinished(UITask *pTask);
115
116private:
117
118 /** Holds the instance of the update task. */
119 UITask *m_pTask;
120};
121
122
123/** UIDetailsElementInterface extension for the details-element type 'Preview'. */
124class UIDetailsElementPreview : public UIDetailsElement
125{
126 Q_OBJECT;
127
128public:
129
130 /** Constructs details-element interface for passed @a pParent set.
131 * @param fOpened brings whether the details-element should be opened. */
132 UIDetailsElementPreview(UIDetailsSet *pParent, bool fOpened);
133
134 /** Updates layout. */
135 virtual void updateLayout() RT_OVERRIDE;
136
137private slots:
138
139 /** Handles preview size-hint changes. */
140 void sltPreviewSizeHintChanged();
141
142private:
143
144 /** Performs translation. */
145 virtual void retranslateUi() RT_OVERRIDE;
146
147 /** Returns minimum width hint. */
148 int minimumWidthHint() const RT_OVERRIDE;
149 /** Returns minimum height hint.
150 * @param fClosed allows to specify whether the hint should
151 * be calculated for the closed element. */
152 int minimumHeightHintForElement(bool fClosed) const RT_OVERRIDE;
153
154 /** Updates appearance. */
155 void updateAppearance() RT_OVERRIDE;
156
157 /** Holds the instance of VM preview. */
158 UIMachinePreview *m_pPreview;
159};
160
161
162/** UITask extension used as update task for the details-element type 'General'. */
163class UIDetailsUpdateTaskGeneral : public UIDetailsUpdateTask
164{
165 Q_OBJECT;
166
167public:
168
169 /** Constructs update task passing @a comMachine to the base-class. */
170 UIDetailsUpdateTaskGeneral(const CMachine &comMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral fOptions)
171 : UIDetailsUpdateTask(comMachine), m_fOptions(fOptions) {}
172
173private:
174
175 /** Contains update task body. */
176 void run();
177
178 /** Holds the options. */
179 UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral m_fOptions;
180};
181
182/** UITask extension used as update task for the details-element type 'General' of cloud VM. */
183class UIDetailsUpdateTaskGeneralCloud : public UIDetailsUpdateTask
184{
185 Q_OBJECT;
186
187public:
188
189 /** Constructs update task passing @a comCloudMachine to the base-class. */
190 UIDetailsUpdateTaskGeneralCloud(const CCloudMachine &comCloudMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral fOptions)
191 : UIDetailsUpdateTask(comCloudMachine), m_fOptions(fOptions) {}
192
193private:
194
195 /** Contains update task body. */
196 void run();
197
198 /** Holds the options. */
199 UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral m_fOptions;
200};
201
202/** UIDetailsElementInterface extension for the details-element type 'General'. */
203class UIDetailsElementGeneral : public UIDetailsElementInterface
204{
205 Q_OBJECT;
206
207public:
208
209 /** Constructs details-element object for passed @a pParent set.
210 * @param fOpened brings whether the details-element should be visually opened. */
211 UIDetailsElementGeneral(UIDetailsSet *pParent, bool fOpened)
212 : UIDetailsElementInterface(pParent, DetailsElementType_General, fOpened) {}
213
214private:
215
216 /** Creates update task for this element. */
217 virtual UITask *createUpdateTask() RT_OVERRIDE;
218};
219
220
221/** UITask extension used as update task for the details-element type 'System'. */
222class UIDetailsUpdateTaskSystem : public UIDetailsUpdateTask
223{
224 Q_OBJECT;
225
226public:
227
228 /** Constructs update task passing @a comMachine to the base-class. */
229 UIDetailsUpdateTaskSystem(const CMachine &comMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeSystem fOptions)
230 : UIDetailsUpdateTask(comMachine), m_fOptions(fOptions) {}
231
232private:
233
234 /** Contains update task body. */
235 void run();
236
237 /** Holds the options. */
238 UIExtraDataMetaDefs::DetailsElementOptionTypeSystem m_fOptions;
239};
240
241/** UIDetailsElementInterface extension for the details-element type 'System'. */
242class UIDetailsElementSystem : public UIDetailsElementInterface
243{
244 Q_OBJECT;
245
246public:
247
248 /** Constructs details-element object for passed @a pParent set.
249 * @param fOpened brings whether the details-element should be visually opened. */
250 UIDetailsElementSystem(UIDetailsSet *pParent, bool fOpened)
251 : UIDetailsElementInterface(pParent, DetailsElementType_System, fOpened) {}
252
253private:
254
255 /** Creates update task for this element. */
256 virtual UITask *createUpdateTask() RT_OVERRIDE;
257};
258
259
260/** UITask extension used as update task for the details-element type 'Display'. */
261class UIDetailsUpdateTaskDisplay : public UIDetailsUpdateTask
262{
263 Q_OBJECT;
264
265public:
266
267 /** Constructs update task passing @a comMachine to the base-class. */
268 UIDetailsUpdateTaskDisplay(const CMachine &comMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay fOptions)
269 : UIDetailsUpdateTask(comMachine), m_fOptions(fOptions) {}
270
271private:
272
273 /** Contains update task body. */
274 void run();
275
276 /** Holds the options. */
277 UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay m_fOptions;
278};
279
280/** UIDetailsElementInterface extension for the details-element type 'Display'. */
281class UIDetailsElementDisplay : public UIDetailsElementInterface
282{
283 Q_OBJECT;
284
285public:
286
287 /** Constructs details-element object for passed @a pParent set.
288 * @param fOpened brings whether the details-element should be visually opened. */
289 UIDetailsElementDisplay(UIDetailsSet *pParent, bool fOpened)
290 : UIDetailsElementInterface(pParent, DetailsElementType_Display, fOpened) {}
291
292private:
293
294 /** Creates update task for this element. */
295 virtual UITask *createUpdateTask() RT_OVERRIDE;
296};
297
298
299/** UITask extension used as update task for the details-element type 'Storage'. */
300class UIDetailsUpdateTaskStorage : public UIDetailsUpdateTask
301{
302 Q_OBJECT;
303
304public:
305
306 /** Constructs update task passing @a comMachine to the base-class. */
307 UIDetailsUpdateTaskStorage(const CMachine &comMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeStorage fOptions)
308 : UIDetailsUpdateTask(comMachine), m_fOptions(fOptions) {}
309
310private:
311
312 /** Contains update task body. */
313 void run();
314
315 /** Holds the options. */
316 UIExtraDataMetaDefs::DetailsElementOptionTypeStorage m_fOptions;
317};
318
319/** UIDetailsElementInterface extension for the details-element type 'Storage'. */
320class UIDetailsElementStorage : public UIDetailsElementInterface
321{
322 Q_OBJECT;
323
324public:
325
326 /** Constructs details-element object for passed @a pParent set.
327 * @param fOpened brings whether the details-element should be visually opened. */
328 UIDetailsElementStorage(UIDetailsSet *pParent, bool fOpened)
329 : UIDetailsElementInterface(pParent, DetailsElementType_Storage, fOpened) {}
330
331private:
332
333 /** Creates update task for this element. */
334 virtual UITask *createUpdateTask() RT_OVERRIDE;
335};
336
337
338/** UITask extension used as update task for the details-element type 'Audio'. */
339class UIDetailsUpdateTaskAudio : public UIDetailsUpdateTask
340{
341 Q_OBJECT;
342
343public:
344
345 /** Constructs update task passing @a comMachine to the base-class. */
346 UIDetailsUpdateTaskAudio(const CMachine &comMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeAudio fOptions)
347 : UIDetailsUpdateTask(comMachine), m_fOptions(fOptions) {}
348
349private:
350
351 /** Contains update task body. */
352 void run();
353
354 /** Holds the options. */
355 UIExtraDataMetaDefs::DetailsElementOptionTypeAudio m_fOptions;
356};
357
358/** UIDetailsElementInterface extension for the details-element type 'Audio'. */
359class UIDetailsElementAudio : public UIDetailsElementInterface
360{
361 Q_OBJECT;
362
363public:
364
365 /** Constructs details-element object for passed @a pParent set.
366 * @param fOpened brings whether the details-element should be visually opened. */
367 UIDetailsElementAudio(UIDetailsSet *pParent, bool fOpened)
368 : UIDetailsElementInterface(pParent, DetailsElementType_Audio, fOpened) {}
369
370private:
371
372 /** Creates update task for this element. */
373 virtual UITask *createUpdateTask() RT_OVERRIDE;
374};
375
376
377/** UITask extension used as update task for the details-element type 'Network'. */
378class UIDetailsUpdateTaskNetwork : public UIDetailsUpdateTask
379{
380 Q_OBJECT;
381
382public:
383
384 /** Constructs update task passing @a comMachine to the base-class. */
385 UIDetailsUpdateTaskNetwork(const CMachine &comMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork fOptions)
386 : UIDetailsUpdateTask(comMachine), m_fOptions(fOptions) {}
387
388private:
389
390 /** Contains update task body. */
391 void run();
392
393 /** Holds the options. */
394 UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork m_fOptions;
395};
396
397/** UIDetailsElementInterface extension for the details-element type 'Network'. */
398class UIDetailsElementNetwork : public UIDetailsElementInterface
399{
400 Q_OBJECT;
401
402public:
403
404 /** Constructs details-element object for passed @a pParent set.
405 * @param fOpened brings whether the details-element should be visually opened. */
406 UIDetailsElementNetwork(UIDetailsSet *pParent, bool fOpened)
407 : UIDetailsElementInterface(pParent, DetailsElementType_Network, fOpened) {}
408
409private:
410
411 /** Creates update task for this element. */
412 virtual UITask *createUpdateTask() RT_OVERRIDE;
413};
414
415
416/** UITask extension used as update task for the details-element type 'Serial'. */
417class UIDetailsUpdateTaskSerial : public UIDetailsUpdateTask
418{
419 Q_OBJECT;
420
421public:
422
423 /** Constructs update task passing @a comMachine to the base-class. */
424 UIDetailsUpdateTaskSerial(const CMachine &comMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeSerial fOptions)
425 : UIDetailsUpdateTask(comMachine), m_fOptions(fOptions) {}
426
427private:
428
429 /** Contains update task body. */
430 void run();
431
432 /** Holds the options. */
433 UIExtraDataMetaDefs::DetailsElementOptionTypeSerial m_fOptions;
434};
435
436/** UIDetailsElementInterface extension for the details-element type 'Serial'. */
437class UIDetailsElementSerial : public UIDetailsElementInterface
438{
439 Q_OBJECT;
440
441public:
442
443 /** Constructs details-element object for passed @a pParent set.
444 * @param fOpened brings whether the details-element should be visually opened. */
445 UIDetailsElementSerial(UIDetailsSet *pParent, bool fOpened)
446 : UIDetailsElementInterface(pParent, DetailsElementType_Serial, fOpened) {}
447
448private:
449
450 /** Creates update task for this element. */
451 virtual UITask *createUpdateTask() RT_OVERRIDE;
452};
453
454
455/** UITask extension used as update task for the details-element type 'USB'. */
456class UIDetailsUpdateTaskUSB : public UIDetailsUpdateTask
457{
458 Q_OBJECT;
459
460public:
461
462 /** Constructs update task passing @a comMachine to the base-class. */
463 UIDetailsUpdateTaskUSB(const CMachine &comMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeUsb fOptions)
464 : UIDetailsUpdateTask(comMachine), m_fOptions(fOptions) {}
465
466private:
467
468 /** Contains update task body. */
469 void run();
470
471 /** Holds the options. */
472 UIExtraDataMetaDefs::DetailsElementOptionTypeUsb m_fOptions;
473};
474
475/** UIDetailsElementInterface extension for the details-element type 'USB'. */
476class UIDetailsElementUSB : public UIDetailsElementInterface
477{
478 Q_OBJECT;
479
480public:
481
482 /** Constructs details-element object for passed @a pParent set.
483 * @param fOpened brings whether the details-element should be visually opened. */
484 UIDetailsElementUSB(UIDetailsSet *pParent, bool fOpened)
485 : UIDetailsElementInterface(pParent, DetailsElementType_USB, fOpened) {}
486
487private:
488
489 /** Creates update task for this element. */
490 virtual UITask *createUpdateTask() RT_OVERRIDE;
491};
492
493
494/** UITask extension used as update task for the details-element type 'SF'. */
495class UIDetailsUpdateTaskSF : public UIDetailsUpdateTask
496{
497 Q_OBJECT;
498
499public:
500
501 /** Constructs update task passing @a comMachine to the base-class. */
502 UIDetailsUpdateTaskSF(const CMachine &comMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders fOptions)
503 : UIDetailsUpdateTask(comMachine), m_fOptions(fOptions) {}
504
505private:
506
507 /** Contains update task body. */
508 void run();
509
510 /** Holds the options. */
511 UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders m_fOptions;
512};
513
514/** UIDetailsElementInterface extension for the details-element type 'SF'. */
515class UIDetailsElementSF : public UIDetailsElementInterface
516{
517 Q_OBJECT;
518
519public:
520
521 /** Constructs details-element object for passed @a pParent set.
522 * @param fOpened brings whether the details-element should be visually opened. */
523 UIDetailsElementSF(UIDetailsSet *pParent, bool fOpened)
524 : UIDetailsElementInterface(pParent, DetailsElementType_SF, fOpened) {}
525
526private:
527
528 /** Creates update task for this element. */
529 virtual UITask *createUpdateTask() RT_OVERRIDE;
530};
531
532
533/** UITask extension used as update task for the details-element type 'UI'. */
534class UIDetailsUpdateTaskUI : public UIDetailsUpdateTask
535{
536 Q_OBJECT;
537
538public:
539
540 /** Constructs update task passing @a comMachine to the base-class. */
541 UIDetailsUpdateTaskUI(const CMachine &comMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface fOptions)
542 : UIDetailsUpdateTask(comMachine), m_fOptions(fOptions) {}
543
544private:
545
546 /** Contains update task body. */
547 void run();
548
549 /** Holds the options. */
550 UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface m_fOptions;
551};
552
553/** UIDetailsElementInterface extension for the details-element type 'UI'. */
554class UIDetailsElementUI : public UIDetailsElementInterface
555{
556 Q_OBJECT;
557
558public:
559
560 /** Constructs details-element object for passed @a pParent set.
561 * @param fOpened brings whether the details-element should be visually opened. */
562 UIDetailsElementUI(UIDetailsSet *pParent, bool fOpened)
563 : UIDetailsElementInterface(pParent, DetailsElementType_UI, fOpened) {}
564
565private:
566
567 /** Creates update task for this element. */
568 virtual UITask *createUpdateTask() RT_OVERRIDE;
569};
570
571
572/** UITask extension used as update task for the details-element type 'Description'. */
573class UIDetailsUpdateTaskDescription : public UIDetailsUpdateTask
574{
575 Q_OBJECT;
576
577public:
578
579 /** Constructs update task passing @a comMachine to the base-class. */
580 UIDetailsUpdateTaskDescription(const CMachine &comMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeDescription fOptions)
581 : UIDetailsUpdateTask(comMachine), m_fOptions(fOptions) {}
582
583private:
584
585 /** Contains update task body. */
586 void run();
587
588 /** Holds the options. */
589 UIExtraDataMetaDefs::DetailsElementOptionTypeDescription m_fOptions;
590};
591
592/** UIDetailsElementInterface extension for the details-element type 'Description'. */
593class UIDetailsElementDescription : public UIDetailsElementInterface
594{
595 Q_OBJECT;
596
597public:
598
599 /** Constructs details-element object for passed @a pParent set.
600 * @param fOpened brings whether the details-element should be visually opened. */
601 UIDetailsElementDescription(UIDetailsSet *pParent, bool fOpened)
602 : UIDetailsElementInterface(pParent, DetailsElementType_Description, fOpened) {}
603
604private:
605
606 /** Creates update task for this element. */
607 virtual UITask *createUpdateTask() RT_OVERRIDE;
608};
609
610#endif /* !FEQT_INCLUDED_SRC_manager_details_UIDetailsElements_h */
611
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