20 #ifndef AKONADI_INCIDENCECHANGER_H
21 #define AKONADI_INCIDENCECHANGER_H
23 #include "akonadi-calendar_export.h"
25 #include <akonadi/item.h>
26 #include <akonadi/collection.h>
27 #include <kcalcore/incidence.h>
81 class AKONADI_CALENDAR_EXPORT IncidenceChanger :
public QObject
90 ResultCodeSuccess = 0,
92 ResultCodeAlreadyDeleted,
93 ResultCodeInvalidDefaultCollection,
95 ResultCodePermissions,
96 ResultCodeUserCanceled,
97 ResultCodeInvalidUserCollection,
98 ResultCodeModificationDiscarded,
107 enum DestinationPolicy {
108 DestinationPolicyDefault,
109 DestinationPolicyAsk,
110 DestinationPolicyNeverAsk
120 enum InvitationPolicy {
121 InvitationPolicySend = 0,
123 InvitationPolicyDontSend
139 explicit IncidenceChanger(QObject *parent = 0);
161 int createIncidence(
const KCalCore::Incidence::Ptr &incidence,
163 QWidget *parent = 0);
177 int deleteIncidence(
const Akonadi::Item &item, QWidget *parent = 0);
190 int deleteIncidences(
const Akonadi::Item::List &items, QWidget *parent = 0);
207 int modifyIncidence(
const Akonadi::Item &item,
208 const KCalCore::Incidence::Ptr &originalPayload = KCalCore::Incidence::Ptr(),
209 QWidget *parent = 0);
227 void startAtomicOperation(
const QString &operationDescription = QString());
235 void endAtomicOperation();
262 void setDestinationPolicy(DestinationPolicy destinationPolicy);
270 DestinationPolicy destinationPolicy()
const;
275 void setShowDialogsOnError(
bool enable);
283 bool showDialogsOnError()
const;
289 void setRespectsCollectionRights(
bool respect);
299 bool respectsCollectionRights()
const;
308 void setHistoryEnabled(
bool enable);
317 bool historyEnabled()
const;
324 History* history()
const;
337 bool deletedRecently(Akonadi::Item::Id)
const;
344 void setGroupwareCommunication(
bool enabled);
351 bool groupwareCommunication()
const;
356 void setAutoAdjustRecurrence(
bool enable);
362 bool autoAdjustRecurrence()
const;
369 void setInvitationPolicy(InvitationPolicy policy);
377 InvitationPolicy invitationPolicy()
const;
397 void createFinished(
int changeId,
398 const Akonadi::Item &item,
399 Akonadi::IncidenceChanger::ResultCode resultCode,
400 const QString &errorString);
410 void modifyFinished(
int changeId,
411 const Akonadi::Item &item,
412 Akonadi::IncidenceChanger::ResultCode resultCode,
413 const QString &errorString);
424 void deleteFinished(
int changeId,
425 const QVector<Akonadi::Item::Id> &itemIdList,
426 Akonadi::IncidenceChanger::ResultCode resultCode,
427 const QString &errorString);
431 friend class History;
432 friend class AtomicOperation;
434 explicit IncidenceChanger(
bool enableHistory, QObject *parent = 0);
442 Q_DECLARE_METATYPE(Akonadi::IncidenceChanger::DestinationPolicy)
443 Q_DECLARE_METATYPE(Akonadi::IncidenceChanger::ResultCode)
444 Q_DECLARE_METATYPE(Akonadi::IncidenceChanger::ChangeType)
Represents a collection of PIM items.