Symbian fixes: full screen mode, dialog softkeys.
[dorian] / widgets / dyalog.h
1 #ifndef DYALOG_H
2 #define DYALOG_H
3
4 #include <QDialog>
5 #include <QDialogButtonBox>
6
7 class QWidget;
8 class QPushButton;
9 class QScrollArea;
10 class QVBoxLayout;
11 class QMenuBar;
12
13 /** Maemo- and Mac-friendly dialog box. */
14 class Dyalog: public QDialog
15 {
16     Q_OBJECT
17
18 public:
19     explicit Dyalog(QWidget *parent, bool showButtons = true);
20
21     /** Add widget to the scrollable content pane. */
22     void addWidget(QWidget *widget);
23
24     /** Add stretch to the scrollable content pane. */
25     void addStretch(int stretch = 0);
26
27     /** Add button to the dialog button box. */
28     void addButton(const QString &label, QObject *receiver, const char *slot,
29         QDialogButtonBox::ButtonRole role = QDialogButtonBox::AcceptRole);
30
31 public slots:
32 #ifdef Q_OS_SYMBIAN
33     void show();
34     int exec();
35 #endif
36
37 private:
38     QScrollArea *scroller;
39     QWidget *content;
40     QVBoxLayout *contentLayout;
41     QDialogButtonBox *buttonBox;
42     bool showButtons;
43 #ifdef Q_OS_SYMBIAN
44     QMenuBar *menuBar;
45 #endif
46 };
47
48 #endif // DYALOG_H