1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * VirtualBox Qt extensions: QIDialogButtonBox class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2008 Oracle Corporation
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef __QIDialogButtonBox_h__
|
---|
20 | #define __QIDialogButtonBox_h__
|
---|
21 |
|
---|
22 | #include "QIWithRetranslateUI.h"
|
---|
23 |
|
---|
24 | /* Qt includes */
|
---|
25 | #include <QDialogButtonBox>
|
---|
26 | #include <QPointer>
|
---|
27 |
|
---|
28 | class QBoxLayout;
|
---|
29 |
|
---|
30 | class UIHelpButton;
|
---|
31 |
|
---|
32 | class QIDialogButtonBox: public QIWithRetranslateUI<QDialogButtonBox>
|
---|
33 | {
|
---|
34 | public:
|
---|
35 | QIDialogButtonBox (QWidget *aParent = 0) :QIWithRetranslateUI<QDialogButtonBox> (aParent) {}
|
---|
36 | QIDialogButtonBox (Qt::Orientation aOrientation, QWidget *aParent = 0) :QIWithRetranslateUI<QDialogButtonBox> (aParent) { setOrientation (aOrientation); }
|
---|
37 | QIDialogButtonBox (StandardButtons aButtons, Qt::Orientation aOrientation = Qt::Horizontal, QWidget *aParent = 0);
|
---|
38 |
|
---|
39 | QPushButton *button (StandardButton aWhich) const;
|
---|
40 |
|
---|
41 | QPushButton *addButton (const QString &aText, ButtonRole aRole);
|
---|
42 | QPushButton *addButton (StandardButton aButton);
|
---|
43 |
|
---|
44 | void setStandardButtons (StandardButtons aButtons);
|
---|
45 |
|
---|
46 | void addExtraWidget (QWidget *aWidget);
|
---|
47 | void addExtraLayout (QLayout *aLayout);
|
---|
48 |
|
---|
49 | protected:
|
---|
50 |
|
---|
51 | QBoxLayout *boxLayout() const;
|
---|
52 | int findEmptySpace (QBoxLayout *aLayout) const;
|
---|
53 |
|
---|
54 | void retranslateUi();
|
---|
55 |
|
---|
56 | private:
|
---|
57 |
|
---|
58 | QPointer<UIHelpButton> mHelpButton;
|
---|
59 | };
|
---|
60 |
|
---|
61 | #endif /* __QIDialogButtonBox_h__ */
|
---|
62 |
|
---|