Changeset 72026 in vbox for trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIStatusBarEditorWindow.h
- Timestamp:
- Apr 25, 2018 5:17:52 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 122289
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIStatusBarEditorWindow.h
r72025 r72026 5 5 6 6 /* 7 * Copyright (C) 2014-201 7Oracle Corporation7 * Copyright (C) 2014-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 21 21 /* Qt includes: */ 22 #include <QList> 22 23 #include <QMap> 23 #include <QList>24 24 25 25 /* GUI includes: */ 26 #include "QIWithRetranslateUI.h" 26 27 #include "UIExtraDataDefs.h" 28 #include "UILibraryDefs.h" 27 29 #include "UISlidingToolBar.h" 28 #include "QIWithRetranslateUI.h"29 30 30 31 /* Forward declarations: */ 32 class QCheckBox; 33 class QDragEnterEvent; 34 class QDragLeaveEvent; 35 class QDragMoveEvent; 36 class QDropEvent; 37 class QHBoxLayout; 38 class QPaintEvent; 39 class QString; 40 class QWidget; 41 class QIToolButton; 42 class UIMachineWindow; 31 43 class UIStatusBarEditorButton; 32 class UIMachineWindow;33 class QIToolButton;34 class QHBoxLayout;35 class QCheckBox;36 44 37 /** UISlidingToolBar wrapper 45 46 /** UISlidingToolBar subclass 38 47 * providing user with possibility to edit status-bar layout. */ 39 class UIStatusBarEditorWindow : public UISlidingToolBar48 class SHARED_LIBRARY_STUFF UIStatusBarEditorWindow : public UISlidingToolBar 40 49 { 41 50 Q_OBJECT; … … 43 52 public: 44 53 45 /** Construct or, passes @a pParent to the UISlidingToolBar constructor. */54 /** Constructs sliding toolbar passing @a pParent to the base-class. */ 46 55 UIStatusBarEditorWindow(UIMachineWindow *pParent); 47 56 }; 48 57 49 /** QWidget reimplementation 58 59 /** QWidget subclass 50 60 * used as status-bar editor widget. */ 51 class UIStatusBarEditorWidget : public QIWithRetranslateUI2<QWidget>61 class SHARED_LIBRARY_STUFF UIStatusBarEditorWidget : public QIWithRetranslateUI2<QWidget> 52 62 { 53 63 Q_OBJECT; … … 60 70 public: 61 71 62 /** Constructor, 63 * @param pParent is passed to QWidget constructor, 64 * @param fStartedFromVMSettings determines whether 'this' is a part of VM settings, 65 * @param strMachineID brings the machine ID to be used by the editor. */ 72 /** Constructs status-bar editor widget passing @a pParent to the base-class. 73 * @param fStartedFromVMSettings Brings whether 'this' is a part of VM settings. 74 * @param strMachineID Brings the machine ID to be used by the editor. */ 66 75 UIStatusBarEditorWidget(QWidget *pParent, 67 76 bool fStartedFromVMSettings = true, … … 69 78 70 79 /** Returns the machine ID instance. */ 71 const QString &machineID() const { return m_strMachineID; }80 const QString &machineID() const { return m_strMachineID; } 72 81 /** Defines the @a strMachineID instance. */ 73 82 void setMachineID(const QString &strMachineID); … … 79 88 80 89 /** Returns status-bar indicator restrictions. */ 81 const QList<IndicatorType> &statusBarIndicatorRestrictions() const { return m_restrictions; }90 const QList<IndicatorType> &statusBarIndicatorRestrictions() const { return m_restrictions; } 82 91 /** Returns status-bar indicator order. */ 83 const QList<IndicatorType> &statusBarIndicatorOrder() const { return m_order; }92 const QList<IndicatorType> &statusBarIndicatorOrder() const { return m_order; } 84 93 /** Defines status-bar indicator @a restrictions and @a order. */ 85 94 void setStatusBarConfiguration(const QList<IndicatorType> &restrictions, const QList<IndicatorType> &order); 95 96 protected: 97 98 /** Handles translation event. */ 99 virtual void retranslateUi() /* override */; 100 101 /** Handles paint @a pEvent. */ 102 virtual void paintEvent(QPaintEvent *pEvent) /* override */; 103 104 /** Handles drag-enter @a pEvent. */ 105 virtual void dragEnterEvent(QDragEnterEvent *pEvent) /* override */; 106 /** Handles drag-move @a pEvent. */ 107 virtual void dragMoveEvent(QDragMoveEvent *pEvent) /* override */; 108 /** Handles drag-leave @a pEvent. */ 109 virtual void dragLeaveEvent(QDragLeaveEvent *pEvent) /* override */; 110 /** Handles drop @a pEvent. */ 111 virtual void dropEvent(QDropEvent *pEvent) /* override */; 86 112 87 113 private slots: … … 98 124 private: 99 125 100 /** Prepare routine. */126 /** Prepares all. */ 101 127 void prepare(); 102 /** Prepare status buttons routine. */128 /** Prepares status-buttons. */ 103 129 void prepareStatusButtons(); 104 /** Prepare status button routine. */105 void prepareStatusButton(IndicatorType type);130 /** Prepares status-button of certain @a enmType. */ 131 void prepareStatusButton(IndicatorType enmType); 106 132 107 /** Retranslation routine. */ 108 virtual void retranslateUi(); 109 110 /** Paint event handler. */ 111 virtual void paintEvent(QPaintEvent *pEvent); 112 113 /** Drag-enter event handler. */ 114 virtual void dragEnterEvent(QDragEnterEvent *pEvent); 115 /** Drag-move event handler. */ 116 virtual void dragMoveEvent(QDragMoveEvent *pEvent); 117 /** Drag-leave event handler. */ 118 virtual void dragLeaveEvent(QDragLeaveEvent *pEvent); 119 /** Drop event handler. */ 120 virtual void dropEvent(QDropEvent *pEvent); 121 122 /** Returns position for passed @a type. */ 123 int position(IndicatorType type) const; 133 /** Returns position for passed @a enmType. */ 134 int position(IndicatorType enmType) const; 124 135 125 136 /** @name General 126 137 * @{ */ 127 138 /** Holds whether 'this' is prepared. */ 128 bool m_fPrepared;139 bool m_fPrepared; 129 140 /** Holds whether 'this' is a part of VM settings. */ 130 bool m_fStartedFromVMSettings;141 bool m_fStartedFromVMSettings; 131 142 /** Holds the machine ID instance. */ 132 QString m_strMachineID;143 QString m_strMachineID; 133 144 /** @} */ 134 145 … … 136 147 * @{ */ 137 148 /** Holds the main-layout instance. */ 138 QHBoxLayout *m_pMainLayout;149 QHBoxLayout *m_pMainLayout; 139 150 /** Holds the button-layout instance. */ 140 QHBoxLayout *m_pButtonLayout;151 QHBoxLayout *m_pButtonLayout; 141 152 /** Holds the close-button instance. */ 142 QIToolButton *m_pButtonClose;153 QIToolButton *m_pButtonClose; 143 154 /** Holds the enable-checkbox instance. */ 144 QCheckBox *m_pCheckBoxEnable;155 QCheckBox *m_pCheckBoxEnable; 145 156 /** Holds status-bar buttons. */ 146 QMap<IndicatorType, UIStatusBarEditorButton*> m_buttons;157 QMap<IndicatorType, UIStatusBarEditorButton*> m_buttons; 147 158 /** @} */ 148 159 … … 150 161 * @{ */ 151 162 /** Holds the cached status-bar button restrictions. */ 152 QList<IndicatorType> m_restrictions;163 QList<IndicatorType> m_restrictions; 153 164 /** @} */ 154 165 … … 156 167 * @{ */ 157 168 /** Holds the cached status-bar button order. */ 158 QList<IndicatorType> m_order;169 QList<IndicatorType> m_order; 159 170 /** Holds the token-button to drop dragged-button nearby. */ 160 171 UIStatusBarEditorButton *m_pButtonDropToken; 161 172 /** Holds whether dragged-button should be dropped <b>after</b> the token-button. */ 162 bool m_fDropAfterTokenButton;173 bool m_fDropAfterTokenButton; 163 174 /** @} */ 164 175 }; 165 176 177 166 178 #endif /* !___UIStatusBarEditorWindow_h___ */
Note:
See TracChangeset
for help on using the changeset viewer.