VirtualBox

Ignore:
Timestamp:
Jul 20, 2015 3:23:30 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101741
Message:

FE/Qt: 5978: Mini-toolbar: Doxy.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/widgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r57022 r57023  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIMiniToolBar class implementation (fullscreen/seamless).
     3 * VBox Qt GUI - UIMiniToolBar class implementation.
    44 */
    55
    66/*
    7  * Copyright (C) 2009-2013 Oracle Corporation
     7 * Copyright (C) 2009-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4343#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    4444
    45 /* Mini-toolbar widget prototype: */
     45/** UIToolBar reimplementation
     46  * providing UIMiniToolBar with mini-toolbar. */
    4647class UIMiniToolBarPrivate : public UIToolBar
    4748{
     
    5051signals:
    5152
    52     /* Notifier: Resize stuff: */
     53    /** Notifies listeners about we are resized. */
    5354    void sigResized();
    5455
    55     /* Notifiers: Action stuff: */
     56    /** Notifies listeners about action triggered to toggle auto-hide. */
    5657    void sigAutoHideToggled();
     58    /** Notifies listeners about action triggered to minimize. */
    5759    void sigMinimizeAction();
     60    /** Notifies listeners about action triggered to exit. */
    5861    void sigExitAction();
     62    /** Notifies listeners about action triggered to close. */
    5963    void sigCloseAction();
    6064
    6165public:
    6266
    63     /* Constructor: */
     67    /** Constructor. */
    6468    UIMiniToolBarPrivate();
    6569
    66     /* API: Alignment stuff: */
     70    /** Defines @a alignment. */
    6771    void setAlignment(Qt::Alignment alignment);
    6872
    69     /* API: Auto-hide stuff: */
     73    /** Returns whether we do auto-hide. */
    7074    bool autoHide() const;
     75    /** Defines whether we do @a fAutoHide. */
    7176    void setAutoHide(bool fAutoHide);
    7277
    73     /* API: Text stuff: */
     78    /** Defines our @a strText. */
    7479    void setText(const QString &strText);
    7580
    76     /* API: Menu aggregator: */
     81    /** Adds our @a menus. */
    7782    void addMenus(const QList<QMenu*> &menus);
    7883
    7984protected:
    8085
    81     /* Handlers: Event-processing stuff: */
     86    /** Show @a pEvent handler. */
    8287    virtual void showEvent(QShowEvent *pEvent);
     88    /** Polish @a pEvent handler. */
    8389    virtual void polishEvent(QShowEvent *pEvent);
     90    /** Resize @a pEvent handler. */
    8491    virtual void resizeEvent(QResizeEvent *pEvent);
     92    /** Paint @a pEvent handler. */
    8593    virtual void paintEvent(QPaintEvent *pEvent);
    8694
    8795private:
    8896
    89     /* Helper: Prepare stuff: */
     97    /** Prepare routine. */
    9098    void prepare();
    9199
    92     /* Helper: Shape stuff: */
     100    /** Rebuilds our shape. */
    93101    void rebuildShape();
    94102
    95     /* Variables: General stuff: */
     103    /** Holds whether this widget was polished. */
    96104    bool m_fPolished;
     105    /** Holds the alignment type. */
    97106    Qt::Alignment m_alignment;
     107    /** Holds the shape. */
    98108    QPainterPath m_shape;
    99109
    100     /* Variables: Contents stuff: */
     110    /** Holds the action to toggle auto-hide. */
    101111    QAction *m_pAutoHideAction;
     112    /** Holds the name label. */
    102113    QLabel *m_pLabel;
     114    /** Holds the action to trigger minimize. */
    103115    QAction *m_pMinimizeAction;
     116    /** Holds the action to trigger exit. */
    104117    QAction *m_pRestoreAction;
     118    /** Holds the action to trigger close. */
    105119    QAction *m_pCloseAction;
    106120
    107     /* Variables: Menu stuff: */
     121    /** Holds the pointer to the place to insert menu. */
    108122    QAction *m_pMenuInsertPosition;
    109123
    110     /* Variables: Spacers stuff: */
     124    /** Holds the spacings. */
    111125    QList<QWidget*> m_spacings;
     126    /** Holds the margins. */
    112127    QList<QWidget*> m_margins;
    113128};
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h

    r57021 r57023  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIMiniToolBar class declaration (fullscreen/seamless).
     3 * VBox Qt GUI - UIMiniToolBar class declaration.
    44 */
    55
    66/*
    7  * Copyright (C) 2009-2013 Oracle Corporation
     7 * Copyright (C) 2009-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIMiniToolBar_h__
    19 #define __UIMiniToolBar_h__
    20 
    21 /* Qt includes: */
    22 #include <QMainWindow>
     18#ifndef ___UIMiniToolBar_h___
     19#define ___UIMiniToolBar_h___
    2320
    2421/* GUI includes: */
     
    2623
    2724/* Forward declarations: */
     25class QMenu;
    2826class QTimer;
    2927class QLabel;
    30 class QMenu;
    3128class QMdiArea;
    32 class UIMiniToolBar;
    3329class QMdiSubWindow;
    3430class UIAnimation;
     
    4238};
    4339
    44 /* Runtime mini-toolbar frameless-window prototype: */
     40/** QWidget reimplementation
     41  * providing GUI with slideable mini-toolbar used in full-screen/seamless modes. */
    4542class UIMiniToolBar : public QWidget
    4643{
     
    5249signals:
    5350
    54     /* Notifiers: Action stuff: */
     51    /** Notifies listeners about action triggered to minimize. */
    5552    void sigMinimizeAction();
     53    /** Notifies listeners about action triggered to exit. */
    5654    void sigExitAction();
     55    /** Notifies listeners about action triggered to close. */
    5756    void sigCloseAction();
    5857
    59     /* Notifiers: Hover stuff: */
     58    /** Notifies listeners about we are hovered. */
    6059    void sigHoverEnter();
     60    /** Notifies listeners about we are unhovered. */
    6161    void sigHoverLeave();
    6262
     
    6666public:
    6767
    68     /* Constructor/destructor: */
     68    /** Constructor, passes @a pParent to the QWidget constructor.
     69      * @param geometryType determines the geometry type,
     70      * @param alignment    determines the alignment type,
     71      * @param fAutoHide    determines whether we should auto-hide. */
    6972    UIMiniToolBar(QWidget *pParent,
    7073                  GeometryType geometryType,
    7174                  Qt::Alignment alignment,
    7275                  bool fAutoHide = true);
     76    /** Destructor. */
    7377    ~UIMiniToolBar();
    7478
    75     /* API: Alignment stuff: */
     79    /** Defines @a alignment. */
    7680    void setAlignment(Qt::Alignment alignment);
    7781
    78     /* API: Auto-hide stuff: */
     82    /** Returns whether internal widget do auto-hide. */
    7983    bool autoHide() const { return m_fAutoHide; }
     84    /** Defines whether internal widget do @a fAutoHide.
     85      * @param fPropagateToChild determines should we propagate defined
     86      *                          option value to internal widget. */
    8087    void setAutoHide(bool fAutoHide, bool fPropagateToChild = true);
    8188
    82     /* API: Text stuff: */
     89    /** Defines @a strText for internal widget. */
    8390    void setText(const QString &strText);
    8491
    85     /* API: Menu stuff: */
     92    /** Adds @a menus to internal widget. */
    8693    void addMenus(const QList<QMenu*> &menus);
    8794
    88     /* API: Geometry stuff: */
     95    /** Adjusts geometry according to @a iHostScreen. */
    8996    void adjustGeometry(int iHostScreen = -1);
    9097
    9198private slots:
    9299
    93     /* Handlers: Toolbar stuff: */
     100    /** Handles internal widget resize event. */
    94101    void sltHandleToolbarResize();
     102
     103    /** Handles internal widget auto-hide toggling. */
    95104    void sltAutoHideToggled();
     105
     106    /** Handles hovering. */
    96107    void sltHoverEnter();
     108    /** Handles unhovering. */
    97109    void sltHoverLeave();
     110
     111    /** Notifies listeners about we stole focus. */
     112    void sltNotifyAboutFocusStolen() { emit sigNotifyAboutFocusStolen(); }
    98113
    99114private:
    100115
    101     /* Helpers: Prepare/cleanup stuff: */
     116    /** Prepare routine. */
    102117    void prepare();
     118    /** Cleanup routine. */
    103119    void cleanup();
    104120
    105     /* Handlers: Event-processing stuff: */
     121    /** Mouse enter @a pEvent handler. */
    106122    void enterEvent(QEvent *pEvent);
     123    /** Mouse leave @a pEvent handler. */
    107124    void leaveEvent(QEvent *pEvent);
    108125
    109126#ifdef Q_WS_X11
    110     /** X11: Resize event handler. */
     127    /** X11: Resize @a pEvent handler. */
    111128    void resizeEvent(QResizeEvent *pEvent);
    112129#endif /* Q_WS_X11 */
     
    116133    bool eventFilter(QObject *pWatched, QEvent *pEvent);
    117134
    118     /* Helper: Hover stuff: */
     135    /** Simulates auto-hide animation. */
    119136    void simulateToolbarAutoHiding();
    120137
    121     /* Property: Hover stuff: */
    122     void setToolbarPosition(QPoint point);
     138    /** Defines internal widget @a position. */
     139    void setToolbarPosition(QPoint position);
     140    /** Returns internal widget position. */
    123141    QPoint toolbarPosition() const;
     142    /** Returns internal widget position when it's hidden. */
    124143    QPoint hiddenToolbarPosition() const { return m_hiddenToolbarPosition; }
     144    /** Returns internal widget position when it's shown. */
    125145    QPoint shownToolbarPosition() const { return m_shownToolbarPosition; }
    126146
    127     /* Variables: General stuff: */
     147    /** Holds the geometry type. */
    128148    const GeometryType m_geometryType;
     149    /** Holds the alignment type. */
    129150    Qt::Alignment m_alignment;
     151    /** Holds whether we should auto-hide. */
    130152    bool m_fAutoHide;
    131153
    132     /* Variables: Contents stuff: */
     154    /** Holds the MDI-area. */
    133155    QMdiArea *m_pMdiArea;
     156    /** Holds the internal widget. */
    134157    UIMiniToolBarPrivate *m_pToolbar;
     158    /** Holds the pointer to the wrapped
     159      * internal widget inside the MDI-area. */
    135160    QMdiSubWindow *m_pEmbeddedToolbar;
    136161
    137     /* Variables: Hover stuff: */
     162    /** Holds whether we are hovered. */
    138163    bool m_fHovered;
     164    /** Holds the hover timer. */
    139165    QTimer *m_pHoverEnterTimer;
     166    /** Holds the unhover timer. */
    140167    QTimer *m_pHoverLeaveTimer;
     168    /** Holds the internal widget position when it's hidden. */
    141169    QPoint m_hiddenToolbarPosition;
     170    /** Holds the internal widget position when it's shown. */
    142171    QPoint m_shownToolbarPosition;
     172    /** Holds the animation framework object. */
    143173    UIAnimation *m_pAnimation;
    144174};
    145175
    146 #endif // __UIMiniToolBar_h__
     176#endif /* !___UIMiniToolBar_h___ */
    147177
Note: See TracChangeset for help on using the changeset viewer.

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