File indexing completed on 2024-04-28 05:36:12
0001 /* This file is part of the KDE project 0002 SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleixpol@kde.org> 0003 SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef QUICKAUTHDIALOG_H 0009 #define QUICKAUTHDIALOG_H 0010 0011 #include <QObject> 0012 #include <QWindow> 0013 0014 #include <PolkitQt1/Details> 0015 #include <PolkitQt1/Identity> 0016 0017 class QuickAuthDialog : public QObject 0018 { 0019 Q_OBJECT 0020 public: 0021 QuickAuthDialog(const QString &actionId, const QString &message, const PolkitQt1::Details &details, const PolkitQt1::Identity::List &identities); 0022 0023 QWindow *windowHandle() const 0024 { 0025 return m_theDialog; 0026 } 0027 PolkitQt1::Identity adminUserSelected() const; 0028 0029 QString actionId() const; 0030 QString password() const; 0031 void showError(const QString &message); 0032 void showInfo(const QString &message); 0033 void authenticationFailure(); 0034 void show(); 0035 void hide(); 0036 0037 Q_SIGNALS: 0038 void okClicked(); 0039 void rejected(); 0040 0041 private: 0042 QWindow *m_theDialog = nullptr; 0043 QString m_actionId; 0044 }; 0045 0046 #endif