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 namespace Akonadi
15 {
16 class IncidenceChanger;
17 
18 /**
19  * @short Class to delete completed to-dos.
20  *
21  * @author Sérgio Martins <[email protected]>
22  * @since 4.12
23  */
24 class AKONADI_CALENDAR_EXPORT TodoPurger : public QObject
25 {
26  Q_OBJECT
27 public:
28  explicit TodoPurger(QObject *parent = nullptr);
29  ~TodoPurger();
30 
31  /**
32  * Sets an IncidenceChanger.
33  * If you don't call this method, an internal IncidenceChanger will be created.
34  * Use this if you want more control over the deletion operations, like iTip management, ACL, undo/redo support.
35  */
36  void setIncidenceChager(IncidenceChanger *changer);
37 
38  /**
39  * Sets the calendar to be used for retrieving the to-do hierarchy.
40  * If you don't call this method, an internal FetchJobCalendar will be created.
41  * Use this if you want to reuse an existing calendar, for performance reasons for example.
42  */
43  void setCalendar(const CalendarBase::Ptr &calendar);
44 
45  /**
46  * Deletes completed to-dos. A to-do with uncomplete children won't be deleted.
47  * @see purgeCompletedTodos()
48  */
49  void purgeCompletedTodos();
50 
51  /**
52  * Use this after receiving the an unsuccessful todosPurged() signal to get a i18n error message.
53  */
54  Q_REQUIRED_RESULT QString lastError() const;
55 
56 Q_SIGNALS:
57  /**
58  * Emitted when purging completed to-dos finished.
59  * @param success True if the operation could be completed. @see lastError()
60  * @param numDeleted Number of to-dos that were deleted.
61  * @param numIgnored Number of completed to-dos that weren't deleted because they are read-only
62  * or have uncomplete or read-only children.
63  */
64  void todosPurged(bool success, int numDeleted, int numIgnored);
65 
66 private:
67  class Private;
68  Private *const d;
69 };
70 }
71 
Class to delete completed to-dos.
Definition: todopurger.h:24
FreeBusyManager::Singleton.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Jun 19 2021 23:12:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.