Incidenceeditor

alarmpresets.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 <KCalendarCore/Alarm>
11
12#include <QStringList>
13
14namespace IncidenceEditorNG
15{
16enum {
17 // Fallback in case config is invalid
18 DEFAULT_REMINDER_OFFSET = 15 // minutes
19};
20
21namespace AlarmPresets
22{
23enum When {
24 BeforeStart,
25 BeforeEnd
26};
27
28/**
29 * Returns the available presets.
30 */
31[[nodiscard]] QStringList availablePresets(When when = BeforeStart);
32
33/**
34 * Returns a recurrence preset for given name. The name <em>must</em> be one
35 * of availablePresets().
36 *
37 * Note: The caller takes ownership over the pointer.
38 */
39[[nodiscard]] KCalendarCore::Alarm::Ptr preset(When when, const QString &name);
40
41/**
42 * Returns an Alarm configured accordingly to the default preset.
43 *
44 * Note: The caller takes ownership over the pointer.
45 */
46[[nodiscard]] KCalendarCore::Alarm::Ptr defaultAlarm(When when);
47
48/**
49 * Returns the index of the preset in availablePresets for the given recurrence,
50 * or -1 if no preset is equal to the given recurrence.
51 */
52[[nodiscard]] int presetIndex(When when, const KCalendarCore::Alarm::Ptr &alarm);
53
54/**
55 Returns the index of the default preset. ( Comes from KCalPrefs ).
56 */
57[[nodiscard]] int defaultPresetIndex();
58}
59}
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.