Added handling of sorting preferences
[quandoparte] / application / stationlistview.h
1 #ifndef STATIONLISTVIEW_H
2 #define STATIONLISTVIEW_H
3
4 #include <QMainWindow>
5 #include <QModelIndex>
6 #include <QGeoPositionInfoSource>
7
8 namespace Ui {
9     class StationListView;
10 }
11
12 class QActionGroup;
13 class QStringListModel;
14 class QSortFilterProxyModel;
15 class KeyPressForwarder;
16
17 class StationView;
18 class StationListModel;
19 class StationListProxyModel;
20
21 QTM_USE_NAMESPACE
22
23 class StationListView : public QMainWindow
24 {
25     Q_OBJECT
26
27 public:
28     explicit StationListView(StationListModel *model, QWidget *parent = 0);
29     ~StationListView();
30
31 signals:
32     void stationSelected(const QString &);
33     void aboutTriggered(void);
34
35 public slots:
36     void updatePosition(const QGeoPositionInfo &update);
37
38 private slots:
39     void showSettings(void);
40     void showStation(const QModelIndex &index);
41     void handleFilterChanges(const QString &filter);
42     void handleSortingChange(const QAction *action);
43
44 private:
45     Ui::StationListView *ui;
46     QActionGroup *viewSelectionGroup;
47     StationListModel *stationListModel;
48     StationListProxyModel *filterModel;
49     KeyPressForwarder *keyPressForwarder;
50 };
51
52 #endif // STATIONLISTVIEW_H