X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=application%2Fsettings.h;h=5b9fa5bdc91e660a124066fcf26855572586a745;hb=40e5a96fc8f277b74771d0bcc3173f4a7d68ffc3;hp=a9f0ea4663ef8687900b02640cc0d27130a54ff8;hpb=0931b8dc0abd733794d9fb6b14352f7504bfeda1;p=quandoparte diff --git a/application/settings.h b/application/settings.h index a9f0ea4..5b9fa5b 100644 --- a/application/settings.h +++ b/application/settings.h @@ -1,18 +1,79 @@ #ifndef SETTINGS_H #define SETTINGS_H +/* + +Copyright (C) 2011 Luciano Montanaro + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. + +*/ + #include +#include +#include class Settings : public QObject { Q_OBJECT + Q_PROPERTY(QString queryBaseUrl + READ queryBaseUrl WRITE setQueryBaseUrl + NOTIFY queryBaseUrlChanged) + Q_PROPERTY(QStringList recentStations + READ recentStations WRITE setRecentStations + NOTIFY recentStationsChanged) + Q_PROPERTY(int checkingInterval + READ checkingInterval WRITE setCheckingInterval + NOTIFY checkingIntervalChanged) + Q_PROPERTY(bool stationViewPreferred + READ stationViewPreferred WRITE setStationViewPreferred + NOTIFY stationViewPreferredChanged) + public: explicit Settings(QObject *parent = 0); + ~Settings(); + + Q_INVOKABLE void load(void); + Q_INVOKABLE void save(void); + + QString queryBaseUrl(); + void setQueryBaseUrl(const QString &url); + + QStringList recentStations(); + void setRecentStations(const QStringList &stations); + + int checkingInterval(); + void setCheckingInterval(int); + + bool stationViewPreferred(); + void setStationViewPreferred(bool); signals: + void queryBaseUrlChanged(const QString &); + void recentStationsChanged(const QStringList &); + void checkingIntervalChanged(int); + void stationViewPreferredChanged(bool); public slots: +private: + QString m_queryBaseUrl; + QStringList m_recentStations; + int m_checkingInterval; + bool m_stationViewPreferred; }; #endif // SETTINGS_H