DtkNetworkManager
NetworkManager DBus interface binding for Qt
全部  文件 函数 变量 枚举 
dconnectionsetting.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DCONNECTIONSETTING_H
6#define DCONNECTIONSETTING_H
7
9#include <DExpected>
10#include <QUrl>
11
12DNETWORKMANAGER_BEGIN_NAMESPACE
13
14class DConnectionSettingPrivate;
15
16using DCORE_NAMESPACE::DExpected;
17
18class DConnectionSetting : public QObject
19{
20 Q_OBJECT
21public:
22 Q_DECLARE_FLAGS(NMSCFlags, NMSettingsConnectionFlags);
23
24 explicit DConnectionSetting(const quint64 id, QObject *parent = nullptr);
25 ~DConnectionSetting() override;
26
27 Q_PROPERTY(bool unsaved READ unsaved NOTIFY unsavedChanged)
28 Q_PROPERTY(QUrl filename READ filename NOTIFY filenameChanged)
29 Q_PROPERTY(NMSCFlags flags READ flags NOTIFY flagsChanged)
30
31 bool unsaved() const;
32 QUrl filename() const;
33 NMSCFlags flags() const;
34
35public Q_SLOTS:
36 DExpected<void> updateSetting(const SettingDesc &settings) const;
37 DExpected<void> deleteSetting() const;
38 DExpected<SettingDesc> settings() const;
39
40Q_SIGNALS:
41 void unsavedChanged(const bool unsaved);
42 void filenameChanged(const QUrl &filename);
43 void flagsChanged(const NMSCFlags flags);
44 void Removed();
45 void Updated();
46
47private:
48 QScopedPointer<DConnectionSettingPrivate> d_ptr;
49 Q_DECLARE_PRIVATE(DConnectionSetting)
50};
51
52Q_DECLARE_OPERATORS_FOR_FLAGS(DConnectionSetting::NMSCFlags)
53
54DNETWORKMANAGER_END_NAMESPACE
55
56#endif
对于连接配置的封装
Definition: dconnectionsetting.h:19
NMSettingsConnectionFlags
描述当前激活状态的标志
Definition: dnetworkmanagertypes.h:84