CalendarSupport

collectionselection.h
1/*
2 SPDX-FileCopyrightText: 2009 KDAB
3 SPDX-FileContributor: Frank Osterfeld <frank@kdab.net>
4
5 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
6*/
7
8#pragma once
9
10#include "calendarsupport_export.h"
11
12#include <QObject>
13
14#include <Akonadi/Collection>
15
16#include <memory>
17
18class QItemSelection;
20
21namespace CalendarSupport
22{
23class CollectionSelectionPrivate;
24
25class CALENDARSUPPORT_EXPORT CollectionSelection : public QObject
26{
27 Q_OBJECT
28public:
29 explicit CollectionSelection(QItemSelectionModel *selectionModel, QObject *parent = nullptr);
30 ~CollectionSelection() override;
31
32 QItemSelectionModel *model() const;
33 [[nodiscard]] Akonadi::Collection::List selectedCollections() const;
34 [[nodiscard]] QList<Akonadi::Collection::Id> selectedCollectionIds() const;
35 [[nodiscard]] bool contains(const Akonadi::Collection &c) const;
36 [[nodiscard]] bool contains(Akonadi::Collection::Id id) const;
37
38 [[nodiscard]] bool hasSelection() const;
39
40Q_SIGNALS:
41 void selectionChanged(const Akonadi::Collection::List &selected, const Akonadi::Collection::List &deselected);
42 void collectionDeselected(const Akonadi::Collection &);
43 void collectionSelected(const Akonadi::Collection &);
44
45private:
46 CALENDARSUPPORT_NO_EXPORT void slotSelectionChanged(const QItemSelection &, const QItemSelection &);
47
48 std::unique_ptr<CollectionSelectionPrivate> const d;
49};
50}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.