Akonadi Calendar

blockalarmsattribute.h
1/*
2 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
3 SPDX-FileContributor: Tobias Koenig <tokoe@kdab.com>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#pragma once
9
10#include "akonadi-calendar_export.h"
11#include <KCalendarCore/Alarm>
12
13#include <Akonadi/Attribute>
14
15#include <memory>
16
17namespace Akonadi
18{
19class BlockAlarmsAttributePrivate;
20
21/**
22 * @short An Attribute that marks that alarms from a calendar collection are blocked.
23 *
24 * A calendar collection which has this attribute set won't be evaluated by korgac and
25 * therefore it's alarms won't be used, unless explicitly unblocked in blockAlarmType().
26 *
27 * @author Tobias Koenig <tokoe@kdab.com>
28 * @see Akonadi::Attribute
29 * @since 4.11
30 */
31class AKONADI_CALENDAR_EXPORT BlockAlarmsAttribute : public Akonadi::Attribute
32{
33public:
34 /**
35 * Creates a new block alarms attribute.
36 */
38
39 /**
40 * Destroys the block alarms attribute.
41 */
43
44 /**
45 * Blocks or unblocks given alarm type.
46 *
47 * By default, all alarm types are blocked.
48 *
49 * @since 4.11
50 */
51 void blockAlarmType(KCalendarCore::Alarm::Type type, bool block = true);
52
53 /**
54 * Blocks or unblocks every alarm type.
55 *
56 * By default, all alarm types are blocked.
57 *
58 * @since 5.0
59 */
60 void blockEverything(bool block = true);
61
62 /**
63 * Returns whether given alarm type is blocked or not.
64 *
65 * @since 4.11
66 */
67 [[nodiscard]] bool isAlarmTypeBlocked(KCalendarCore::Alarm::Type type) const;
68
69 /**
70 * Returns whether all alarms are blocked or not.
71 *
72 * @since 5.0
73 */
74
75 [[nodiscard]] bool isEverythingBlocked() const;
76
77 [[nodiscard]] QByteArray type() const override;
78 BlockAlarmsAttribute *clone() const override;
79 [[nodiscard]] QByteArray serialized() const override;
80 void deserialize(const QByteArray &data) override;
81
82private:
83 Q_DISABLE_COPY(BlockAlarmsAttribute)
84 std::unique_ptr<BlockAlarmsAttributePrivate> const d;
85};
86}
An Attribute that marks that alarms from a calendar collection are blocked.
~BlockAlarmsAttribute() override
Destroys the block alarms attribute.
FreeBusyManager::Singleton.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.