File indexing completed on 2024-04-21 04:00:00

0001 /*
0002     SPDX-FileCopyrightText: 2012-2013 Jan Grulich <jgrulich@redhat.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef NETWORKMANAGERQT_ADSL_SETTING_H
0008 #define NETWORKMANAGERQT_ADSL_SETTING_H
0009 
0010 #include "setting.h"
0011 #include <networkmanagerqt/networkmanagerqt_export.h>
0012 
0013 #include <QString>
0014 
0015 namespace NetworkManager
0016 {
0017 class AdslSettingPrivate;
0018 
0019 /**
0020  * Represents adsl setting
0021  */
0022 class NETWORKMANAGERQT_EXPORT AdslSetting : public Setting
0023 {
0024 public:
0025     typedef QSharedPointer<AdslSetting> Ptr;
0026     typedef QList<Ptr> List;
0027     enum Protocol {
0028         UnknownProtocol = 0,
0029         Pppoa,
0030         Pppoe,
0031         Ipoatm,
0032     };
0033     enum Encapsulation {
0034         UnknownEncapsulation = 0,
0035         Vcmux,
0036         Llc,
0037     };
0038 
0039     AdslSetting();
0040     explicit AdslSetting(const Ptr &other);
0041     ~AdslSetting() override;
0042 
0043     QString name() const override;
0044 
0045     void setUsername(const QString &username);
0046     QString username() const;
0047 
0048     void setPassword(const QString &password);
0049     QString password() const;
0050 
0051     void setPasswordFlags(SecretFlags flags);
0052     SecretFlags passwordFlags() const;
0053 
0054     void setProtocol(Protocol protocol);
0055     Protocol protocol() const;
0056 
0057     void setEncapsulation(Encapsulation encapsulation);
0058     Encapsulation encapsulation() const;
0059 
0060     void setVpi(quint32 vpi);
0061     quint32 vpi() const;
0062 
0063     void setVci(quint32 vci);
0064     quint32 vci() const;
0065 
0066     QStringList needSecrets(bool requestNew = false) const override;
0067 
0068     void fromMap(const QVariantMap &setting) override;
0069 
0070     QVariantMap toMap() const override;
0071 
0072 protected:
0073     AdslSettingPrivate *d_ptr;
0074 
0075 private:
0076     Q_DECLARE_PRIVATE(AdslSetting)
0077 };
0078 
0079 NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const AdslSetting &setting);
0080 
0081 }
0082 
0083 #endif // NETWORKMANAGERQT_ADSL_SETTING_H