5 #include <QDialogButtonBox>
18 /** A window with a list and menu actions (Maemo) or buttons (non-Maemo). */
19 class ListWindow: public QMainWindow
24 explicit ListWindow(QWidget *parent = 0);
26 /** Add a list view to the window. */
27 void addList(ListView *list);
30 * Add an action to the window: either a button, or, on Maemo, a top
32 * Activating the action invokes the slot with no parameters.
34 void addAction(const QString &title, QObject *receiver, const char *slot,
35 const QString &iconPath = QString(),
36 QDialogButtonBox::ButtonRole role = QDialogButtonBox::ActionRole);
39 * Add an action to the selected item in the list: either a button which is
40 * enabled when a list item is selected, or, on Maemo, a pop-up menu item
41 * which is displayed when a list item is long-pressed.
42 * Activating the action invokes the slot with no parameters.
44 void addItemAction(const QString &title, QObject *receiver,
53 void onSelectionChanged(const QItemSelection &selected,
54 const QItemSelection &deselected);
56 void onModelChanged();
58 void activateItemButtons();
63 bool eventFilter(QObject *obj, QEvent *event);
64 void closeEvent(QCloseEvent *event);
67 QDialogButtonBox *buttonBox;
68 QList<QPushButton *> itemButtons;
69 #endif // Q_WS_MAEMO_5
73 QBoxLayout *contentLayout;
77 #endif // LISTWINDOW_H