11#ifndef KPASSWDSERVER_H
12#define KPASSWDSERVER_H
14#include <QDBusContext>
15#include <QDBusMessage>
21#include <kio/authinfo.h>
36 explicit KPasswdServer(
QObject *
parent,
const QList<QVariant> & = QList<QVariant>());
37 ~KPasswdServer()
override;
40 void setWalletDisabled(
bool d)
46 qlonglong checkAuthInfoAsync(KIO::AuthInfo, qlonglong, qlonglong);
47 qlonglong queryAuthInfoAsync(
const KIO::AuthInfo &,
const QString &, qlonglong, qlonglong, qlonglong);
48 void addAuthInfo(
const KIO::AuthInfo &, qlonglong);
49 void removeAuthInfo(
const QString &host,
const QString &protocol,
const QString &user);
52 QByteArray checkAuthInfo(
const QByteArray &, qlonglong, qlonglong);
53 QByteArray queryAuthInfo(
const QByteArray &,
const QString &, qlonglong, qlonglong, qlonglong);
54 void addAuthInfo(
const QByteArray &, qlonglong);
56 void processRequest();
58 void removeAuthForWindowId(qlonglong windowId);
61 void checkAuthInfoAsyncResult(qlonglong requestId, qlonglong seqNr,
const KIO::AuthInfo &);
62 void queryAuthInfoAsyncResult(qlonglong requestId, qlonglong seqNr,
const KIO::AuthInfo &);
65 void passwordDialogDone(
int result, KPasswordDialog *
sender);
66 void retryDialogDone(
int result, KMessageDialog *
sender);
67 void windowRemoved(WId);
70 struct AuthInfoContainer {
83 QList<qlonglong> windowList;
84 qulonglong expireTime = expNever;
87 bool isCanceled =
false;
90 bool operator()(
const AuthInfoContainer &n1,
const AuthInfoContainer &n2)
const;
97 QDBusMessage transaction;
106 QString createCacheKey(
const KIO::AuthInfo &info);
107 const AuthInfoContainer *findAuthInfoItem(
const QString &key,
const KIO::AuthInfo &info);
108 void removeAuthInfoItem(
const QString &key,
const KIO::AuthInfo &info);
109 void addAuthInfoItem(
const QString &key,
const KIO::AuthInfo &info, qlonglong windowId, qlonglong seqNr,
bool canceled);
110 void copyAuthInfo(
const AuthInfoContainer *, KIO::AuthInfo &);
111 void updateAuthExpire(
const QString &key,
const AuthInfoContainer *, qlonglong windowId,
bool keep);
114 bool openWallet(qlonglong windowId);
117 bool hasPendingQuery(
const QString &key,
const KIO::AuthInfo &info);
118 void sendResponse(Request *request);
119 void showPasswordDialog(Request *request);
120 void updateCachedRequestKey(QList<Request *> &,
const QString &oldKey,
const QString &newKey);
122 using AuthInfoContainerList = QList<AuthInfoContainer>;
123 QHash<QString, AuthInfoContainerList *> m_authDict;
125 QList<Request *> m_authPending;
126 QList<Request *> m_authWait;
127 QHash<int, QStringList> mWindowIdList;
128 QHash<QObject *, Request *> m_authInProgress;
129 QHash<QObject *, Request *> m_authRetryInProgress;
130 QStringList m_authPrompted;
131 KWallet::Wallet *m_wallet;
132 bool m_walletDisabled;
QObject * parent() const const
QObject * sender() const const