• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • akonadi
  • calendar
incidencechanger.h
1 /*
2  Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
3  Copyright (C) 2010-2012 Sérgio Martins <iamsergio@gmail.com>
4 
5  This library is free software; you can redistribute it and/or modify it
6  under the terms of the GNU Library General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or (at your
8  option) any later version.
9 
10  This library is distributed in the hope that it will be useful, but WITHOUT
11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13  License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to the
17  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  02110-1301, USA.
19 */
20 #ifndef AKONADI_INCIDENCECHANGER_H
21 #define AKONADI_INCIDENCECHANGER_H
22 
23 #include "akonadi-calendar_export.h"
24 
25 #include <akonadi/item.h>
26 #include <akonadi/collection.h>
27 #include <kcalcore/incidence.h>
28 
29 #include <QWidget>
30 
31 namespace Akonadi {
32 
79 class History;
80 
81 class AKONADI_CALENDAR_EXPORT IncidenceChanger : public QObject
82 {
83  Q_OBJECT
84 public:
89  enum ResultCode {
90  ResultCodeSuccess = 0,
91  ResultCodeJobError,
92  ResultCodeAlreadyDeleted,
93  ResultCodeInvalidDefaultCollection,
94  ResultCodeRolledback,
95  ResultCodePermissions,
96  ResultCodeUserCanceled,
97  ResultCodeInvalidUserCollection,
98  ResultCodeModificationDiscarded,
99  ResultCodeDuplicateId
100  };
101 
107  enum DestinationPolicy {
108  DestinationPolicyDefault,
109  DestinationPolicyAsk,
110  DestinationPolicyNeverAsk
111  };
112 
116  enum ChangeType {
117  ChangeTypeCreate,
118  ChangeTypeModify,
119  ChangeTypeDelete
120  };
121 
126  explicit IncidenceChanger( QObject *parent = 0 );
127 
131  ~IncidenceChanger();
132 
148  int createIncidence( const KCalCore::Incidence::Ptr &incidence,
149  const Akonadi::Collection &collection = Akonadi::Collection(),
150  QWidget *parent = 0 );
151 
164  int deleteIncidence( const Akonadi::Item &item, QWidget *parent = 0 );
165 
177  int deleteIncidences( const Akonadi::Item::List &items, QWidget *parent = 0 );
178 
194  int modifyIncidence( const Akonadi::Item &item,
195  const KCalCore::Incidence::Ptr &originalPayload = KCalCore::Incidence::Ptr(),
196  QWidget *parent = 0 );
197 
214  void startAtomicOperation( const QString &operationDescription = QString() );
215 
222  void endAtomicOperation();
223 
232  void setDefaultCollection( const Akonadi::Collection &collection );
233 
240  Akonadi::Collection defaultCollection() const;
241 
249  void setDestinationPolicy( DestinationPolicy destinationPolicy );
250 
257  DestinationPolicy destinationPolicy() const;
258 
262  void setShowDialogsOnError( bool enable );
263 
270  bool showDialogsOnError() const;
271 
276  void setRespectsCollectionRights( bool respect );
277 
286  bool respectsCollectionRights() const;
287 
295  void setHistoryEnabled( bool enable );
296 
304  bool historyEnabled() const;
305 
311  History* history() const;
312 
324  bool deletedRecently( Akonadi::Item::Id ) const;
325 
331  void setGroupwareCommunication( bool enabled );
332 
337  bool groupwareCommunication() const;
338 
345  Akonadi::Collection lastCollectionUsed() const;
346 
347 Q_SIGNALS:
357  void createFinished( int changeId,
358  const Akonadi::Item &item,
359  Akonadi::IncidenceChanger::ResultCode resultCode,
360  const QString &errorString );
370  void modifyFinished( int changeId,
371  const Akonadi::Item &item,
372  Akonadi::IncidenceChanger::ResultCode resultCode,
373  const QString &errorString );
384  void deleteFinished( int changeId,
385  const QVector<Akonadi::Item::Id> &itemIdList,
386  Akonadi::IncidenceChanger::ResultCode resultCode,
387  const QString &errorString );
388 
389 private:
390  //@cond PRIVATE
391  friend class History;
392  // used internally by the History class
393  explicit IncidenceChanger( bool enableHistory, QObject *parent = 0 );
394  class Private;
395  Private *const d;
396  //@endcond
397 };
398 
399 }
400 
401 Q_DECLARE_METATYPE( Akonadi::IncidenceChanger::DestinationPolicy )
402 Q_DECLARE_METATYPE( Akonadi::IncidenceChanger::ResultCode )
403 Q_DECLARE_METATYPE( Akonadi::IncidenceChanger::ChangeType )
404 
405 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:37 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal