VirtualBox

Changeset 81095 in vbox


Ignore:
Timestamp:
Oct 1, 2019 3:38:34 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133705
Message:

FE/Qt: bugref:9582: VM settings / Storage page: A bit of doxy for all classes.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r81055 r81095  
    5353
    5454
    55 /** Known item states. */
     55/** Item states. */
    5656enum ItemState
    5757{
     
    6363
    6464
    65 /** Known pixmap types. */
     65/** Pixmap types. */
    6666enum PixmapType
    6767{
     
    159159    {}
    160160
    161     /** Returns whether the @a other passed data is equal to this one. */
     161    /** Returns whether @a another passed data is equal to this one. */
    162162    bool equal(const UIDataSettingsMachineStorageAttachment &other) const
    163163    {
     
    174174    }
    175175
    176     /** Returns whether the @a other passed data is equal to this one. */
     176    /** Returns whether @a another passed data is equal to this one. */
    177177    bool operator==(const UIDataSettingsMachineStorageAttachment &other) const { return equal(other); }
    178     /** Returns whether the @a other passed data is different from this one. */
     178    /** Returns whether @a another passed data is different from this one. */
    179179    bool operator!=(const UIDataSettingsMachineStorageAttachment &other) const { return !equal(other); }
    180180
     
    210210    {}
    211211
    212     /** Returns whether the @a other passed data is equal to this one. */
     212    /** Returns whether @a another passed data is equal to this one. */
    213213    bool equal(const UIDataSettingsMachineStorageController &other) const
    214214    {
     
    222222    }
    223223
    224     /** Returns whether the @a other passed data is equal to this one. */
     224    /** Returns whether @a another passed data is equal to this one. */
    225225    bool operator==(const UIDataSettingsMachineStorageController &other) const { return equal(other); }
    226     /** Returns whether the @a other passed data is different from this one. */
     226    /** Returns whether @a another passed data is different from this one. */
    227227    bool operator!=(const UIDataSettingsMachineStorageController &other) const { return !equal(other); }
    228228
     
    246246    UIDataSettingsMachineStorage() {}
    247247
    248     /** Returns whether the @a other passed data is equal to this one. */
     248    /** Returns whether @a another passed data is equal to this one. */
    249249    bool operator==(const UIDataSettingsMachineStorage & /* other */) const { return true; }
    250     /** Returns whether the @a other passed data is different from this one. */
     250    /** Returns whether @a another passed data is different from this one. */
    251251    bool operator!=(const UIDataSettingsMachineStorage & /* other */) const { return false; }
    252252};
     
    265265    static void destroy();
    266266
    267     /** Returns pixmap corresponding to passed @a pixmapType. */
     267    /** Returns pixmap corresponding to passed @a enmPixmapType. */
    268268    QPixmap pixmap(PixmapType pixmapType) const;
    269     /** Returns icon (probably merged) corresponding to passed @a pixmapType and @a pixmapDisabledType. */
     269    /** Returns icon (probably merged) corresponding to passed @a enmPixmapType and @a pixmapDisabledType. */
    270270    QIcon icon(PixmapType pixmapType, PixmapType pixmapDisabledType = InvalidPixmap) const;
    271271
     
    287287
    288288
    289 /* Abstract Item */
     289/** QITreeViewItem subclass used as abstract storage tree-view item. */
    290290class AbstractItem : public QITreeViewItem
    291291{
     
    294294public:
    295295
     296    /** Item types. */
    296297    enum ItemType
    297298    {
     
    302303    };
    303304
     305    /** Constructs top-level item passing @a pParent to the base-class. */
    304306    AbstractItem(QITreeView *pParent);
     307    /** Constructs sub-level item passing @a pParentItem to the base-class. */
    305308    AbstractItem(AbstractItem *pParentItem);
     309    /** Destructs item. */
    306310    virtual ~AbstractItem();
    307311
     312    /** Returns parent-item. */
    308313    AbstractItem* parent() const;
     314    /** Returns ID. */
    309315    QUuid id() const;
     316
     317    /** Returns machine ID. */
    310318    QUuid machineId() const;
    311 
     319    /** Defines @a uMchineId. */
    312320    void setMachineId (const QUuid &uMchineId);
    313321
     322    /** Returns runtime type information. */
    314323    virtual ItemType rtti() const = 0;
     324    /** Returns child item with specified @a iIndex. */
    315325    virtual AbstractItem* childItem (int aIndex) const = 0;
     326    /** Returns child item with specified @a uId. */
    316327    virtual AbstractItem* childItemById (const QUuid &uId) const = 0;
     328    /** Returns position of specified child @a pItem. */
    317329    virtual int posOfChild (AbstractItem *aItem) const = 0;
     330    /** Returns tool-tip information. */
    318331    virtual QString tip() const = 0;
     332    /** Returns pixmap information for specified @a enmState. */
    319333    virtual QPixmap pixmap (ItemState aState = State_DefaultItem) = 0;
    320334
    321335protected:
    322336
     337    /** Adds a child @a pItem. */
    323338    virtual void addChild (AbstractItem *aItem) = 0;
     339    /** Removes the child @a pItem. */
    324340    virtual void delChild (AbstractItem *aItem) = 0;
    325341
     342    /** Holds the parent item reference. */
    326343    AbstractItem *m_pParentItem;
     344    /** Holds the item ID. */
    327345    QUuid         mId;
     346    /** Holds the item machine ID. */
    328347    QUuid         mMachineId;
    329348};
     
    331350
    332351
    333 /* Root Item */
     352/** AbstractItem subclass used as root storage tree-view item. */
    334353class RootItem : public AbstractItem
    335354{
     
    338357public:
    339358
     359    /** Constructs top-level item passing @a pParent to the base-class. */
    340360    RootItem(QITreeView *pParent);
     361    /** Destructs item. */
    341362   ~RootItem();
    342363
     364    /** Returns a number of shildren of certain @a enmBus type. */
    343365    ULONG childCount (KStorageBus aBus) const;
    344366
    345367private:
    346368
     369    /** Returns runtime type information. */
    347370    ItemType rtti() const;
     371    /** Returns child item with specified @a iIndex. */
    348372    AbstractItem* childItem (int aIndex) const;
     373    /** Returns child item with specified @a uId. */
    349374    AbstractItem* childItemById (const QUuid &uId) const;
     375    /** Returns position of specified child @a pItem. */
    350376    int posOfChild (AbstractItem *aItem) const;
     377    /** Returns the number of children. */
    351378    int childCount() const;
     379    /** Returns the item text. */
    352380    QString text() const;
     381    /** Returns tool-tip information. */
    353382    QString tip() const;
     383    /** Returns pixmap information for specified @a enmState. */
    354384    QPixmap pixmap (ItemState aState);
     385    /** Adds a child @a pItem. */
    355386    void addChild (AbstractItem *aItem);
     387    /** Removes the child @a pItem. */
    356388    void delChild (AbstractItem *aItem);
    357389
     390    /** Holds the list of controller items. */
    358391    QList <AbstractItem*> mControllers;
    359392};
    360393
    361394
    362 /* Controller Item */
     395/** AbstractItem subclass used as controller storage tree-view item. */
    363396class ControllerItem : public AbstractItem
    364397{
     
    367400public:
    368401
     402    /** Constructs sub-level item passing @a pParent to the base-class.
     403      * @param  strName  Brings the controller name.
     404      * @param  enmBus   Brings the controller bus.
     405      * @param  enmType  Brings the controller type. */
    369406    ControllerItem (AbstractItem *aParent, const QString &aName, KStorageBus aBusType,
    370407                    KStorageControllerType aControllerType);
     408    /** Destructs item. */
    371409   ~ControllerItem();
    372410
     411    /** Returns bus. */
    373412    KStorageBus ctrBusType() const;
     413    /** Returns possible buses to switch from current one. */
    374414    ControllerBusList ctrBusTypes() const;
     415    /** Returns old controller name. */
    375416    QString oldCtrName() const;
     417    /** Returns current controller name. */
    376418    QString ctrName() const;
     419    /** Returns type. */
    377420    KStorageControllerType ctrType() const;
     421    /** Returns possible types to switch from current one. */
    378422    ControllerTypeList ctrTypes() const;
     423    /** Returns current port count. */
    379424    uint portCount();
     425    /** Returns maximum port count. */
    380426    uint maxPortCount();
     427    /** Returns whether controller uses IO cache. */
    381428    bool ctrUseIoCache() const;
    382429
     430    /** Defines @a enmBus. */
    383431    void setCtrBusType(KStorageBus enmCtrBusType);
     432    /** Defines @a strName. */
    384433    void setCtrName (const QString &aCtrName);
     434    /** Defines @a enmType. */
    385435    void setCtrType (KStorageControllerType aCtrType);
     436    /** Defines @a uPortCount. */
    386437    void setPortCount (uint aPortCount);
     438    /** Defines whether controller @a fUseIoCache. */
    387439    void setCtrUseIoCache (bool aUseIoCache);
    388440
     441    /** Returns possible controller slots. */
    389442    SlotsList ctrAllSlots() const;
     443    /** Returns used controller slots. */
    390444    SlotsList ctrUsedSlots() const;
     445    /** Returns supported device type list. */
    391446    DeviceTypeList ctrDeviceTypeList() const;
    392447
     448    /** Returns an ID list of attached media of specified @a enmType. */
    393449    QList<QUuid> attachmentIDs(KDeviceType enmType = KDeviceType_Null) const;
    394450
     451    /** Returns a list of attachments. */
    395452    QList<AbstractItem*> attachments() const { return mAttachments; }
     453    /** Defines a list of @a attachments. */
    396454    void setAttachments(const QList<AbstractItem*> &attachments) { mAttachments = attachments; }
    397455
    398456private:
    399457
     458    /** Returns runtime type information. */
    400459    ItemType rtti() const;
     460    /** Returns child item with specified @a iIndex. */
    401461    AbstractItem* childItem (int aIndex) const;
     462    /** Returns child item with specified @a uId. */
    402463    AbstractItem* childItemById (const QUuid &uId) const;
     464    /** Returns position of specified child @a pItem. */
    403465    int posOfChild (AbstractItem *aItem) const;
     466    /** Returns the number of children. */
    404467    int childCount() const;
     468    /** Returns the item text. */
    405469    QString text() const;
     470    /** Returns tool-tip information. */
    406471    QString tip() const;
     472    /** Returns pixmap information for specified @a enmState. */
    407473    QPixmap pixmap (ItemState aState);
     474    /** Adds a child @a pItem. */
    408475    void addChild (AbstractItem *aItem);
     476    /** Removes the child @a pItem. */
    409477    void delChild (AbstractItem *aItem);
    410478
     479    /** Updates possible buses. */
    411480    void updateBusInfo();
     481    /** Updates possible types. */
    412482    void updateTypeInfo();
     483    /** Updates pixmaps of possible buses. */
    413484    void updatePixmaps();
    414485
     486    /** Holds the bus. */
    415487    KStorageBus mBusType;
     488    /** Holds the type. */
    416489    KStorageControllerType mCtrType;
    417490
     491    /** Holds the possible buses. */
    418492    ControllerBusList m_buses;
     493    /** Holds the possible types. */
    419494    ControllerTypeList m_types;
     495    /** Holds the pixmaps of possible buses. */
    420496    QList<PixmapType> m_pixmaps;
    421497
     498    /** Holds the old name. */
    422499    QString mOldCtrName;
     500    /** Holds the current name. */
    423501    QString mCtrName;
     502    /** Holds the current port count. */
    424503    uint mPortCount;
     504    /** Holds whether controller uses IO cache. */
    425505    bool mUseIoCache;
     506    /** Holds the list of attachments. */
    426507    QList <AbstractItem*> mAttachments;
    427508};
    428509
    429510
    430 /* Attachment Item */
     511/** AbstractItem subclass used as attachment storage tree-view item. */
    431512class AttachmentItem : public AbstractItem
    432513{
     
    435516public:
    436517
     518    /** Constructs sub-level item passing @a pParent to the base-class.
     519      * @param  enmDeviceType  Brings the attachment device type. */
    437520    AttachmentItem (AbstractItem *aParent, KDeviceType aDeviceType);
    438521
     522    /** Returns storage slot. */
    439523    StorageSlot attSlot() const;
     524    /** Returns possible storage slots. */
    440525    SlotsList attSlots() const;
     526    /** Returns device type. */
    441527    KDeviceType attDeviceType() const;
     528    /** Returns possible device types. */
    442529    DeviceTypeList attDeviceTypes() const;
     530    /** Returns the medium id. */
    443531    QUuid attMediumId() const;
     532    /** Returns whether attachment is a host drive. */
    444533    bool attIsHostDrive() const;
     534    /** Returns whether attachment is passthrough. */
    445535    bool attIsPassthrough() const;
     536    /** Returns whether attachment is temporary ejectable. */
    446537    bool attIsTempEject() const;
     538    /** Returns whether attachment is non-rotational. */
    447539    bool attIsNonRotational() const;
     540    /** Returns whether attachment is hot-pluggable. */
    448541    bool attIsHotPluggable() const;
    449542
     543    /** Defines storage @a slot. */
    450544    void setAttSlot (const StorageSlot &aAttSlot);
     545    /** Defines @a enmDeviceType. */
    451546    void setAttDevice (KDeviceType aAttDeviceType);
     547    /** Defines @a uMediumId. */
    452548    void setAttMediumId (const QUuid &uAttMediumId);
     549    /** Defines whether attachment is @a fPassthrough. */
    453550    void setAttIsPassthrough (bool aPassthrough);
     551    /** Defines whether attachment is @a fTemporaryEjectable. */
    454552    void setAttIsTempEject (bool aTempEject);
     553    /** Defines whether attachment is @a fNonRotational. */
    455554    void setAttIsNonRotational (bool aNonRotational);
     555    /** Returns whether attachment is @a fIsHotPluggable. */
    456556    void setAttIsHotPluggable(bool fIsHotPluggable);
    457557
     558    /** Returns medium size. */
    458559    QString attSize() const;
     560    /** Returns logical medium size. */
    459561    QString attLogicalSize() const;
     562    /** Returns medium location. */
    460563    QString attLocation() const;
     564    /** Returns medium format. */
    461565    QString attFormat() const;
     566    /** Returns medium details. */
    462567    QString attDetails() const;
     568    /** Returns medium usage. */
    463569    QString attUsage() const;
     570    /** Returns medium encryption password ID. */
    464571    QString attEncryptionPasswordID() const;
    465572
    466573private:
    467574
     575    /** Caches medium information. */
    468576    void cache();
    469577
     578    /** Returns runtime type information. */
    470579    ItemType rtti() const;
     580    /** Returns child item with specified @a iIndex. */
    471581    AbstractItem* childItem (int aIndex) const;
     582    /** Returns child item with specified @a uId. */
    472583    AbstractItem* childItemById (const QUuid &uId) const;
     584    /** Returns position of specified child @a pItem. */
    473585    int posOfChild (AbstractItem *aItem) const;
     586    /** Returns the number of children. */
    474587    int childCount() const;
     588    /** Returns the item text. */
    475589    QString text() const;
     590    /** Returns tool-tip information. */
    476591    QString tip() const;
     592    /** Returns pixmap information for specified @a enmState. */
    477593    QPixmap pixmap (ItemState aState);
     594    /** Adds a child @a pItem. */
    478595    void addChild (AbstractItem *aItem);
     596    /** Removes the child @a pItem. */
    479597    void delChild (AbstractItem *aItem);
    480598
     599    /** Holds the device type. */
    481600    KDeviceType mAttDeviceType;
    482601
     602    /** Holds the storage slot. */
    483603    StorageSlot mAttSlot;
     604    /** Holds the medium ID. */
    484605    QUuid mAttMediumId;
     606    /** Holds whether attachment is a host drive. */
    485607    bool mAttIsHostDrive;
     608    /** Holds whether attachment is passthrough. */
    486609    bool mAttIsPassthrough;
     610    /** Holds whether attachment is temporary ejectable. */
    487611    bool mAttIsTempEject;
     612    /** Holds whether attachment is non-rotational. */
    488613    bool mAttIsNonRotational;
     614    /** Holds whether attachment is hot-pluggable. */
    489615    bool m_fIsHotPluggable;
    490616
     617    /** Holds the name. */
    491618    QString mAttName;
     619    /** Holds the tool-tip. */
    492620    QString mAttTip;
     621    /** Holds the pixmap. */
    493622    QPixmap mAttPixmap;
    494623
     624    /** Holds the medium size. */
    495625    QString mAttSize;
     626    /** Holds the logical medium size. */
    496627    QString mAttLogicalSize;
     628    /** Holds the medium location. */
    497629    QString mAttLocation;
     630    /** Holds the medium format. */
    498631    QString mAttFormat;
     632    /** Holds the medium details. */
    499633    QString mAttDetails;
     634    /** Holds the medium usage. */
    500635    QString mAttUsage;
     636    /** Holds the medium encryption password ID. */
    501637    QString m_strAttEncryptionPasswordID;
    502638};
    503639
    504640
    505 /* Storage Model */
     641/** QAbstractItemModel subclass used as complex storage model. */
    506642class StorageModel : public QAbstractItemModel
    507643{
     
    510646public:
    511647
     648    /** Data roles. */
    512649    enum DataRole
    513650    {
     
    580717    };
    581718
     719    /** Tool-tip types. */
    582720    enum ToolTipType
    583721    {
     
    589727    };
    590728
     729    /** Constructs storage model passing @a pParent to the base-class. */
    591730    StorageModel(QITreeView *pParent);
     731    /** Destructs storage model. */
    592732   ~StorageModel();
    593733
     734    /** Returns row count for the passed @a parentIndex. */
    594735    int rowCount (const QModelIndex &aParent = QModelIndex()) const;
     736    /** Returns column count for the passed @a parentIndex. */
    595737    int columnCount (const QModelIndex &aParent = QModelIndex()) const;
    596738
     739    /** Returns root item. */
    597740    QModelIndex root() const;
     741    /** Returns item specified by @a iRow, @a iColum and @a parentIndex. */
    598742    QModelIndex index (int aRow, int aColumn, const QModelIndex &aParent = QModelIndex()) const;
     743    /** Returns parent item of specified @a index item. */
    599744    QModelIndex parent (const QModelIndex &aIndex) const;
    600745
     746    /** Returns model data for specified @a index and @a iRole. */
    601747    QVariant data (const QModelIndex &aIndex, int aRole) const;
     748    /** Defines model data for specified @a index and @a iRole as @a value. */
    602749    bool setData (const QModelIndex &aIndex, const QVariant &aValue, int aRole);
    603750
     751    /** Adds controller with certain @a strCtrName, @a enmBus and @a enmType. */
    604752    QModelIndex addController (const QString &aCtrName, KStorageBus aBusType, KStorageControllerType aCtrType);
     753    /** Deletes controller with certain @a uCtrId. */
    605754    void delController (const QUuid &uCtrId);
    606755
     756    /** Adds attachment with certain @a enmDeviceType and @a uMediumId to controller with certain @a uCtrId. */
    607757    QModelIndex addAttachment (const QUuid &uCtrId, KDeviceType aDeviceType, const QUuid &uMediumId);
     758    /** Deletes attachment with certain @a uAttId from controller with certain @a uCtrId. */
    608759    void delAttachment (const QUuid &uCtrId, const QUuid &uAttId);
    609     /** Moves attachment determined by @a uAttId
    610       * from controller determined by @a uCtrOldId to one determined by @a uCtrNewId. */
     760    /** Moves attachment with certain @a uAttId from controller with certain @a uCtrOldId to one with another @a uCtrNewId. */
    611761    void moveAttachment(const QUuid &uAttId, const QUuid &uCtrOldId, const QUuid &uCtrNewId);
    612762
     763    /** Defines @a uMachineId for reference. */
    613764    void setMachineId (const QUuid &uMachineId);
    614765
     766    /** Sorts the contents of model by @a iColumn and @a enmOrder. */
    615767    void sort(int iColumn = 0, Qt::SortOrder order = Qt::AscendingOrder);
     768    /** Returns attachment index by specified @a controllerIndex and @a attachmentStorageSlot. */
    616769    QModelIndex attachmentBySlot(QModelIndex controllerIndex, StorageSlot attachmentStorageSlot);
    617770
     771    /** Returns chipset type. */
    618772    KChipsetType chipsetType() const;
     773    /** Defines chipset @a enmType. */
    619774    void setChipsetType(KChipsetType type);
    620775
    621     /** Defines configuration access level. */
     776    /** Defines @a newConfigurationAccessLevel. */
    622777    void setConfigurationAccessLevel(ConfigurationAccessLevel newConfigurationAccessLevel);
    623778
     779    /** Clears model of all contents. */
    624780    void clear();
    625781
     782    /** Returns current controller types. */
    626783    QMap<KStorageBus, int> currentControllerTypes() const;
     784    /** Returns maximum controller types. */
    627785    QMap<KStorageBus, int> maximumControllerTypes() const;
    628786
    629787private:
    630788
     789    /** Returns model flags for specified @a index. */
    631790    Qt::ItemFlags flags (const QModelIndex &aIndex) const;
    632791
     792    /** Holds the root item instance. */
    633793    AbstractItem *mRootItem;
    634794
     795    /** Holds the enabled plus pixmap instance. */
    635796    QPixmap mPlusPixmapEn;
     797    /** Holds the disabled plus pixmap instance. */
    636798    QPixmap mPlusPixmapDis;
    637799
     800    /** Holds the enabled minus pixmap instance. */
    638801    QPixmap mMinusPixmapEn;
     802    /** Holds the disabled minus pixmap instance. */
    639803    QPixmap mMinusPixmapDis;
    640804
     805    /** Holds the tool-tip type. */
    641806    ToolTipType mToolTipType;
    642807
     808    /** Holds the chipset type. */
    643809    KChipsetType m_chipsetType;
    644810
     
    649815
    650816
    651 /* Storage Delegate */
     817/** QItemDelegate subclass used as storage table item delegate. */
    652818class StorageDelegate : public QItemDelegate
    653819{
     
    656822public:
    657823
     824    /** Constructs storage delegate passing @a pParent to the base-class. */
    658825    StorageDelegate (QObject *aParent);
    659826
    660827private:
    661828
     829    /** Paints @a index item with specified @a option using specified @a pPainter. */
    662830    void paint (QPainter *aPainter, const QStyleOptionViewItem &aOption, const QModelIndex &aIndex) const;
    663831};
    664832
    665833
    666 /**
    667  * UI Medium ID Holder.
    668  * Used for compliance with other storage page widgets
    669  * which caching and holding corresponding information.
    670  */
     834/** QObject subclass used as UI medium ID holder.
     835  * Used for compliance with other storage page widgets
     836  * which caching and holding corresponding information. */
    671837class UIMediumIDHolder : public QObject
    672838{
     
    675841public:
    676842
     843    /** Constructs medium ID holder passing @a pParent to the base-class. */
    677844    UIMediumIDHolder(QWidget *pParent) : QObject(pParent) {}
    678845
     846    /** Returns medium ID. */
    679847    QUuid id() const { return m_uId; }
     848    /** Defines medium @a uId. */
    680849    void setId(const QUuid &uId) { m_uId = uId; emit sigChanged(); }
    681850
     851    /** Returns medium device type. */
    682852    UIMediumDeviceType type() const { return m_type; }
     853    /** Defines medium device @a enmType. */
    683854    void setType(UIMediumDeviceType type) { m_type = type; }
    684855
     856    /** Returns whether medium ID is null. */
    685857    bool isNull() const { return m_uId == UIMedium().id(); }
    686858
    687859signals:
    688860
     861    /** Notify about medium ID changed. */
    689862    void sigChanged();
    690863
    691864private:
    692865
     866    /** Holds the medium ID. */
    693867    QUuid m_uId;
     868    /** Holds the medium device type. */
    694869    UIMediumDeviceType m_type;
    695870};
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h

    r81055 r81095  
    6161    ~UIMachineSettingsStorage();
    6262
    63     /** Defines chipset @a type. */
     63    /** Defines chipset @a enmType. */
    6464    void setChipsetType(KChipsetType enmType);
    6565
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