File indexing completed on 2024-07-14 09:00:22

0001 /*
0002     SPDX-FileCopyrightText: 2011 Ilia Kats <ilia-kats@gmx.net>
0003     SPDX-FileCopyrightText: 2013 Jan Grulich <jgrulich@redhat.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef PLASMA_NM_ADVANCED_PERMISSIONS_WIDGET_H
0009 #define PLASMA_NM_ADVANCED_PERMISSIONS_WIDGET_H
0010 
0011 #include <QDialog>
0012 #include <QHash>
0013 
0014 class QTreeWidgetItem;
0015 class AdvancedPermissionsWidgetPrivate;
0016 class KUser;
0017 
0018 class AdvancedPermissionsWidget : public QDialog
0019 {
0020     Q_OBJECT
0021     Q_DECLARE_PRIVATE(AdvancedPermissionsWidget)
0022 public:
0023     explicit AdvancedPermissionsWidget(QWidget *parent = nullptr);
0024     AdvancedPermissionsWidget(const QHash<QString, QString> &, QWidget *parent = nullptr);
0025     ~AdvancedPermissionsWidget() override;
0026 
0027     QHash<QString, QString> currentUsers() const;
0028 
0029 protected:
0030     AdvancedPermissionsWidgetPrivate *const d_ptr;
0031 
0032 private:
0033     void leftArrowClicked();
0034     void rightArrowClicked();
0035     enum Columns { FullName = 0, LoginName = 1 };
0036     void setupCommon();
0037     QTreeWidgetItem *constructItem(const KUser &user, const QString &itemData = QString());
0038 };
0039 
0040 #endif // PLASMA_NM_ADVANCED_PERMISSIONS_WIDGET_H