Introduce ListWidget.
[dorian] / widgets / listwindow.h
1 #ifndef LISTWINDOW_H
2 #define LISTWINDOW_H
3
4 #include <QMainWindow>
5 #include <QDialogButtonBox>
6
7 class QListView;
8 class QString;
9 class QHBoxLayout;
10
11 /** A window with a list and menu actions (Maemo) or buttons (non-Maemo). */
12 class ListWindow: public QMainWindow
13 {
14     Q_OBJECT
15
16 public:
17     explicit ListWindow(QWidget *parent = 0);
18     void addList(QListView *list);
19     void addAction(const QString &title, QObject *receiver, const char *slot,
20         QDialogButtonBox::ButtonRole role = QDialogButtonBox::ActionRole);
21
22 protected:
23 #ifdef Q_WS_MAEMO_5
24     void closeEvent(QCloseEvent *event);
25 #else
26     QDialogButtonBox *buttonBox;
27 #endif
28     QHBoxLayout *layout;
29 };
30
31 #endif // LISTWINDOW_H