DtkNetworkManager
NetworkManager DBus interface binding for Qt
全部  文件 函数 变量 枚举 
dsecretagent.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DSECRETAGENT_H
6#define DSECRETAGENT_H
7
9#include <DExpected>
10#include <QFlags>
11#include <QDBusMessage>
12#include <QDBusContext>
13#include <QDBusObjectPath>
14
15DNETWORKMANAGER_BEGIN_NAMESPACE
16
17class DSecretAgentPrivate;
18
19using DCORE_NAMESPACE::DExpected;
20
21class DSecretAgent : public QObject, protected QDBusContext
22{
23 Q_OBJECT
24public:
25 Q_DECLARE_FLAGS(GetSecretFlags, NMSecretAgentGetSecretsFlags);
26 Q_DECLARE_FLAGS(Capabilities, NMSecretAgentCapabilities)
27
28 explicit DSecretAgent(const QString &id, QObject *parent = nullptr);
29 explicit DSecretAgent(const QString &id, Capabilities caps, QObject *parent = nullptr);
30 ~DSecretAgent() override;
31
32public Q_SLOTS:
33 virtual DExpected<SettingDesc> secrets(const SettingDesc &conn,
34 const quint64 connId,
35 const QString &settingName,
36 const QList<QString> &hints,
37 const GetSecretFlags &flags) = 0;
38 virtual DExpected<void> cancelSecrets(const quint64 connId, const QString &settingName) = 0;
39 virtual DExpected<void> saveSecret(const SettingDesc &connSettigns, const quint64 connId) = 0;
40 virtual DExpected<void> deleteSecret(const SettingDesc &connSettigns, const quint64 connId) = 0;
41
42private:
43 Q_DECLARE_PRIVATE(DSecretAgent)
44 Q_PRIVATE_SLOT(d_func(), void registerAgent())
45 Q_PRIVATE_SLOT(d_func(), void registerAgent(const DSecretAgent::Capabilities capabilities))
46 Q_PRIVATE_SLOT(d_func(), void dbusInterfacesAdded(const QDBusObjectPath &path, const QVariantMap &interfaces))
47 QScopedPointer<DSecretAgentPrivate> d_ptr;
48};
49
50Q_DECLARE_OPERATORS_FOR_FLAGS(DSecretAgent::GetSecretFlags)
51Q_DECLARE_OPERATORS_FOR_FLAGS(DSecretAgent::Capabilities)
52
53DNETWORKMANAGER_END_NAMESPACE
54
55#endif
对于秘密代理的方法的封装
Definition: dsecretagent.h:22
virtual DExpected< void > cancelSecrets(const quint64 connId, const QString &settingName)=0
取消获取秘密
virtual DExpected< SettingDesc > secrets(const SettingDesc &conn, const quint64 connId, const QString &settingName, const QList< QString > &hints, const GetSecretFlags &flags)=0
获取对应连接的秘密
virtual DExpected< void > saveSecret(const SettingDesc &connSettigns, const quint64 connId)=0
保存秘密
virtual DExpected< void > deleteSecret(const SettingDesc &connSettigns, const quint64 connId)=0
删除秘密
NMSecretAgentGetSecretsFlags
这个值修改会GetSecrets请求的行为
Definition: dnetworkmanagertypes.h:235
NMSecretAgentCapabilities
指示代理的各种能力
Definition: dnetworkmanagertypes.h:233