Incidenceeditor

incidenceeditor.cpp
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#include "incidenceeditor-ng.h"
9
10#include "incidenceeditor_debug.h"
11
12using namespace IncidenceEditorNG;
13
15 : QObject(parent)
16{
17}
18
19IncidenceEditor::~IncidenceEditor() = default;
20
22{
23 if (!mLoadedIncidence) {
24 qCDebug(INCIDENCEEDITOR_LOG) << "checkDirtyStatus called on an invalid incidence";
25 return;
26 }
27
28 if (mLoadingIncidence) {
29 // Still loading the incidence, ignore changes to widgets.
30 return;
31 }
32 const bool dirty = isDirty();
33 if (mWasDirty != dirty) {
34 mWasDirty = dirty;
36 }
37}
38
40{
41 mLastErrorString.clear();
42 return true;
43}
44
46{
47 return mLastErrorString;
48}
49
53
55{
56 if (mLoadedIncidence) {
57 return mLoadedIncidence->type();
58 } else {
60 }
61}
62
64{
65 // implement this in derived classes.
66}
67
69{
70 Q_UNUSED(item)
71}
72
74{
75 Q_UNUSED(item)
76}
77
78#include "moc_incidenceeditor-ng.cpp"
IncidenceEditor(QObject *parent=nullptr)
Only subclasses can instantiate IncidenceEditors.
QString lastErrorString() const
Returns the last error, which is set in isValid() on error, and cleared on success.
virtual bool isValid() const
Returns whether or not the content of this editor is valid.
void checkDirtyStatus()
Checks if the dirty status has changed until last check and emits the dirtyStatusChanged signal if ne...
KCalendarCore::IncidenceBase::IncidenceType type() const
Returns the type of the Incidence that is currently loaded.
virtual void printDebugInfo() const
Re-implement this and print important member values and widget enabled/disabled states that could hav...
virtual bool isDirty() const =0
Returns whether or not the current values in the editor differ from the initial values.
void dirtyStatusChanged(bool isDirty)
Signals whether the dirty status of this editor has changed.
virtual void load(const KCalendarCore::Incidence::Ptr &incidence)=0
Load the values of.
virtual void focusInvalidField()
Sets focus on the invalid field.
virtual void save(const KCalendarCore::Incidence::Ptr &incidence)=0
Store the current values of the editor into.
Q_EMITQ_EMIT
T qobject_cast(QObject *object)
void clear()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:37 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.