Added boilerplate license comment were it was missing
[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 #include <QGeoPositionInfoSource>
30
31 namespace Ui {
32     class StationListView;
33 }
34
35 class QActionGroup;
36 class QStringListModel;
37 class QSortFilterProxyModel;
38 class KeyPressForwarder;
39
40 class StationView;
41 class StationListModel;
42 class StationListProxyModel;
43
44 QTM_USE_NAMESPACE
45
46 class StationListView : public QMainWindow
47 {
48     Q_OBJECT
49 public:
50     explicit StationListView(StationListModel *model, QWidget *parent = 0);
51     ~StationListView();
52
53    void setSortingMode(StationListProxyModel::SortingMode mode);
54    StationListProxyModel::SortingMode sortingMode(void);
55
56 signals:
57     void stationSelected(const QString &);
58     void aboutTriggered(void);
59     void settingsChangeRequested(void);
60     void sortingModeChanged(StationListProxyModel::SortingMode mode);
61
62 public slots:
63     void updatePosition(const QGeoPositionInfo &update);
64
65 private slots:
66     void showStation(const QModelIndex &index);
67     void handleFilterChanges(const QString &filter);
68     void handleSortingChange(QAction *action);
69
70     void handlefilterClearClick();
71
72     private:
73     Ui::StationListView *ui;
74     QActionGroup *viewSelectionGroup;
75     StationListModel *stationListModel;
76     StationListProxyModel *filterModel;
77     KeyPressForwarder *keyPressForwarder;
78     QGeoPositionInfoSource *positionInfoSource;
79     StationListProxyModel::SortingMode m_sortingMode;
80 };
81
82 #endif // STATIONLISTVIEW_H