VirtualBox

Changeset 57675 in vbox for trunk


Ignore:
Timestamp:
Sep 9, 2015 4:02:19 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Selector UI: Details pane: Elements: Cleanup/rework (step 5).

Location:
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp

    r57672 r57675  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsDetails class implementation.
     3 * VBox Qt GUI - UIGDetailsElement[Name] classes implementation.
    44 */
    55
    66/*
    7  * Copyright (C) 2012-2014 Oracle Corporation
     7 * Copyright (C) 2012-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.h

    r57672 r57675  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsElements class declaration.
     3 * VBox Qt GUI - UIGDetailsElement[Name] classes declaration.
    44 */
    55
    66/*
    7  * Copyright (C) 2012-2013 Oracle Corporation
     7 * Copyright (C) 2012-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIGDetailsElements_h__
    19 #define __UIGDetailsElements_h__
     18#ifndef ___UIGDetailsElements_h___
     19#define ___UIGDetailsElements_h___
    2020
    2121/* GUI includes: */
     
    2828
    2929
    30 /* Element update task: */
     30/** UITask extension used as update task for the details-element. */
    3131class UIGDetailsUpdateTask : public UITask
    3232{
     
    3535public:
    3636
    37     /* Constructor: */
     37    /** Constructs update task taking @a machine as data. */
    3838    UIGDetailsUpdateTask(const CMachine &machine);
    3939};
    4040
    41 /* Details element interface: */
     41/** UIGDetailsElement extension used as a wrapping interface to
     42  * extend base-class with async functionality performed by the COM worker-threads. */
    4243class UIGDetailsElementInterface : public UIGDetailsElement
    4344{
     
    4647public:
    4748
    48     /* Constructor/destructor: */
     49    /** Constructs details-element interface for passed @a pParent set.
     50      * @param type    brings the details-element type this element belongs to.
     51      * @param fOpened brings whether the details-element should be visually opened. */
    4952    UIGDetailsElementInterface(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened);
    5053
    5154protected:
    5255
    53     /* Helper: Translate stuff: */
     56    /** Performs translation. */
    5457    virtual void retranslateUi();
    5558
    56     /* Helpers: Update stuff: */
     59    /** Updates appearance. */
    5760    virtual void updateAppearance();
     61
     62    /** Creates update task. */
    5863    virtual UITask* createUpdateTask() = 0;
    5964
    6065private slots:
    6166
    62     /* Handler: Update stuff: */
     67    /** Handles the signal about update @a pTask is finished. */
    6368    virtual void sltUpdateAppearanceFinished(UITask *pTask);
    6469
    6570private:
    6671
    67     /* Variables: */
     72    /** Holds the instance of the update task. */
    6873    UITask *m_pTask;
    6974};
    7075
    7176
    72 /* Element 'Preview': */
     77/** UIGDetailsElementInterface extension for the details-element type 'Preview'. */
    7378class UIGDetailsElementPreview : public UIGDetailsElement
    7479{
     
    7782public:
    7883
    79     /* Constructor: */
     84    /** Constructs details-element interface for passed @a pParent set.
     85      * @param fOpened brings whether the details-element should be opened. */
    8086    UIGDetailsElementPreview(UIGDetailsSet *pParent, bool fOpened);
    8187
     
    8793private:
    8894
    89     /* Helper: Translate stuff: */
     95    /** Performs translation. */
    9096    virtual void retranslateUi();
    9197
    92     /* Helpers: Layout stuff: */
     98    /** Returns minimum width hint. */
    9399    int minimumWidthHint() const;
     100    /** Returns minimum height hint.
     101      * @param fClosed allows to specify whether the hint should
     102      *                be calculated for the closed element. */
    94103    int minimumHeightHint(bool fClosed) const;
     104    /** Updates layout. */
    95105    void updateLayout();
    96106
    97     /* Helper: Update stuff: */
     107    /** Updates appearance. */
    98108    void updateAppearance();
    99109
    100     /* Variables: */
     110    /** Holds the instance of VM preview. */
    101111    UIGMachinePreview *m_pPreview;
    102112};
    103113
    104114
    105 /* Task 'General': */
     115/** UITask extension used as update task for the details-element type 'General'. */
    106116class UIGDetailsUpdateTaskGeneral : public UIGDetailsUpdateTask
    107117{
     
    110120public:
    111121
    112     /* Constructor: */
     122    /** Constructs update task passing @a machine to the base-class. */
    113123    UIGDetailsUpdateTaskGeneral(const CMachine &machine)
    114124        : UIGDetailsUpdateTask(machine) {}
     
    116126private:
    117127
    118     /* Helpers: Prepare stuff: */
    119     void run();
    120 };
    121 
    122 /* Element 'General': */
     128    /** Contains update task body. */
     129    void run();
     130};
     131
     132/** UIGDetailsElementInterface extension for the details-element type 'General'. */
    123133class UIGDetailsElementGeneral : public UIGDetailsElementInterface
    124134{
     
    127137public:
    128138
    129     /* Constructor: */
     139    /** Constructs details-element object for passed @a pParent set.
     140      * @param fOpened brings whether the details-element should be visually opened. */
    130141    UIGDetailsElementGeneral(UIGDetailsSet *pParent, bool fOpened)
    131142        : UIGDetailsElementInterface(pParent, DetailsElementType_General, fOpened) {}
     
    133144private:
    134145
    135     /* Helper: Update stuff: */
     146    /** Creates update task for this element. */
    136147    UITask* createUpdateTask() { return new UIGDetailsUpdateTaskGeneral(machine()); }
    137148};
    138149
    139150
    140 /* Task 'System': */
     151/** UITask extension used as update task for the details-element type 'System'. */
    141152class UIGDetailsUpdateTaskSystem : public UIGDetailsUpdateTask
    142153{
     
    145156public:
    146157
    147     /* Constructor: */
     158    /** Constructs update task passing @a machine to the base-class. */
    148159    UIGDetailsUpdateTaskSystem(const CMachine &machine)
    149160        : UIGDetailsUpdateTask(machine) {}
     
    151162private:
    152163
    153     /* Helpers: Prepare stuff: */
    154     void run();
    155 };
    156 
    157 /* Element 'System': */
     164    /** Contains update task body. */
     165    void run();
     166};
     167
     168/** UIGDetailsElementInterface extension for the details-element type 'System'. */
    158169class UIGDetailsElementSystem : public UIGDetailsElementInterface
    159170{
     
    162173public:
    163174
    164     /* Constructor: */
     175    /** Constructs details-element object for passed @a pParent set.
     176      * @param fOpened brings whether the details-element should be visually opened. */
    165177    UIGDetailsElementSystem(UIGDetailsSet *pParent, bool fOpened)
    166178        : UIGDetailsElementInterface(pParent, DetailsElementType_System, fOpened) {}
     
    168180private:
    169181
    170     /* Helper: Update stuff: */
     182    /** Creates update task for this element. */
    171183    UITask* createUpdateTask() { return new UIGDetailsUpdateTaskSystem(machine()); }
    172184};
    173185
    174186
    175 /* Task 'Display': */
     187/** UITask extension used as update task for the details-element type 'Display'. */
    176188class UIGDetailsUpdateTaskDisplay : public UIGDetailsUpdateTask
    177189{
     
    180192public:
    181193
    182     /* Constructor: */
     194    /** Constructs update task passing @a machine to the base-class. */
    183195    UIGDetailsUpdateTaskDisplay(const CMachine &machine)
    184196        : UIGDetailsUpdateTask(machine) {}
     
    186198private:
    187199
    188     /* Helpers: Prepare stuff: */
    189     void run();
    190 };
    191 
    192 /* Element 'Display': */
     200    /** Contains update task body. */
     201    void run();
     202};
     203
     204/** UIGDetailsElementInterface extension for the details-element type 'Display'. */
    193205class UIGDetailsElementDisplay : public UIGDetailsElementInterface
    194206{
     
    197209public:
    198210
    199     /* Constructor: */
     211    /** Constructs details-element object for passed @a pParent set.
     212      * @param fOpened brings whether the details-element should be visually opened. */
    200213    UIGDetailsElementDisplay(UIGDetailsSet *pParent, bool fOpened)
    201214        : UIGDetailsElementInterface(pParent, DetailsElementType_Display, fOpened) {}
     
    203216private:
    204217
    205     /* Helper: Update stuff: */
     218    /** Creates update task for this element. */
    206219    UITask* createUpdateTask() { return new UIGDetailsUpdateTaskDisplay(machine()); }
    207220};
    208221
    209222
    210 /* Task 'Storage': */
     223/** UITask extension used as update task for the details-element type 'Storage'. */
    211224class UIGDetailsUpdateTaskStorage : public UIGDetailsUpdateTask
    212225{
     
    215228public:
    216229
    217     /* Constructor: */
     230    /** Constructs update task passing @a machine to the base-class. */
    218231    UIGDetailsUpdateTaskStorage(const CMachine &machine)
    219232        : UIGDetailsUpdateTask(machine) {}
     
    221234private:
    222235
    223     /* Helpers: Prepare stuff: */
    224     void run();
    225 };
    226 
    227 /* Element 'Storage': */
     236    /** Contains update task body. */
     237    void run();
     238};
     239
     240/** UIGDetailsElementInterface extension for the details-element type 'Storage'. */
    228241class UIGDetailsElementStorage : public UIGDetailsElementInterface
    229242{
     
    232245public:
    233246
    234     /* Constructor: */
     247    /** Constructs details-element object for passed @a pParent set.
     248      * @param fOpened brings whether the details-element should be visually opened. */
    235249    UIGDetailsElementStorage(UIGDetailsSet *pParent, bool fOpened)
    236250        : UIGDetailsElementInterface(pParent, DetailsElementType_Storage, fOpened) {}
     
    238252private:
    239253
    240     /* Helper: Update stuff: */
     254    /** Creates update task for this element. */
    241255    UITask* createUpdateTask() { return new UIGDetailsUpdateTaskStorage(machine()); }
    242256};
    243257
    244258
    245 /* Task 'Audio': */
     259/** UITask extension used as update task for the details-element type 'Audio'. */
    246260class UIGDetailsUpdateTaskAudio : public UIGDetailsUpdateTask
    247261{
     
    250264public:
    251265
    252     /* Constructor: */
     266    /** Constructs update task passing @a machine to the base-class. */
    253267    UIGDetailsUpdateTaskAudio(const CMachine &machine)
    254268        : UIGDetailsUpdateTask(machine) {}
     
    256270private:
    257271
    258     /* Helpers: Prepare stuff: */
    259     void run();
    260 };
    261 
    262 /* Element 'Audio': */
     272    /** Contains update task body. */
     273    void run();
     274};
     275
     276/** UIGDetailsElementInterface extension for the details-element type 'Audio'. */
    263277class UIGDetailsElementAudio : public UIGDetailsElementInterface
    264278{
     
    267281public:
    268282
    269     /* Constructor: */
     283    /** Constructs details-element object for passed @a pParent set.
     284      * @param fOpened brings whether the details-element should be visually opened. */
    270285    UIGDetailsElementAudio(UIGDetailsSet *pParent, bool fOpened)
    271286        : UIGDetailsElementInterface(pParent, DetailsElementType_Audio, fOpened) {}
     
    273288private:
    274289
    275     /* Helper: Update stuff: */
     290    /** Creates update task for this element. */
    276291    UITask* createUpdateTask() { return new UIGDetailsUpdateTaskAudio(machine()); }
    277292};
    278293
    279294
    280 /* Task 'Network': */
     295/** UITask extension used as update task for the details-element type 'Network'. */
    281296class UIGDetailsUpdateTaskNetwork : public UIGDetailsUpdateTask
    282297{
     
    285300public:
    286301
    287     /* Constructor: */
     302    /** Constructs update task passing @a machine to the base-class. */
    288303    UIGDetailsUpdateTaskNetwork(const CMachine &machine)
    289304        : UIGDetailsUpdateTask(machine) {}
     
    291306private:
    292307
    293     /* Helpers: Prepare stuff: */
    294     void run();
     308    /** Contains update task body. */
     309    void run();
     310
     311    /** Summarizes generic properties. */
    295312    static QString summarizeGenericProperties(const CNetworkAdapter &adapter);
    296313};
    297314
    298 /* Element 'Network': */
     315/** UIGDetailsElementInterface extension for the details-element type 'Network'. */
    299316class UIGDetailsElementNetwork : public UIGDetailsElementInterface
    300317{
     
    303320public:
    304321
    305     /* Constructor: */
     322    /** Constructs details-element object for passed @a pParent set.
     323      * @param fOpened brings whether the details-element should be visually opened. */
    306324    UIGDetailsElementNetwork(UIGDetailsSet *pParent, bool fOpened)
    307325        : UIGDetailsElementInterface(pParent, DetailsElementType_Network, fOpened) {}
     
    309327private:
    310328
    311     /* Helper: Update stuff: */
     329    /** Creates update task for this element. */
    312330    UITask* createUpdateTask() { return new UIGDetailsUpdateTaskNetwork(machine()); }
    313331};
    314332
    315333
    316 /* Task 'Serial': */
     334/** UITask extension used as update task for the details-element type 'Serial'. */
    317335class UIGDetailsUpdateTaskSerial : public UIGDetailsUpdateTask
    318336{
     
    321339public:
    322340
    323     /* Constructor: */
     341    /** Constructs update task passing @a machine to the base-class. */
    324342    UIGDetailsUpdateTaskSerial(const CMachine &machine)
    325343        : UIGDetailsUpdateTask(machine) {}
     
    327345private:
    328346
    329     /* Helpers: Prepare stuff: */
    330     void run();
    331 };
    332 
    333 /* Element 'Serial': */
     347    /** Contains update task body. */
     348    void run();
     349};
     350
     351/** UIGDetailsElementInterface extension for the details-element type 'Serial'. */
    334352class UIGDetailsElementSerial : public UIGDetailsElementInterface
    335353{
     
    338356public:
    339357
    340     /* Constructor: */
     358    /** Constructs details-element object for passed @a pParent set.
     359      * @param fOpened brings whether the details-element should be visually opened. */
    341360    UIGDetailsElementSerial(UIGDetailsSet *pParent, bool fOpened)
    342361        : UIGDetailsElementInterface(pParent, DetailsElementType_Serial, fOpened) {}
     
    344363private:
    345364
    346     /* Helper: Update stuff: */
     365    /** Creates update task for this element. */
    347366    UITask* createUpdateTask() { return new UIGDetailsUpdateTaskSerial(machine()); }
    348367};
     
    350369
    351370#ifdef VBOX_WITH_PARALLEL_PORTS
    352 /* Task 'Parallel': */
     371/** UITask extension used as update task for the details-element type 'Parallel'. */
    353372class UIGDetailsUpdateTaskParallel : public UIGDetailsUpdateTask
    354373{
     
    357376public:
    358377
    359     /* Constructor: */
     378    /** Constructs update task passing @a machine to the base-class. */
    360379    UIGDetailsUpdateTaskParallel(const CMachine &machine)
    361380        : UIGDetailsUpdateTask(machine) {}
     
    363382private:
    364383
    365     /* Helpers: Prepare stuff: */
    366     void run();
    367 };
    368 
    369 /* Element 'Parallel': */
     384    /** Contains update task body. */
     385    void run();
     386};
     387
     388/** UIGDetailsElementInterface extension for the details-element type 'Parallel'. */
    370389class UIGDetailsElementParallel : public UIGDetailsElementInterface
    371390{
     
    374393public:
    375394
    376     /* Constructor: */
     395    /** Constructs details-element object for passed @a pParent set.
     396      * @param fOpened brings whether the details-element should be visually opened. */
    377397    UIGDetailsElementParallel(UIGDetailsSet *pParent, bool fOpened)
    378398        : UIGDetailsElementInterface(pParent, DetailsElementType_Parallel, fOpened) {}
     
    380400private:
    381401
    382     /* Helper: Update stuff: */
     402    /** Creates update task for this element. */
    383403    UITask* createUpdateTask() { return new UIGDetailsUpdateTaskParallel(machine()); }
    384404};
     
    386406
    387407
    388 /* Task 'USB': */
     408/** UITask extension used as update task for the details-element type 'USB'. */
    389409class UIGDetailsUpdateTaskUSB : public UIGDetailsUpdateTask
    390410{
     
    393413public:
    394414
    395     /* Constructor: */
     415    /** Constructs update task passing @a machine to the base-class. */
    396416    UIGDetailsUpdateTaskUSB(const CMachine &machine)
    397417        : UIGDetailsUpdateTask(machine) {}
     
    399419private:
    400420
    401     /* Helpers: Prepare stuff: */
    402     void run();
    403 };
    404 
    405 /* Element 'USB': */
     421    /** Contains update task body. */
     422    void run();
     423};
     424
     425/** UIGDetailsElementInterface extension for the details-element type 'USB'. */
    406426class UIGDetailsElementUSB : public UIGDetailsElementInterface
    407427{
     
    410430public:
    411431
    412     /* Constructor: */
     432    /** Constructs details-element object for passed @a pParent set.
     433      * @param fOpened brings whether the details-element should be visually opened. */
    413434    UIGDetailsElementUSB(UIGDetailsSet *pParent, bool fOpened)
    414435        : UIGDetailsElementInterface(pParent, DetailsElementType_USB, fOpened) {}
     
    416437private:
    417438
    418     /* Helper: Update stuff: */
     439    /** Creates update task for this element. */
    419440    UITask* createUpdateTask() { return new UIGDetailsUpdateTaskUSB(machine()); }
    420441};
    421442
    422443
    423 /* Task 'SF': */
     444/** UITask extension used as update task for the details-element type 'SF'. */
    424445class UIGDetailsUpdateTaskSF : public UIGDetailsUpdateTask
    425446{
     
    428449public:
    429450
    430     /* Constructor: */
     451    /** Constructs update task passing @a machine to the base-class. */
    431452    UIGDetailsUpdateTaskSF(const CMachine &machine)
    432453        : UIGDetailsUpdateTask(machine) {}
     
    434455private:
    435456
    436     /* Helpers: Prepare stuff: */
    437     void run();
    438 };
    439 
    440 /* Element 'SF': */
     457    /** Contains update task body. */
     458    void run();
     459};
     460
     461/** UIGDetailsElementInterface extension for the details-element type 'SF'. */
    441462class UIGDetailsElementSF : public UIGDetailsElementInterface
    442463{
     
    445466public:
    446467
    447     /* Constructor: */
     468    /** Constructs details-element object for passed @a pParent set.
     469      * @param fOpened brings whether the details-element should be visually opened. */
    448470    UIGDetailsElementSF(UIGDetailsSet *pParent, bool fOpened)
    449471        : UIGDetailsElementInterface(pParent, DetailsElementType_SF, fOpened) {}
     
    451473private:
    452474
    453     /* Helper: Update stuff: */
     475    /** Creates update task for this element. */
    454476    UITask* createUpdateTask() { return new UIGDetailsUpdateTaskSF(machine()); }
    455477};
    456478
    457479
    458 /* Task 'UI': */
     480/** UITask extension used as update task for the details-element type 'UI'. */
    459481class UIGDetailsUpdateTaskUI : public UIGDetailsUpdateTask
    460482{
     
    463485public:
    464486
    465     /* Constructor: */
     487    /** Constructs update task passing @a machine to the base-class. */
    466488    UIGDetailsUpdateTaskUI(const CMachine &machine)
    467489        : UIGDetailsUpdateTask(machine) {}
     
    469491private:
    470492
    471     /* Helpers: Prepare stuff: */
    472     void run();
    473 };
    474 
    475 /* Element 'UI': */
     493    /** Contains update task body. */
     494    void run();
     495};
     496
     497/** UIGDetailsElementInterface extension for the details-element type 'UI'. */
    476498class UIGDetailsElementUI : public UIGDetailsElementInterface
    477499{
     
    480502public:
    481503
    482     /* Constructor: */
     504    /** Constructs details-element object for passed @a pParent set.
     505      * @param fOpened brings whether the details-element should be visually opened. */
    483506    UIGDetailsElementUI(UIGDetailsSet *pParent, bool fOpened)
    484507        : UIGDetailsElementInterface(pParent, DetailsElementType_UI, fOpened) {}
     
    486509private:
    487510
    488     /* Helper: Update stuff: */
     511    /** Creates update task for this element. */
    489512    UITask* createUpdateTask() { return new UIGDetailsUpdateTaskUI(machine()); }
    490513};
    491514
    492515
    493 /* Task 'Description': */
     516/** UITask extension used as update task for the details-element type 'Description'. */
    494517class UIGDetailsUpdateTaskDescription : public UIGDetailsUpdateTask
    495518{
     
    498521public:
    499522
    500     /* Constructor: */
     523    /** Constructs update task passing @a machine to the base-class. */
    501524    UIGDetailsUpdateTaskDescription(const CMachine &machine)
    502525        : UIGDetailsUpdateTask(machine) {}
     
    504527private:
    505528
    506     /* Helpers: Prepare stuff: */
    507     void run();
    508 };
    509 
    510 /* Element 'Description': */
     529    /** Contains update task body. */
     530    void run();
     531};
     532
     533/** UIGDetailsElementInterface extension for the details-element type 'Description'. */
    511534class UIGDetailsElementDescription : public UIGDetailsElementInterface
    512535{
     
    515538public:
    516539
    517     /* Constructor: */
     540    /** Constructs details-element object for passed @a pParent set.
     541      * @param fOpened brings whether the details-element should be visually opened. */
    518542    UIGDetailsElementDescription(UIGDetailsSet *pParent, bool fOpened)
    519543        : UIGDetailsElementInterface(pParent, DetailsElementType_Description, fOpened) {}
     
    521545private:
    522546
    523     /* Helper: Update stuff: */
     547    /** Creates update task for this element. */
    524548    UITask* createUpdateTask() { return new UIGDetailsUpdateTaskDescription(machine()); }
    525549};
    526550
    527 #endif /* __UIGDetailsElements_h__ */
    528 
     551#endif /* !___UIGDetailsElements_h___ */
     552
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette