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

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • akonadi
monitor.h
1 /*
2  Copyright (c) 2006 - 2007 Volker Krause <vkrause@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef AKONADI_MONITOR_H
21 #define AKONADI_MONITOR_H
22 
23 #include <akonadi/collection.h>
24 #include <akonadi/item.h>
25 
26 #include <QtCore/QObject>
27 
28 namespace Akonadi {
29 
30 class CollectionFetchScope;
31 class CollectionStatistics;
32 class Item;
33 class ItemFetchScope;
34 class MonitorPrivate;
35 class Session;
36 
72 class AKONADI_EXPORT Monitor : public QObject
73 {
74  Q_OBJECT
75 
76  public:
82  explicit Monitor( QObject *parent = 0 );
83 
87  virtual ~Monitor();
88 
104  void setCollectionMonitored( const Collection &collection, bool monitored = true );
105 
115  void setItemMonitored( const Item &item, bool monitored = true );
116 
128  void setResourceMonitored( const QByteArray &resource, bool monitored = true );
129 
143  void setMimeTypeMonitored( const QString &mimetype, bool monitored = true );
144 
151  void setAllMonitored( bool monitored = true );
152 
159  void ignoreSession( Session *session );
160 
166  void fetchCollection( bool enable );
167 
174  void fetchCollectionStatistics( bool enable );
175 
186  void setItemFetchScope( const ItemFetchScope &fetchScope );
187 
212  void fetchChangedOnly( bool enable );
213 
226  ItemFetchScope &itemFetchScope();
227 
239  void setCollectionFetchScope( const CollectionFetchScope &fetchScope );
240 
254  CollectionFetchScope &collectionFetchScope();
255 
261  Collection::List collectionsMonitored() const;
262 
270  AKONADI_DEPRECATED QList<Item::Id> itemsMonitored() const;
271 
279  QVector<Item::Id> itemsMonitoredEx() const;
280 
286  QStringList mimeTypesMonitored() const;
287 
293  QList<QByteArray> resourcesMonitored() const;
294 
300  bool isAllMonitored() const;
301 
308  void setSession( Akonadi::Session *session );
309 
315  Session* session() const;
316 
324  void setCollectionMoveTranslationEnabled( bool enabled );
325 
326  Q_SIGNALS:
333  void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &partIdentifiers );
334 
343  void itemsFlagsChanged( const Akonadi::Item::List &items, const QSet<QByteArray> &addedFlags,
344  const QSet<QByteArray> &removedFlags );
345 
353  void itemMoved( const Akonadi::Item &item, const Akonadi::Collection &collectionSource,
354  const Akonadi::Collection &collectionDestination );
355 
365  void itemsMoved( const Akonadi::Item::List &items, const Akonadi::Collection &collectionSource,
366  const Akonadi::Collection &collectionDestination );
367 
374  void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
375 
384  void itemRemoved( const Akonadi::Item &item );
385 
394  void itemsRemoved( const Akonadi::Item::List &items );
395 
403  void itemLinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
404 
413  void itemsLinked( const Akonadi::Item::List &items, const Akonadi::Collection &collection );
414 
422  void itemUnlinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
423 
432  void itemsUnlinked( const Akonadi::Item::List &items, const Akonadi::Collection &collection );
433 
440  void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
441 
447  void collectionChanged( const Akonadi::Collection &collection );
448 
457  void collectionChanged( const Akonadi::Collection &collection, const QSet<QByteArray> &attributeNames );
458 
468  void collectionMoved( const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &destination );
469 
475  void collectionRemoved( const Akonadi::Collection &collection );
476 
487  void collectionSubscribed( const Akonadi::Collection& collection, const Akonadi::Collection &parent );
488 
496  void collectionUnsubscribed( const Akonadi::Collection& collection );
497 
506  void collectionStatisticsChanged( Akonadi::Collection::Id id,
507  const Akonadi::CollectionStatistics &statistics );
508 
516  void collectionMonitored( const Akonadi::Collection &collection, bool monitored );
517 
525  void itemMonitored( const Akonadi::Item &item, bool monitored );
526 
534  void resourceMonitored( const QByteArray &identifier, bool monitored );
535 
543  void mimeTypeMonitored( const QString &mimeType, bool monitored );
544 
551  void allMonitored( bool monitored );
552 
553  protected:
554  //@cond PRIVATE
555  friend class EntityTreeModel;
556  friend class EntityTreeModelPrivate;
557  MonitorPrivate *d_ptr;
558  explicit Monitor( MonitorPrivate *d, QObject *parent = 0 );
559  //@endcond
560 
561  private:
562  Q_DECLARE_PRIVATE( Monitor )
563 
564  //@cond PRIVATE
565  Q_PRIVATE_SLOT( d_ptr, void slotSessionDestroyed( QObject* ) )
566  Q_PRIVATE_SLOT( d_ptr, void slotStatisticsChangedFinished( KJob* ) )
567  Q_PRIVATE_SLOT( d_ptr, void slotFlushRecentlyChangedCollections() )
568  Q_PRIVATE_SLOT( d_ptr, void slotNotify( const Akonadi::NotificationMessageV2::List& ) )
569  Q_PRIVATE_SLOT( d_ptr, void dataAvailable() )
570  Q_PRIVATE_SLOT( d_ptr, void serverStateChanged( Akonadi::ServerManager::State ) )
571  Q_PRIVATE_SLOT( d_ptr, void invalidateCollectionCache( qint64 ) )
572  Q_PRIVATE_SLOT( d_ptr, void invalidateItemCache( qint64 ) )
573 
574  friend class ResourceBasePrivate;
575  //@endcond
576 };
577 
578 }
579 
580 #endif
Akonadi::CollectionStatistics
Provides statistics information of a Collection.
Definition: collectionstatistics.h:69
Akonadi::CollectionFetchScope
Specifies which parts of a collection should be fetched from the Akonadi storage. ...
Definition: collectionfetchscope.h:68
Akonadi::Collection
Represents a collection of PIM items.
Definition: collection.h:75
Akonadi::Entity::Id
qint64 Id
Describes the unique id type.
Definition: entity.h:65
Akonadi::Session
A communication session with the Akonadi storage.
Definition: session.h:59
Akonadi::ItemFetchScope
Specifies which parts of an item should be fetched from the Akonadi storage.
Definition: itemfetchscope.h:68
Akonadi::Monitor
Monitors an item or collection for changes.
Definition: monitor.h:72
Akonadi::MonitorPrivate
Definition: monitor_p.h:49
Akonadi::EntityTreeModel
A model for collections and items together.
Definition: entitytreemodel.h:317
Akonadi::ServerManager::State
State
Enum for the various states the server can be in.
Definition: servermanager.h:50
Akonadi::EntityTreeModelPrivate
Definition: entitytreemodel_p.h:61
Akonadi::Collection::List
QList< Collection > List
Describes a list of collections.
Definition: collection.h:81
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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