Better wording
[kdepim.git] / calendarsupport / calendarutils.h
blob1cb18c7632b38b88ca174271f520b443405bc847
1 /*
2 Copyright (C) 2010 Bertjan Broeksema <broeksema@kde.org>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 As a special exception, permission is given to link this program
19 with any edition of Qt, and distribute the resulting executable,
20 without including the source code for Qt in the source distribution.
22 #ifndef CALENDARSUPPORT_CALENDARUTILS_H
23 #define CALENDARSUPPORT_CALENDARUTILS_H
25 #include "calendarsupport_export.h"
27 #include <Akonadi/Collection>
29 #include <QtCore/QObject>
31 namespace Akonadi {
32 class Item;
35 namespace CalendarSupport {
37 class Calendar;
38 class CalendarUtilsPrivate;
40 /** Some calendar/Incidence related utilitly methods.
42 NOTE: this class will only start an modify job for an Item when no other job
43 started by this class for the same Item is still running.
45 class CALENDARSUPPORT_EXPORT CalendarUtils : public QObject
47 Q_OBJECT
48 public:
49 /**
50 * Creates a new CalendarUtils instance. The instance does not take owner ship
51 * over the Calendar.
53 explicit CalendarUtils( Calendar *calendar, QObject *parent = 0 );
55 ~CalendarUtils();
57 /**
58 * Returns the Caledar on which this utils class is operating.
60 Calendar *calendar() const;
62 /**
63 * Makes the incidence from @param item independent from its parent. Returns
64 * true when the ModifyJob to make the incidence independent was actually
65 * started, false otherwise. This method is async, either actionFailed or
66 * actionFinished will be emitted when the operation finished or failed.
68 bool makeIndependent( const Akonadi::Item &item );
70 /**
71 * Makes all children of the incindence from @param item independent
72 * Returns true when one or more incidence(s) where made independent,
73 * false otherwise.
75 bool makeChildrenIndependent( const Akonadi::Item &item );
77 /** Todo specific methods ***************************************************/
79 /**
80 * Deletes the completed todos from all active collections in the Calendar.
82 void purgeCompletedTodos();
84 Q_SIGNALS:
85 void actionFailed( const Akonadi::Item &item, const QString &msg );
86 void actionFinished( const Akonadi::Item &item );
88 private:
89 CalendarUtilsPrivate *const d_ptr;
90 Q_DECLARE_PRIVATE( CalendarUtils )
92 Q_PRIVATE_SLOT( d_ptr,
93 void handleChangeFinish( Akonadi::Item,
94 Akonadi::Item,
95 CalendarSupport::IncidenceChanger::WhatChanged,
96 bool ) )
101 #endif // CALENDARUTILS_H