bdd9c672768419b8e7686a7225a9d1ec61c5bd1b
[quandoparte] / application / app.h
1 #ifndef APPLICATION_H
2 #define APPLICATION_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 <QApplication>
26 #include <QStringList>
27
28 #include <QGeoPositionInfoSource>
29
30 class QNetworkAccessManager;
31 class QNetworkReply;
32
33 class StationView;
34 class StationListView;
35 class StationListModel;
36
37 QTM_USE_NAMESPACE
38
39 class App : public QObject
40 {
41     Q_OBJECT
42 public:
43     explicit App(QObject *parent = 0);
44     ~App();
45
46     static QString dataDir(void);
47
48 signals:
49
50 public slots:
51     void queryStation(const QString &station);
52     void downloadFinished(void);
53     void showAboutDialog(void);
54     void showSettingsDialog(void);
55     void showStationSelectView(void);
56     void setShowingArrivals(bool);
57 public:
58     void saveSettings(void);
59     void readSettings(void);
60 private:
61     QNetworkAccessManager *accessManager;
62     QNetworkReply *stationQueryReply;
63     QGeoPositionInfoSource *positionInfoSource;
64     StationView *stationView;
65     StationListModel *stationListModel;
66     StationListView *stationListView;
67     QString queryBaseUrl;
68     QString stationName;
69     QStringList recentStations;
70     bool showingArrivals;
71     int checkingInterval;
72 };
73
74 #endif // APPLICATION_H