File indexing completed on 2024-07-14 03:53:54

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2009 Michael Leupold <lemma@confuego.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef KPASSWDSERVERLOOP_P_H
0009 #define KPASSWDSERVERLOOP_P_H
0010 
0011 #include <QEventLoop>
0012 #include <kio/authinfo.h>
0013 
0014 // Wait for the result of an asynchronous D-Bus request to KPasswdServer.
0015 // Objects of this class are one-way ie. as soon as they have received
0016 // a result you can't call waitForResult() again.
0017 class KPasswdServerLoop : public QEventLoop
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     KPasswdServerLoop();
0023     ~KPasswdServerLoop() override;
0024     bool waitForResult(qlonglong requestId);
0025 
0026     qlonglong seqNr() const;
0027     const KIO::AuthInfo &authInfo() const;
0028 
0029 public Q_SLOTS:
0030     void slotQueryResult(qlonglong requestId, qlonglong seqNr, const KIO::AuthInfo &authInfo);
0031 
0032 private Q_SLOTS:
0033     void kdedServiceUnregistered();
0034 
0035 private:
0036     qlonglong m_requestId;
0037     qlonglong m_seqNr;
0038     KIO::AuthInfo m_authInfo;
0039 };
0040 
0041 #endif