Facelift bookmarks dialog. Add Maemo-friendly dialog box class.
[dorian] / dialog.h
1 #ifndef DIALOG_H
2 #define DIALOG_H
3
4 #include <QDialog>
5 #include <QDialogButtonBox>
6
7 class QWidget;
8 class QPushButton;
9 class QScrollArea;
10 class QVBoxLayout;
11
12 /** Maemo- and Mac-friendly dialog box. */
13 class Dialog: public QDialog
14 {
15     Q_OBJECT
16
17 public:
18     explicit Dialog(QWidget *parent = 0);
19
20     /** Add widget to the scrollable content pane. */
21     void addWidget(QWidget *widget);
22
23     /** Add stretch to the scrollable content pane. */
24     void addStretch(int stretch = 0);
25
26     /** Add button to the dialog button box. */
27     void addButton(QPushButton *button,
28         QDialogButtonBox::ButtonRole role = QDialogButtonBox::AcceptRole);
29
30 protected:
31     QScrollArea *scroller;
32     QWidget *content;
33     QVBoxLayout *contentLayout;
34     QDialogButtonBox *buttonBox;
35 };
36
37 #endif // DIALOG_H