source: SMSSender/frontend/business/settings_base.h @ 316:16f8e7f93ca4

separation-frontend-backend
Last change on this file since 316:16f8e7f93ca4 was 316:16f8e7f93ca4, checked in by Sämy Zehnder <saemy.zehnder@…>, 8 years ago
  • Adds the copyright header to each file and updates the development period.
File size: 2.8 KB
Line 
1/*
2 smssender - A frontend for fast and easy SMS sending over different gateways.
3 Copyright (C) 2007-2014, gorrión. See http://smssender.gorrion.ch
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18#ifndef SETTINGS_BASE_H_
19#define SETTINGS_BASE_H_
20
21#include <QDir>
22#include <QNetworkProxy>
23
24#include "common/persistence/imainstorage.h"
25#include "frontend/business/suffixmanager.h"
26
27class BaseSettings : public QObject {
28    Q_OBJECT
29
30public:
31    enum Setting {
32        Locale = 0,
33
34        CheckForUpdates = 1,
35        AddSuffix = 2,
36        SMSSuffix = 3,
37        ActiveAccountId = 4,
38        ShowSentConfirmation = 5,
39
40        ProxyEnabled = 6,
41        ProxyType = 7,
42        ProxyHost = 8,
43        ProxyPort = 9,
44        ProxyAuthEnabled = 10,
45        ProxyUsername = 11,
46        ProxyPassword = 12,
47
48        LastSetting = ProxyPassword
49    };
50
51public:
52    explicit BaseSettings(::Persistence::IMainStorage *storage);
53
54public:
55    const QDir     getLocalePath() const;
56    QLocale        getLocale();
57    QList<QLocale> getLocales();
58
59    bool    getCheckForUpdates();
60    bool    getAddSuffix();
61    QString getActiveAccountId();
62    bool    getShowSentConfirmation();
63
64    bool    isProxyEnabled();
65    QNetworkProxy::ProxyType getProxyType();
66    QString getProxyHost();
67    int     getProxyPort();
68    bool    isProxyAuthEnabled();
69    QString getProxyUsername();
70    QString getProxyPassword();
71
72    QString getUpdateUrl();
73
74    QString getSMSSuffix();
75
76
77    void setLocale(const QLocale& locale);
78
79    void setCheckForUpdates(bool checkForUpdates);
80    void setAddSuffix(bool addSuffix);
81    void setActiveAccountId(const QString& accountId);
82    void setShowSentConfirmation(bool showSentConfirmation);
83
84    void setProxyEnabled(bool enabled);
85    void setProxyType(QNetworkProxy::ProxyType type);
86    void setProxyHost(const QString& host);
87    void setProxyPort(int port);
88    void setProxyAuthEnabled(bool enabled);
89    void setProxyUsername(const QString& username);
90    void setProxyPassword(const QString& password);
91
92    void setSMSSuffix(const QString& smsSuffix);
93
94signals:
95    void settingChanged(int setting);
96
97protected:
98    ::Persistence::IMainStorage * const m_storage;
99
100private:
101    const QString ENCRYPT_PWD;
102};
103
104#endif /* SETTINGS_BASE_H_ */
Note: See TracBrowser for help on using the repository browser.