Pimcommon

aclmanager.h
1/*
2 * SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
3 * SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kdab.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#pragma once
9
10#include "pimcommonakonadi_private_export.h"
11
12#include <Akonadi/Collection>
13
14#include <QObject>
15
17class QAction;
19
20namespace PimCommon
21{
22class PIMCOMMONAKONADI_TESTS_EXPORT AclManager : public QObject
23{
24 Q_OBJECT
25
26 Q_PROPERTY(Akonadi::Collection collection READ collection WRITE setCollection NOTIFY collectionChanged)
27 Q_PROPERTY(QAbstractItemModel *model READ model)
28 Q_PROPERTY(QItemSelectionModel *selectionModel READ selectionModel)
29 Q_PROPERTY(QAction *addAction READ addAction)
30 Q_PROPERTY(QAction *editAction READ editAction)
31 Q_PROPERTY(QAction *deleteAction READ deleteAction)
32
33public:
34 /**
35 * Creates a new ACL manager.
36 *
37 * @param parent The parent object.
38 */
39 explicit AclManager(QObject *parent = nullptr);
40
41 /**
42 * Destroys the ACL manager.
43 */
44 ~AclManager() override;
45
46 /**
47 * Sets the @p collection whose ACL will be managed.
48 */
49 void setCollection(const Akonadi::Collection &collection);
50
51 /**
52 * Sets the @p collection whose ACL are managed.
53 */
54 [[nodiscard]] Akonadi::Collection collection() const;
55
56 /**
57 * Returns the model that represents the ACL of the managed collection.
58 */
59 [[nodiscard]] QAbstractItemModel *model() const;
60
61 /**
62 * Returns the selection model that is used by the manager to select the
63 * ACL entry to work on.
64 */
65 [[nodiscard]] QItemSelectionModel *selectionModel() const;
66
67 /**
68 * Returns the action that handles adding new ACL entries.
69 */
70 [[nodiscard]] QAction *addAction() const;
71
72 /**
73 * Returns the action that handles editing the currently selected ACL entry.
74 */
75 [[nodiscard]] QAction *editAction() const;
76
77 /**
78 * Returns the action that handles deleting the currently selected ACL entry.
79 */
80 [[nodiscard]] QAction *deleteAction() const;
81
82 void setChanged(bool b);
83public Q_SLOTS:
84 /**
85 * Saves the changes of the ACL back to the collection.
86 */
87 void save(bool recursive);
88
89Q_SIGNALS:
90 /**
91 * This signal is emitted whenever the collection whose ACL will
92 * be managed has changed.
93 */
94 void collectionChanged(const Akonadi::Collection &collection);
95
96 void collectionCanBeAdministrated(bool canAdmin);
97
98private:
99 //@cond PRIVATE
100 class AclManagerPrivate;
101 std::unique_ptr<AclManagerPrivate> const d;
102 //@endcond
103};
104}
const QList< QKeySequence > & save()
folderdialogacltab.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.