| 1 | /* |
| 2 | This file is part of the KDE libraries |
| 3 | SPDX-FileCopyrightText: 2009 Michael Leupold <lemma@confuego.org> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 6 | */ |
| 7 | |
| 8 | #ifndef KPASSWDSERVERLOOP_P_H |
| 9 | #define KPASSWDSERVERLOOP_P_H |
| 10 | |
| 11 | #include <QEventLoop> |
| 12 | #include <kio/authinfo.h> |
| 13 | |
| 14 | // Wait for the result of an asynchronous D-Bus request to KPasswdServer. |
| 15 | // Objects of this class are one-way ie. as soon as they have received |
| 16 | // a result you can't call waitForResult() again. |
| 17 | class KPasswdServerLoop : public QEventLoop |
| 18 | { |
| 19 | Q_OBJECT |
| 20 | |
| 21 | public: |
| 22 | KPasswdServerLoop(); |
| 23 | ~KPasswdServerLoop() override; |
| 24 | bool waitForResult(qlonglong requestId); |
| 25 | |
| 26 | qlonglong seqNr() const; |
| 27 | const KIO::AuthInfo &authInfo() const; |
| 28 | |
| 29 | public Q_SLOTS: |
| 30 | void slotQueryResult(qlonglong requestId, qlonglong seqNr, const KIO::AuthInfo &authInfo); |
| 31 | |
| 32 | private Q_SLOTS: |
| 33 | void kdedServiceUnregistered(); |
| 34 | |
| 35 | private: |
| 36 | qlonglong m_requestId; |
| 37 | qlonglong m_seqNr; |
| 38 | KIO::AuthInfo m_authInfo; |
| 39 | }; |
| 40 | |
| 41 | #endif |
| 42 | |