5 #include <QDialogButtonBox>
15 /** A window with a list and menu actions (Maemo) or buttons (non-Maemo). */
16 class ListWindow: public QMainWindow
21 explicit ListWindow(QWidget *parent = 0);
23 /** Add a list view to the window. */
24 void addList(QListView *list);
27 * Add an action to the window: either a button, or, on Maemo, a top
29 * Activating the action invokes the slot with no parameters.
31 void addAction(const QString &title, QObject *receiver, const char *slot,
32 QDialogButtonBox::ButtonRole role = QDialogButtonBox::ActionRole);
35 * Add an action to the selected item in the list: either a button which is
36 * enabled when a list item is selected, or, on Maemo, a pop-up menu item
37 * which is displayed when a list item is long-pressed.
38 * Activating the action invokes the slot with no parameters.
40 void addItemAction(const QString &title, QObject *receiver,
44 void onSelectionChanged(const QItemSelection &selected,
45 const QItemSelection &deselected);
47 void activateItemButtons();
52 void closeEvent(QCloseEvent *event);
54 QDialogButtonBox *buttonBox;
55 QList<QPushButton *> itemButtons;
57 QHBoxLayout *frameLayout;
61 #endif // LISTWINDOW_H