Incidenceeditor

incidencecategories.h
1/*
2 SPDX-FileCopyrightText: 2010 Bertjan Broeksema <broeksema@kde.org>
3 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#pragma once
9
10#include "incidenceeditor-ng.h"
11
12namespace Ui
13{
14class EventOrTodoDesktop;
15}
16
17namespace IncidenceEditorNG
18{
19class IncidenceCategories : public IncidenceEditor
20{
22public:
23 explicit IncidenceCategories(Ui::EventOrTodoDesktop *ui);
24
25 void load(const KCalendarCore::Incidence::Ptr &incidence) override;
26 void load(const Akonadi::Item &item) override;
27 void save(const KCalendarCore::Incidence::Ptr &incidence) override;
28 void save(Akonadi::Item &item) override;
29
30 /**
31 * Returns the list of currently selected categories.
32 */
33 [[nodiscard]] QStringList categories() const;
34
35 [[nodiscard]] bool isDirty() const override;
36 void printDebugInfo() const override;
37
38private:
39 void createMissingCategories();
40
41 void onSelectionChanged(const Akonadi::Tag::List &);
42 void onMissingTagCreated(KJob *);
43
44 Ui::EventOrTodoDesktop *const mUi;
45
46 /**
47 * List of categories for which no tag might exist.
48 *
49 * For each category of the edited incidence, we want to make sure that there exists a
50 * corresponding tag in Akonadi. For missing categories, a \a TagCreateJob is issued.
51 * Eventually, there should be no missing categories left. In case tag creation fails for some
52 * categories, this list still holds these categories so they don't get lost
53 */
54 QStringList mMissingCategories;
55 bool mDirty = false;
56};
57}
QSharedPointer< IncidenceT > incidence() const
Convenience method to get a pointer for a specific const Incidence Type.
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:15 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.