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"
29 #include <QStringList>
31 class Settings : public QObject
34 Q_PROPERTY(QString queryBaseUrl
35 READ queryBaseUrl WRITE setQueryBaseUrl
36 NOTIFY queryBaseUrlChanged)
37 Q_PROPERTY(QStringList recentStations
38 READ recentStations WRITE setRecentStations
39 NOTIFY recentStationsChanged)
40 Q_PROPERTY(int checkingInterval
41 READ checkingInterval WRITE setCheckingInterval
42 NOTIFY checkingIntervalChanged)
43 Q_PROPERTY(bool stationViewPreferred
44 READ stationViewPreferred WRITE setStationViewPreferred
45 NOTIFY stationViewPreferredChanged)
46 Q_PROPERTY(bool showArrivalsPreferred
47 READ showArrivalsPreferred WRITE setShowArrivalsPreferred
48 NOTIFY showArrivalsPreferredChanged)
50 Q_PROPERTY(StationListProxyModel::SortingMode stationListSortingMode
51 READ stationListSortingMode WRITE setStationListSortingMode
52 NOTIFY stationListSortingModeChanged)
54 explicit Settings(QObject *parent = 0);
56 Q_INVOKABLE static Settings *instance();
58 Q_INVOKABLE void save(void);
60 QString queryBaseUrl();
61 void setQueryBaseUrl(const QString &url);
63 QStringList recentStations();
64 void setRecentStations(const QStringList &stations);
66 int checkingInterval();
67 void setCheckingInterval(int);
69 bool stationViewPreferred();
70 void setStationViewPreferred(bool);
72 bool showArrivalsPreferred();
73 void setShowArrivalsPreferred(bool);
75 StationListProxyModel::SortingMode stationListSortingMode();
76 void setStationListSortingMode(StationListProxyModel::SortingMode mode);
79 void queryBaseUrlChanged();
80 void recentStationsChanged();
81 void checkingIntervalChanged();
82 void stationViewPreferredChanged();
83 void showArrivalsPreferredChanged();
84 void stationListSortingModeChanged();