VirtualBox

Changeset 65285 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jan 13, 2017 2:31:24 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Accessibility support (step 172): A bit of care for UIInformationDataItem sub-classes: Doxy/comments.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationDataItem.cpp

    r64840 r65285  
    6060
    6161
     62/*********************************************************************************************************************************
     63*   Class UIInformationDataItem implementation.                                                                                  *
     64*********************************************************************************************************************************/
     65
    6266UIInformationDataItem::UIInformationDataItem(InformationElementType type, const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    6367    : m_type(type)
     
    7579{
    7680    RT_NOREF(index);
     81
     82    /* For particular role: */
    7783    switch (role)
    7884    {
     
    97103}
    98104
     105
     106/*********************************************************************************************************************************
     107*   Class UIInformationDataGeneral implementation.                                                                               *
     108*********************************************************************************************************************************/
     109
    99110UIInformationDataGeneral::UIInformationDataGeneral(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    100111    : UIInformationDataItem(InformationElementType_General, machine, console, pModel)
     
    104115QVariant UIInformationDataGeneral::data(const QModelIndex &index, int role) const
    105116{
     117    /* For particular role: */
    106118    switch (role)
    107119    {
     
    129141}
    130142
     143
     144/*********************************************************************************************************************************
     145*   Class UIInformationDataSystem implementation.                                                                                *
     146*********************************************************************************************************************************/
     147
    131148UIInformationDataSystem::UIInformationDataSystem(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    132149    : UIInformationDataItem(InformationElementType_System, machine, console, pModel)
     
    136153QVariant UIInformationDataSystem::data(const QModelIndex &index, int role) const
    137154{
     155    /* For particular role: */
    138156    switch (role)
    139157    {
     
    218236}
    219237
     238
     239/*********************************************************************************************************************************
     240*   Class UIInformationDataDisplay implementation.                                                                               *
     241*********************************************************************************************************************************/
     242
    220243UIInformationDataDisplay::UIInformationDataDisplay(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    221244    : UIInformationDataItem(InformationElementType_Display, machine, console, pModel)
     
    225248QVariant UIInformationDataDisplay::data(const QModelIndex &index, int role) const
    226249{
     250    /* For particular role: */
    227251    switch (role)
    228252    {
     
    277301}
    278302
     303
     304/*********************************************************************************************************************************
     305*   Class UIInformationDataStorage implementation.                                                                               *
     306*********************************************************************************************************************************/
     307
    279308UIInformationDataStorage::UIInformationDataStorage(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    280309    : UIInformationDataItem(InformationElementType_Storage, machine, console, pModel)
     
    284313QVariant UIInformationDataStorage::data(const QModelIndex &index, int role) const
    285314{
     315    /* For particular role: */
    286316    switch (role)
    287317    {
     
    341371}
    342372
     373
     374/*********************************************************************************************************************************
     375*   Class UIInformationDataAudio implementation.                                                                                 *
     376*********************************************************************************************************************************/
     377
    343378UIInformationDataAudio::UIInformationDataAudio(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    344379    : UIInformationDataItem(InformationElementType_Audio, machine, console, pModel)
     
    348383QVariant UIInformationDataAudio::data(const QModelIndex &index, int role) const
    349384{
     385    /* For particular role: */
    350386    switch (role)
    351387    {
     
    379415}
    380416
     417
     418/*********************************************************************************************************************************
     419*   Class UIInformationDataNetwork implementation.                                                                               *
     420*********************************************************************************************************************************/
     421
    381422UIInformationDataNetwork::UIInformationDataNetwork(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    382423    : UIInformationDataItem(InformationElementType_Network, machine, console, pModel)
     
    386427QVariant UIInformationDataNetwork::data(const QModelIndex &index, int role) const
    387428{
     429    /* For particular role: */
    388430    switch (role)
    389431    {
     
    444486}
    445487
     488
     489/*********************************************************************************************************************************
     490*   Class UIInformationDataSerialPorts implementation.                                                                           *
     491*********************************************************************************************************************************/
     492
    446493UIInformationDataSerialPorts::UIInformationDataSerialPorts(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    447494    : UIInformationDataItem(InformationElementType_Serial, machine, console, pModel)
     
    451498QVariant UIInformationDataSerialPorts::data(const QModelIndex &index, int role) const
    452499{
     500    /* For particular role: */
    453501    switch (role)
    454502    {
     
    497545}
    498546
     547
    499548#ifdef VBOX_WITH_PARALLEL_PORTS
     549/*********************************************************************************************************************************
     550*   Class UIInformationDataParallelPorts implementation.                                                                         *
     551*********************************************************************************************************************************/
     552
    500553UIInformationDataParallelPorts::UIInformationDataParallelPorts(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    501554    : UIInformationDataItem(InformationElementType_Parallel, machine, console, pModel)
     
    505558QVariant UIInformationDataParallelPorts::data(const QModelIndex &index, int role) const
    506559{
     560    /* For particular role: */
    507561    switch (role)
    508562    {
     
    539593#endif /* VBOX_WITH_PARALLEL_PORTS */
    540594
     595
     596/*********************************************************************************************************************************
     597*   Class UIInformationDataUSB implementation.                                                                                   *
     598*********************************************************************************************************************************/
     599
    541600UIInformationDataUSB::UIInformationDataUSB(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    542601    : UIInformationDataItem(InformationElementType_USB, machine, console, pModel)
     
    546605QVariant UIInformationDataUSB::data(const QModelIndex &index, int role) const
    547606{
     607    /* For particular role: */
    548608    switch (role)
    549609    {
     
    588648}
    589649
     650
     651/*********************************************************************************************************************************
     652*   Class UIInformationDataSharedFolders implementation.                                                                         *
     653*********************************************************************************************************************************/
     654
    590655UIInformationDataSharedFolders::UIInformationDataSharedFolders(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    591656    : UIInformationDataItem(InformationElementType_SharedFolders, machine, console, pModel)
     
    596661QVariant UIInformationDataSharedFolders::data(const QModelIndex &index, int role) const
    597662{
     663    /* For particular role: */
    598664    switch (role)
    599665    {
     
    629695}
    630696
     697
     698/*********************************************************************************************************************************
     699*   Class UIInformationDataRuntimeAttributes implementation.                                                                     *
     700*********************************************************************************************************************************/
     701
    631702UIInformationDataRuntimeAttributes::UIInformationDataRuntimeAttributes(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    632703    : UIInformationDataItem(InformationElementType_RuntimeAttributes, machine, console, pModel)
     
    636707QVariant UIInformationDataRuntimeAttributes::data(const QModelIndex &index, int role) const
    637708{
     709    /* For particular role: */
    638710    switch (role)
    639711    {
     
    771843}
    772844
     845
     846/*********************************************************************************************************************************
     847*   Class UIInformationDataNetworkStatistics implementation.                                                                     *
     848*********************************************************************************************************************************/
     849
    773850UIInformationDataNetworkStatistics::UIInformationDataNetworkStatistics(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
    774851    : UIInformationDataItem(InformationElementType_NetworkStatistics, machine, console, pModel)
     
    822899QVariant UIInformationDataNetworkStatistics::data(const QModelIndex &index, int role) const
    823900{
     901    /* For particular role: */
    824902    switch (role)
    825903    {
     
    917995    m_pModel->updateData(index);
    918996}
     997
     998
     999/*********************************************************************************************************************************
     1000*   Class UIInformationDataStorageStatistics implementation.                                                                     *
     1001*********************************************************************************************************************************/
    9191002
    9201003UIInformationDataStorageStatistics::UIInformationDataStorageStatistics(const CMachine &machine, const CConsole &console, UIInformationModel *pModel)
     
    10131096QVariant UIInformationDataStorageStatistics::data(const QModelIndex &index, int role) const
    10141097{
     1098    /* For particular role: */
    10151099    switch (role)
    10161100    {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationDataItem.h

    r64840 r65285  
    2929
    3030/* COM includes: */
    31 /* COMEnums.h should be first header included for enum definitions: */
    3231#include "COMEnums.h"
    3332#include "CGuest.h"
     
    4645class UIInformationModel;
    4746
     47
    4848/** QObject extension
    4949  * used as data-item in information-model in session-information window. */
     
    5555
    5656    /** Constructs information data-item of type @a type.
    57       * @param machine is machine reference.
    58       * @param console is machine console reference. */
     57      * @param  machine  Brings the machine reference.
     58      * @param  console  Brings the machine console reference.
     59      * @param  pModel   Brings the information model this item belings to. */
    5960    UIInformationDataItem(InformationElementType type, const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    6061
     
    6566    InformationElementType elementType() const { return m_type; }
    6667
    67     /** Returns data for item specified by @a idx for the @a role. */
     68    /** Returns data for item specified by @a index for the @a role. */
    6869    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    6970
     
    8990};
    9091
     92
    9193/** UIInformationDataItem extension for the details-element type 'General'. */
    9294class UIInformationDataGeneral : public UIInformationDataItem
     
    9698public:
    9799
    98     /** Constructs details-element object for passed @a pParent set.
    99       * @param fOpened brings whether the details-element should be visually opened. */
     100    /** Constructs details-element object.
     101      * @param  machine  Brings the machine reference.
     102      * @param  console  Brings the machine console reference.
     103      * @param  pModel   Brings the information model this item belings to. */
    100104    UIInformationDataGeneral(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    101105
    102     /** Returns data for item specified by @a idx for the @a role. */
    103     virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    104 };
     106    /** Returns data for item specified by @a index for the @a role. */
     107    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
     108};
     109
    105110
    106111/** UIInformationDataItem extension for the details-element type 'System'. */
     
    111116public:
    112117
    113     /** Constructs details-element object for passed @a pParent set.
    114       * @param fOpened brings whether the details-element should be visually opened. */
     118    /** Constructs details-element object.
     119      * @param  machine  Brings the machine reference.
     120      * @param  console  Brings the machine console reference.
     121      * @param  pModel   Brings the information model this item belings to. */
    115122    UIInformationDataSystem(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    116123
    117     /** Returns data for item specified by @a idx for the @a role. */
    118     virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    119 };
     124    /** Returns data for item specified by @a index for the @a role. */
     125    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
     126};
     127
    120128
    121129/** UIInformationDataItem extension for the details-element type 'System'. */
     
    126134public:
    127135
    128     /** Constructs details-element object for passed @a pParent set.
    129       * @param fOpened brings whether the details-element should be visually opened. */
     136    /** Constructs details-element object.
     137      * @param  machine  Brings the machine reference.
     138      * @param  console  Brings the machine console reference.
     139      * @param  pModel   Brings the information model this item belings to. */
    130140    UIInformationDataDisplay(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    131141
    132     /** Returns data for item specified by @a idx for the @a role. */
    133     virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    134 };
     142    /** Returns data for item specified by @a index for the @a role. */
     143    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
     144};
     145
    135146
    136147/** UIInformationDataItem extension for the details-element type 'Storage'. */
     
    141152public:
    142153
    143     /** Constructs details-element object for passed @a pParent set. */
     154    /** Constructs details-element object.
     155      * @param  machine  Brings the machine reference.
     156      * @param  console  Brings the machine console reference.
     157      * @param  pModel   Brings the information model this item belings to. */
    144158    UIInformationDataStorage(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    145159
    146     /** Returns data for item specified by @a idx for the @a role. */
    147     virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    148 };
     160    /** Returns data for item specified by @a index for the @a role. */
     161    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
     162};
     163
    149164
    150165/** UIInformationDataItem extension for the details-element type 'Audio'. */
     
    155170public:
    156171
    157     /** Constructs details-element object for passed @a pParent set. */
     172    /** Constructs details-element object.
     173      * @param  machine  Brings the machine reference.
     174      * @param  console  Brings the machine console reference.
     175      * @param  pModel   Brings the information model this item belings to. */
    158176    UIInformationDataAudio(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    159177
    160     /** Returns data for item specified by @a idx for the @a role. */
    161     virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    162 };
     178    /** Returns data for item specified by @a index for the @a role. */
     179    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
     180};
     181
    163182
    164183/** UIInformationDataItem extension for the details-element type 'Network'. */
     
    169188public:
    170189
    171     /** Constructs details-element object for passed @a pParent set. */
     190    /** Constructs details-element object.
     191      * @param  machine  Brings the machine reference.
     192      * @param  console  Brings the machine console reference.
     193      * @param  pModel   Brings the information model this item belings to. */
    172194    UIInformationDataNetwork(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    173195
    174     /** Returns data for item specified by @a idx for the @a role. */
    175     virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    176 };
     196    /** Returns data for item specified by @a index for the @a role. */
     197    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
     198};
     199
    177200
    178201/** UIInformationDataItem extension for the details-element type 'Serial ports'. */
     
    183206public:
    184207
    185     /** Constructs details-element object for passed @a pParent set. */
     208    /** Constructs details-element object.
     209      * @param  machine  Brings the machine reference.
     210      * @param  console  Brings the machine console reference.
     211      * @param  pModel   Brings the information model this item belings to. */
    186212    UIInformationDataSerialPorts(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    187213
    188     /** Returns data for item specified by @a idx for the @a role. */
    189     virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    190 };
     214    /** Returns data for item specified by @a index for the @a role. */
     215    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
     216};
     217
    191218
    192219#ifdef VBOX_WITH_PARALLEL_PORTS
     
    198225public:
    199226
    200     /** Constructs details-element object for passed @a pParent set. */
     227    /** Constructs details-element object.
     228      * @param  machine  Brings the machine reference.
     229      * @param  console  Brings the machine console reference.
     230      * @param  pModel   Brings the information model this item belings to. */
    201231    UIInformationDataParallelPorts(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    202232
    203     /** Returns data for item specified by @a idx for the @a role. */
     233    /** Returns data for item specified by @a index for the @a role. */
    204234    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    205235};
    206236#endif /* VBOX_WITH_PARALLEL_PORTS */
     237
    207238
    208239/** UIInformationDataItem extension for the details-element type 'USB'. */
     
    213244public:
    214245
    215     /** Constructs details-element object for passed @a pParent set. */
     246    /** Constructs details-element object.
     247      * @param  machine  Brings the machine reference.
     248      * @param  console  Brings the machine console reference.
     249      * @param  pModel   Brings the information model this item belings to. */
    216250    UIInformationDataUSB(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    217251
    218     /** Returns data for item specified by @a idx for the @a role. */
    219     virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    220 };
     252    /** Returns data for item specified by @a index for the @a role. */
     253    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
     254};
     255
    221256
    222257/** UIInformationDataItem extension for the details-element type 'Shared folders'. */
     
    227262public:
    228263
    229     /** Constructs details-element object for passed @a pParent set. */
     264    /** Constructs details-element object.
     265      * @param  machine  Brings the machine reference.
     266      * @param  console  Brings the machine console reference.
     267      * @param  pModel   Brings the information model this item belings to. */
    230268    UIInformationDataSharedFolders(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    231269
    232     /** Returns data for item specified by @a idx for the @a role. */
     270    /** Returns data for item specified by @a index for the @a role. */
    233271    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    234272
    235273protected slots:
     274
     275    /** Updates item data. */
    236276    void updateData();
    237277};
     278
    238279
    239280/** UIInformationDataItem extension for the details-element type 'runtime attributes'. */
     
    244285public:
    245286
    246     /** Constructs details-element object for passed @a pParent set. */
     287    /** Constructs details-element object.
     288      * @param  machine  Brings the machine reference.
     289      * @param  console  Brings the machine console reference.
     290      * @param  pModel   Brings the information model this item belings to. */
    247291    UIInformationDataRuntimeAttributes(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    248292
    249     /** Returns data for item specified by @a idx for the @a role. */
    250     virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    251 };
     293    /** Returns data for item specified by @a index for the @a role. */
     294    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
     295};
     296
    252297
    253298/** UIInformationDataItem extension for the details-element type 'network statistics'. */
     
    258303public:
    259304
    260     /** Constructs details-element object for passed @a pParent set. */
     305    /** Constructs details-element object.
     306      * @param  machine  Brings the machine reference.
     307      * @param  console  Brings the machine console reference.
     308      * @param  pModel   Brings the information model this item belings to. */
    261309    UIInformationDataNetworkStatistics(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    262310
    263     /** Returns data for item specified by @a idx for the @a role. */
     311    /** Returns data for item specified by @a index for the @a role. */
    264312    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    265313
    266314private slots:
     315
    267316    /** Handles processing of statistics. */
    268317    void sltProcessStatistics();
     
    280329    struct CounterElementType { QString type; DataMapType list; };
    281330
    282     /** VM statistics counter names. */
     331    /** Holds the VM statistics counter names. */
    283332    DataMapType        m_names;
    284     /** VM statistics counter values. */
     333    /** Holds the VM statistics counter values. */
    285334    DataMapType        m_values;
    286     /** VM statistics counter units. */
     335    /** Holds the VM statistics counter units. */
    287336    DataMapType        m_units;
    288     /** VM statistics counter links. */
     337    /** Holds the VM statistics counter links. */
    289338    LinksMapType       m_links;
    290     /** VM statistics update timer. */
     339    /** Holds the VM statistics update timer instance. */
    291340    QTimer            *m_pTimer;
    292341};
     342
    293343
    294344/** UIInformationDataItem extension for the details-element type 'storage statistics'. */
     
    299349public:
    300350
    301     /** Constructs details-element object for passed @a pParent set. */
     351    /** Constructs details-element object.
     352      * @param  machine  Brings the machine reference.
     353      * @param  console  Brings the machine console reference.
     354      * @param  pModel   Brings the information model this item belings to. */
    302355    UIInformationDataStorageStatistics(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);
    303356
    304     /** Returns data for item specified by @a idx for the @a role. */
     357    /** Returns data for item specified by @a index for the @a role. */
    305358    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    306359
    307360private slots:
     361
    308362    /** Handles processing of statistics. */
    309363    void sltProcessStatistics();
     
    314368    QString parseStatistics(const QString &strText);
    315369
    316     /** Converts a given storage controller type to the string representation used
    317      * in statistics. */
     370    /** Converts a given storage controller type to the string representation used in statistics. */
    318371    const char *storCtrlType2Str(const KStorageControllerType enmCtrlType) const;
    319372
     
    325378    struct CounterElementType { QString type; DataMapType list; };
    326379
    327     /** VM statistics counter names. */
     380    /** Holds the VM statistics counter names. */
    328381    DataMapType        m_names;
    329     /** VM statistics counter values. */
     382    /** Holds the VM statistics counter values. */
    330383    DataMapType        m_values;
    331     /** VM statistics counter units. */
     384    /** Holds the VM statistics counter units. */
    332385    DataMapType        m_units;
    333     /** VM statistics counter links. */
     386    /** Holds the VM statistics counter links. */
    334387    LinksMapType       m_links;
    335     /** VM statistics update timer. */
     388    /** Holds the VM statistics update timer instance. */
    336389    QTimer            *m_pTimer;
    337390};
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