Akonadi Calendar

blockalarmsattribute.h
1 /*
2  SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
3  SPDX-FileContributor: Tobias Koenig <[email protected]>
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 
17 namespace Akonadi
18 {
19 class 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 <[email protected]>
28  * @see Akonadi::Attribute
29  * @since 4.11
30  */
31 class AKONADI_CALENDAR_EXPORT BlockAlarmsAttribute : public Akonadi::Attribute
32 {
33 public:
34  /**
35  * Creates a new block alarms attribute.
36  */
38 
39  /**
40  * Destroys the block alarms attribute.
41  */
42  ~BlockAlarmsAttribute() override;
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  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  bool isEverythingBlocked() const;
76 
77  QByteArray type() const override;
78  BlockAlarmsAttribute *clone() const override;
79  QByteArray serialized() const override;
80  void deserialize(const QByteArray &data) override;
81 
82 private:
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.
FreeBusyManager::Singleton.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Wed Sep 28 2022 03:52:06 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.