Incidenceeditor

combinedincidenceeditor.h
1/*
2 SPDX-FileCopyrightText: 2010 Bertjan Broeksema <broeksema@kde.org>
3 SPDX-FileCopyrightText: 2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#pragma once
9
10#include "incidenceeditor-ng.h"
11
12#include <Akonadi/Item>
13#include <KMessageWidget>
14
15namespace IncidenceEditorNG
16{
17/**
18 * The CombinedIncidenceEditor combines optional widgets with zero or more
19 * IncidenceEditors. The CombinedIncidenceEditor keeps track of the dirty state
20 * of the IncidenceEditors that where combined.
21 */
23{
25public:
26 explicit CombinedIncidenceEditor(QWidget *parent = nullptr);
27 /**
28 * Deletes this editor as well as all editors which are combined into this
29 * one.
30 */
31 ~CombinedIncidenceEditor() override;
32
33 void combine(IncidenceEditor *other);
34
35 /**
36 * Returns whether or not the current values in the editor differ from the
37 * initial values or if one of the combined editors is dirty.
38 */
39 [[nodiscard]] bool isDirty() const override;
40 [[nodiscard]] bool isValid() const override;
41
42 /**
43 * Loads all data from @param incidence into the combined editors. Note, if
44 * you reimplement the load method in a subclass, make sure to call this
45 * implementation too.
46 */
47 void load(const KCalendarCore::Incidence::Ptr &incidence) override;
48 void load(const Akonadi::Item &item) override;
49 void save(const KCalendarCore::Incidence::Ptr &incidence) override;
50 void save(Akonadi::Item &item) override;
51
53 void showMessage(const QString &reason, KMessageWidget::MessageType) const;
54
55private:
56 void handleDirtyStatusChange(bool isDirty);
57 QList<IncidenceEditor *> mCombinedEditors;
58 int mDirtyEditorCount = 0;
59};
60}
The CombinedIncidenceEditor combines optional widgets with zero or more IncidenceEditors.
void save(const KCalendarCore::Incidence::Ptr &incidence) override
Store the current values of the editor into.
void load(const KCalendarCore::Incidence::Ptr &incidence) override
Loads all data from.
~CombinedIncidenceEditor() override
Deletes this editor as well as all editors which are combined into this one.
bool isDirty() const override
Returns whether or not the current values in the editor differ from the initial values or if one of t...
CombinedIncidenceEditor(QWidget *parent=nullptr)
public methods
bool isValid() const override
Returns whether or not the content of this editor is valid.
KCal Incidences are complicated objects.
QSharedPointer< IncidenceT > incidence() const
Convenience method to get a pointer for a specific const Incidence Type.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
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.