1 #ifndef STATIONLISTVIEW_H
2 #define STATIONLISTVIEW_H
6 Copyright (C) 2011 Luciano Montanaro <mikelima@cirulla.net>
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.
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.
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.
25 #include "stationlistproxymodel.h"
27 #include <QMainWindow>
28 #include <QModelIndex>
29 #include <QGeoPositionInfoSource>
32 class StationListView;
36 class QStringListModel;
37 class QSortFilterProxyModel;
38 class KeyPressForwarder;
41 class StationListModel;
42 class StationListProxyModel;
46 class StationListView : public QMainWindow
50 explicit StationListView(StationListModel *model, QWidget *parent = 0);
53 void setSortingMode(StationListProxyModel::SortingMode mode);
54 StationListProxyModel::SortingMode sortingMode(void);
57 void stationSelected(const QString &);
58 void aboutTriggered(void);
59 void settingsChangeRequested(void);
60 void sortingModeChanged(StationListProxyModel::SortingMode mode);
63 void updatePosition(const QGeoPositionInfo &update);
66 void showStation(const QModelIndex &index);
67 void handleFilterChanges(const QString &filter);
68 void handleSortingChange(QAction *action);
70 void handlefilterClearClick();
73 Ui::StationListView *ui;
74 QActionGroup *viewSelectionGroup;
75 StationListModel *stationListModel;
76 StationListProxyModel *filterModel;
77 KeyPressForwarder *keyPressForwarder;
78 QGeoPositionInfoSource *positionInfoSource;
79 StationListProxyModel::SortingMode m_sortingMode;
82 #endif // STATIONLISTVIEW_H