Akonadi Calendar

todopurger.h
1 /*
2  SPDX-FileCopyrightText: 2013 Sérgio Martins <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "akonadi-calendar_export.h"
10 #include "calendarbase.h"
11 
12 #include <QObject>
13 
14 #include <memory>
15 
16 namespace Akonadi
17 {
18 class IncidenceChanger;
19 class TodoPurgerPrivate;
20 
21 /**
22  * @short Class to delete completed to-dos.
23  *
24  * @author Sérgio Martins <[email protected]>
25  * @since 4.12
26  */
27 class AKONADI_CALENDAR_EXPORT TodoPurger : public QObject
28 {
29  Q_OBJECT
30 public:
31  explicit TodoPurger(QObject *parent = nullptr);
32  ~TodoPurger() override;
33 
34  /**
35  * Sets an IncidenceChanger.
36  * If you don't call this method, an internal IncidenceChanger will be created.
37  * Use this if you want more control over the deletion operations, like iTip management, ACL, undo/redo support.
38  */
39  void setIncidenceChager(IncidenceChanger *changer);
40 
41  /**
42  * Sets the calendar to be used for retrieving the to-do hierarchy.
43  * If you don't call this method, an internal FetchJobCalendar will be created.
44  * Use this if you want to reuse an existing calendar, for performance reasons for example.
45  */
46  void setCalendar(const CalendarBase::Ptr &calendar);
47 
48  /**
49  * Deletes completed to-dos. A to-do with incomplete children won't be deleted.
50  * @see purgeCompletedTodos()
51  */
52  void purgeCompletedTodos();
53 
54  /**
55  * Use this after receiving the an unsuccessful todosPurged() signal to get a i18n error message.
56  */
57  Q_REQUIRED_RESULT QString lastError() const;
58 
59 Q_SIGNALS:
60  /**
61  * Emitted when purging completed to-dos finished.
62  * @param success True if the operation could be completed. @see lastError()
63  * @param numDeleted Number of to-dos that were deleted.
64  * @param numIgnored Number of completed to-dos that weren't deleted because they are read-only
65  * or have incomplete or read-only children.
66  */
67  void todosPurged(bool success, int numDeleted, int numIgnored);
68 
69 private:
70  std::unique_ptr<TodoPurgerPrivate> const d;
71 };
72 }
Class to delete completed to-dos.
Definition: todopurger.h:27
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.