File indexing completed on 2024-04-14 05:43:32

0001 /*
0002     SPDX-FileCopyrightText: 2002 Jean-Baptiste Mardelle <bj@altern.org>
0003     SPDX-FileCopyrightText: 2007, 2008, 2013 Rolf Eike Beer <kde@opensource.sf-tec.de>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef GROUPEDIT_H
0008 #define GROUPEDIT_H
0009 
0010 #include <QList>
0011 #include "ui_groupedit.h"
0012 
0013 class GroupEditProxyModel;
0014 class KGpgNode;
0015 class KGpgItemModel;
0016 class QSortFilterProxyModel;
0017 
0018 /**
0019  * @brief shows a widget that let's you change the keys that are part of a key group
0020  */
0021 class groupEdit : public QWidget, public Ui::groupEdit
0022 {
0023 private:
0024     GroupEditProxyModel *m_in;
0025     GroupEditProxyModel *m_out;
0026     QSortFilterProxyModel * const m_outFilter;
0027 
0028 public:
0029     QList<KGpgNode *> * const members;  ///< the list of keys that are members of the group
0030 
0031     /**
0032      * @brief constructor
0033      * @param parent parent widget
0034      * @param ids the members of the group
0035      * @param md model to use
0036      */
0037     explicit groupEdit(QWidget *parent, QList<KGpgNode *> *ids, KGpgItemModel *md);
0038     /**
0039      * @brief destructor
0040      */
0041     ~groupEdit() override;
0042 
0043 private:
0044     /**
0045      * @brief called when the add button is clicked
0046      */
0047     void groupAdd();
0048     /**
0049      * @brief called when the remove button is clicked
0050      */
0051     void groupRemove();
0052     /**
0053      * @brief called when an available key is double clicked
0054      */
0055     void groupAdd(const QModelIndex &index);
0056     /**
0057      * @brief clicked when a group member key is double clicked
0058      */
0059     void groupRemove(const QModelIndex &index);
0060 };
0061 
0062 #endif