Incidenceeditor

incidencealarm.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
12namespace Ui
13{
14class EventOrTodoDesktop;
15}
16
17namespace IncidenceEditorNG
18{
19class IncidenceDateTime;
20
21class IncidenceAlarm : public IncidenceEditor
22{
24public:
25 using IncidenceEditorNG::IncidenceEditor::load; // So we don't trigger -Woverloaded-virtual
26 using IncidenceEditorNG::IncidenceEditor::save; // So we don't trigger -Woverloaded-virtual
27 IncidenceAlarm(IncidenceDateTime *dateTime, Ui::EventOrTodoDesktop *ui);
28
29 void load(const KCalendarCore::Incidence::Ptr &incidence) override;
30 void save(const KCalendarCore::Incidence::Ptr &incidence) override;
31 [[nodiscard]] bool isDirty() const override;
32
34 void alarmCountChanged(int newCount);
35
36private:
37 void editCurrentAlarm();
38 void handleDateTimeToggle();
39 void newAlarm();
40 void newAlarmFromPreset();
41 void removeCurrentAlarm();
42 void toggleCurrentAlarm();
43 void updateAlarmList();
44 void updateButtons();
45 [[nodiscard]] QString stringForAlarm(const KCalendarCore::Alarm::Ptr &alarm);
46
47 Ui::EventOrTodoDesktop *const mUi;
48
50 IncidenceDateTime *const mDateTime;
51 int mEnabledAlarmCount = 0;
52 bool mIsTodo = false;
53};
54}
virtual void load(const KCalendarCore::Incidence::Ptr &incidence)=0
Load the values of.
QSharedPointer< IncidenceT > incidence() const
Convenience method to get a pointer for a specific const Incidence Type.
virtual void save(const KCalendarCore::Incidence::Ptr &incidence)=0
Store the current values of the editor into.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.