Bump version to 0.9.0
[quandoparte] / application / stationlistview.h
1 #ifndef STATIONLISTVIEW_H
2 #define STATIONLISTVIEW_H
3
4 /*
5
6 Copyright (C) 2011 Luciano Montanaro <mikelima@cirulla.net>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; see the file COPYING.  If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA.
22
23 */
24
25 #include "stationlistproxymodel.h"
26
27 #include <QMainWindow>
28 #include <QModelIndex>
29
30 namespace Ui {
31     class StationListView;
32 }
33
34 class QActionGroup;
35 class QStringListModel;
36 class QSortFilterProxyModel;
37 class KeyPressForwarder;
38
39 class StationView;
40 class StationListModel;
41 class StationListProxyModel;
42
43 QTM_USE_NAMESPACE
44
45 class StationListView : public QMainWindow
46 {
47     Q_OBJECT
48 public:
49     explicit StationListView(StationListModel *model, QWidget *parent = 0);
50     ~StationListView();
51
52    void setSortingMode(StationListProxyModel::SortingMode mode);
53    StationListProxyModel::SortingMode sortingMode(void);
54
55 signals:
56     void stationSelected(const QString &);
57     void aboutTriggered(void);
58     void settingsChangeRequested(void);
59     void sortingModeChanged(StationListProxyModel::SortingMode mode);
60
61 private slots:
62     void showStation(const QModelIndex &index);
63     void handleFilterChanges(const QString &filter);
64     void handleSortingChange(QAction *action);
65
66     void handlefilterClearClick();
67
68     private:
69     Ui::StationListView *ui;
70     QActionGroup *viewSelectionGroup;
71     StationListModel *stationListModel;
72     StationListProxyModel *filterModel;
73     KeyPressForwarder *keyPressForwarder;
74     StationListProxyModel::SortingMode m_sortingMode;
75 };
76
77 #endif // STATIONLISTVIEW_H