File indexing completed on 2024-09-01 05:15:39
0001 // SPDX-FileCopyrightText: 2021-2023 Devin Lin <espidev@gmail.com> 0002 // SPDX-License-Identifier: GPL-2.0-or-later 0003 0004 #pragma once 0005 0006 #include <QList> 0007 #include <QString> 0008 0009 #include <NetworkManagerQt/CdmaSetting> 0010 #include <NetworkManagerQt/ConnectionSettings> 0011 #include <NetworkManagerQt/GsmSetting> 0012 #include <NetworkManagerQt/Manager> 0013 #include <NetworkManagerQt/ModemDevice> 0014 #include <NetworkManagerQt/Settings> 0015 0016 #include <ModemManagerQt/GenericTypes> 0017 #include <ModemManagerQt/Manager> 0018 #include <ModemManagerQt/Modem3Gpp> 0019 #include <ModemManagerQt/ModemDevice> 0020 0021 class ProfileSettings : public QObject 0022 { 0023 Q_OBJECT 0024 Q_PROPERTY(QString name READ name NOTIFY nameChanged) 0025 Q_PROPERTY(QString apn READ apn WRITE setApn NOTIFY apnChanged) 0026 Q_PROPERTY(QString user READ user WRITE setUser NOTIFY userChanged) 0027 Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged) 0028 Q_PROPERTY(QString networkType READ networkType WRITE setNetworkType NOTIFY networkTypeChanged) 0029 Q_PROPERTY(QString connectionUni READ connectionUni NOTIFY connectionUniChanged) 0030 0031 public: 0032 ProfileSettings(QObject *parent = nullptr) 0033 : QObject{parent} 0034 { 0035 } 0036 ProfileSettings(QObject *parent, 0037 const QString &name, 0038 const QString &apn, 0039 const QString &user, 0040 const QString &password, 0041 NetworkManager::GsmSetting::NetworkType networkType, 0042 const QString &connectionUni); 0043 ProfileSettings(QObject *parent, NetworkManager::Setting::Ptr settings, NetworkManager::Connection::Ptr connection); 0044 0045 QString name() const; 0046 QString apn() const; 0047 void setApn(const QString &apn); 0048 QString user() const; 0049 void setUser(const QString &user); 0050 QString password() const; 0051 void setPassword(const QString &password); 0052 QString networkType() const; 0053 void setNetworkType(const QString &ipType); 0054 QString connectionUni() const; 0055 0056 // utilities 0057 static QString networkTypeStr(NetworkManager::GsmSetting::NetworkType networkType); 0058 static NetworkManager::GsmSetting::NetworkType networkTypeFlag(const QString &networkType); 0059 0060 Q_SIGNALS: 0061 void nameChanged(); 0062 void apnChanged(); 0063 void userChanged(); 0064 void passwordChanged(); 0065 void networkTypeChanged(); 0066 void connectionUniChanged(); 0067 0068 private: 0069 QString m_name; 0070 QString m_apn; 0071 QString m_user; 0072 QString m_password; 0073 QString m_networkType; 0074 QString m_connectionUni; 0075 };