• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

  • Akonadi
  • Akonadi::Monitor
Signals | Public Member Functions

Akonadi::Monitor Class Reference

Monitors an item or collection for changes. More...

#include <monitor.h>

Inherits QObject.

List of all members.

Signals

void allMonitored (bool monitored)
void collectionAdded (const Akonadi::Collection &collection, const Akonadi::Collection &parent)
void collectionChanged (const Akonadi::Collection &collection)
void collectionChanged (const Akonadi::Collection &collection, const QSet< QByteArray > &attributeNames)
void collectionMonitored (const Akonadi::Collection &collection, bool monitored)
void collectionMoved (const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &destination)
void collectionRemoved (const Akonadi::Collection &collection)
void collectionStatisticsChanged (Akonadi::Collection::Id id, const Akonadi::CollectionStatistics &statistics)
void itemAdded (const Akonadi::Item &item, const Akonadi::Collection &collection)
void itemChanged (const Akonadi::Item &item, const QSet< QByteArray > &partIdentifiers)
void itemLinked (const Akonadi::Item &item, const Akonadi::Collection &collection)
void itemMonitored (const Akonadi::Item &item, bool monitored)
void itemMoved (const Akonadi::Item &item, const Akonadi::Collection &collectionSource, const Akonadi::Collection &collectionDestination)
void itemRemoved (const Akonadi::Item &item)
void itemUnlinked (const Akonadi::Item &item, const Akonadi::Collection &collection)
void mimeTypeMonitored (const QString &mimeType, bool monitored)
void resourceMonitored (const QByteArray &identifier, bool monitored)

Public Member Functions

 Monitor (QObject *parent=0)
virtual ~Monitor ()
CollectionFetchScope & collectionFetchScope ()
Collection::List collectionsMonitored () const
void fetchCollection (bool enable)
void fetchCollectionStatistics (bool enable)
void ignoreSession (Session *session)
bool isAllMonitored () const
ItemFetchScope & itemFetchScope ()
QList< Item::Id > itemsMonitored () const
QStringList mimeTypesMonitored () const
QList< QByteArray > resourcesMonitored () const
Session * session () const
void setAllMonitored (bool monitored=true)
void setCollectionFetchScope (const CollectionFetchScope &fetchScope)
void setCollectionMonitored (const Collection &collection, bool monitored=true)
void setItemFetchScope (const ItemFetchScope &fetchScope)
void setItemMonitored (const Item &item, bool monitored=true)
void setMimeTypeMonitored (const QString &mimetype, bool monitored=true)
void setResourceMonitored (const QByteArray &resource, bool monitored=true)
void setSession (Akonadi::Session *session)

Detailed Description

Monitors an item or collection for changes.

The Monitor emits signals if some of these objects are changed or removed or new ones are added to the Akonadi storage.

Optionally, the changed objects can be fetched automatically from the server. To enable this, see itemFetchScope() and collectionFetchScope().

Todo:

Distinguish between monitoring collection properties and collection content.

Special case for collection content counts changed

Author:
Volker Krause <vkrause@kde.org>

Definition at line 51 of file monitor.h.


Constructor & Destructor Documentation

Akonadi::Monitor::Monitor ( QObject *  parent = 0  )  [explicit]

Creates a new monitor.

Parameters:
parent The parent object.
virtual Akonadi::Monitor::~Monitor (  )  [virtual]

Destroys the monitor.


Member Function Documentation

void Akonadi::Monitor::allMonitored ( bool  monitored  )  [signal]

This signal is emitted if the Monitor starts or stops monitoring everything.

Parameters:
monitored Whether everything is now being monitored or not.
Since:
4.3
void Akonadi::Monitor::collectionAdded ( const Akonadi::Collection &  collection,
const Akonadi::Collection &  parent 
) [signal]

This signal is emitted if a new collection has been added to a monitored collection in the Akonadi storage.

Parameters:
collection The new collection.
parent The parent collection.
void Akonadi::Monitor::collectionChanged ( const Akonadi::Collection &  collection  )  [signal]

This signal is emitted if a monitored collection has been changed (properties or content).

Parameters:
collection The changed collection.
void Akonadi::Monitor::collectionChanged ( const Akonadi::Collection &  collection,
const QSet< QByteArray > &  attributeNames 
) [signal]

This signal is emitted if a monitored collection has been changed (properties or attributes).

Parameters:
collection The changed collection.
attributeNames The names of the collection attributes that have been changed.
Since:
4.4
CollectionFetchScope& Akonadi::Monitor::collectionFetchScope (  ) 

Returns the collection fetch scope.

Since this returns a reference it can be used to conveniently modify the current scope in-place, i.e. by calling a method on the returned reference without storing it in a local variable. See the CollectionFetchScope documentation for an example.

Returns:
a reference to the current collection fetch scope
See also:
setCollectionFetchScope() for replacing the current collection fetch scope
Since:
4.4
void Akonadi::Monitor::collectionMonitored ( const Akonadi::Collection &  collection,
bool  monitored 
) [signal]

This signal is emitted if the Monitor starts or stops monitoring collection explicitly.

Parameters:
collection The collection
monitored Whether the collection is now being monitored or not.
Since:
4.3
void Akonadi::Monitor::collectionMoved ( const Akonadi::Collection &  collection,
const Akonadi::Collection &  source,
const Akonadi::Collection &  destination 
) [signal]

This signals is emitted if a monitored collection has been moved.

Parameters:
collection The moved collection.
source The previous parent collection.
destination The new parent collection.
Since:
4.4
void Akonadi::Monitor::collectionRemoved ( const Akonadi::Collection &  collection  )  [signal]

This signal is emitted if a monitored collection has been removed from the Akonadi storage.

Parameters:
collection The removed collection.
Collection::List Akonadi::Monitor::collectionsMonitored (  )  const

Returns the list of collections being monitored.

Since:
4.3
void Akonadi::Monitor::collectionStatisticsChanged ( Akonadi::Collection::Id  id,
const Akonadi::CollectionStatistics &  statistics 
) [signal]

This signal is emitted if the statistics information of a monitored collection has changed.

Parameters:
id The collection identifier of the changed collection.
statistics The updated collection statistics, invalid if automatic fetching of statistics changes is disabled.
void Akonadi::Monitor::fetchCollection ( bool  enable  ) 

Enables automatic fetching of changed collections from the Akonadi storage.

Parameters:
enable true enables automatic fetching, false disables automatic fetching.
void Akonadi::Monitor::fetchCollectionStatistics ( bool  enable  ) 

Enables automatic fetching of changed collection statistics information from the Akonadi storage.

Parameters:
enable true to enables automatic fetching, false disables automatic fetching.
void Akonadi::Monitor::ignoreSession ( Session *  session  ) 

Ignores all change notifications caused by the given session.

This overrides all other settings on this session.

Parameters:
session The session you want to ignore.
bool Akonadi::Monitor::isAllMonitored (  )  const

Returns true if everything is being monitored.

Since:
4.3
void Akonadi::Monitor::itemAdded ( const Akonadi::Item &  item,
const Akonadi::Collection &  collection 
) [signal]

This signal is emitted if an item has been added to a monitored collection in the Akonadi storage.

Parameters:
item The new item.
collection The collection the item has been added to.
void Akonadi::Monitor::itemChanged ( const Akonadi::Item &  item,
const QSet< QByteArray > &  partIdentifiers 
) [signal]

This signal is emitted if a monitored item has changed, e.g.

item parts have been modified.

Parameters:
item The changed item.
partIdentifiers The identifiers of the item parts that has been changed.
ItemFetchScope& Akonadi::Monitor::itemFetchScope (  ) 

Returns the item fetch scope.

Since this returns a reference it can be used to conveniently modify the current scope in-place, i.e. by calling a method on the returned reference without storing it in a local variable. See the ItemFetchScope documentation for an example.

Returns:
a reference to the current item fetch scope
See also:
setItemFetchScope() for replacing the current item fetch scope
void Akonadi::Monitor::itemLinked ( const Akonadi::Item &  item,
const Akonadi::Collection &  collection 
) [signal]

This signal is emitted if a reference to an item is added to a virtual collection.

Parameters:
item The linked item.
collection The collection the item is linked to.
Since:
4.2
void Akonadi::Monitor::itemMonitored ( const Akonadi::Item &  item,
bool  monitored 
) [signal]

This signal is emitted if the Monitor starts or stops monitoring item explicitly.

Parameters:
item The item
monitored Whether the item is now being monitored or not.
Since:
4.3
void Akonadi::Monitor::itemMoved ( const Akonadi::Item &  item,
const Akonadi::Collection &  collectionSource,
const Akonadi::Collection &  collectionDestination 
) [signal]

This signal is emitted if a monitored item has been moved between two collections.

Parameters:
item The moved item.
collectionSource The collection the item has been moved from.
collectionDestination The collection the item has been moved to.
void Akonadi::Monitor::itemRemoved ( const Akonadi::Item &  item  )  [signal]

This signal is emitted if

  • a monitored item has been removed from the Akonadi storage or
  • a item has been removed from a monitored collection.

Parameters:
item The removed item.
QList<Item::Id> Akonadi::Monitor::itemsMonitored (  )  const

Returns the set of items being monitored.

Since:
4.3
void Akonadi::Monitor::itemUnlinked ( const Akonadi::Item &  item,
const Akonadi::Collection &  collection 
) [signal]

This signal is emitted if a reference to an item is removed from a virtual collection.

Parameters:
item The unlinked item.
collection The collection the item is unlinked from.
Since:
4.2
void Akonadi::Monitor::mimeTypeMonitored ( const QString &  mimeType,
bool  monitored 
) [signal]

This signal is emitted if the Monitor starts or stops monitoring mimeType explicitly.

Parameters:
mimeType The mimeType.
monitored Whether the mimeType is now being monitored or not.
Since:
4.3
QStringList Akonadi::Monitor::mimeTypesMonitored (  )  const

Returns the set of mimetypes being monitored.

Since:
4.3
void Akonadi::Monitor::resourceMonitored ( const QByteArray &  identifier,
bool  monitored 
) [signal]

This signal is emitted if the Monitor starts or stops monitoring the resource with the identifier identifier explicitly.

Parameters:
identifier The identifier of the resource.
monitored Whether the resource is now being monitored or not.
Since:
4.3
QList<QByteArray> Akonadi::Monitor::resourcesMonitored (  )  const

Returns the set of identifiers for resources being monitored.

Since:
4.3
Session* Akonadi::Monitor::session (  )  const

Returns the Session used by the monitor to communicate with Akonadi.

Since:
4.4
void Akonadi::Monitor::setAllMonitored ( bool  monitored = true  ) 

Sets whether all items shall be monitored.

Note that if a session is being ignored, this takes precedence over setAllMonitored() on that session.

Definition at line 106 of file monitor.cpp.

void Akonadi::Monitor::setCollectionFetchScope ( const CollectionFetchScope &  fetchScope  ) 

Sets the collection fetch scope.

Controls which collections are monitored and how much of a collection's data is fetched from the server.

Parameters:
fetchScope The new scope for collection fetch operations.
See also:
collectionFetchScope()
Since:
4.4
void Akonadi::Monitor::setCollectionMonitored ( const Collection &  collection,
bool  monitored = true 
)

Sets whether the specified collection shall be monitored for changes.

If monitoring is turned on for the collection, all notifications for items in that collection will be emitted, and its child collections will also be monitored. Note that move notifications will be emitted if either one of the collections involved is being monitored.

Note that if a session is being ignored, this takes precedence over setCollectionMonitored() on that session.

Parameters:
collection The collection to monitor. If this collection is Collection::root(), all collections in the Akonadi storage will be monitored.
monitored Whether to monitor the collection.
void Akonadi::Monitor::setItemFetchScope ( const ItemFetchScope &  fetchScope  ) 

Sets the item fetch scope.

Controls how much of an item's data is fetched from the server, e.g. whether to fetch the full item payload or only meta data.

Parameters:
fetchScope The new scope for item fetch operations.
See also:
itemFetchScope()
void Akonadi::Monitor::setItemMonitored ( const Item &  item,
bool  monitored = true 
)

Sets whether the specified item shall be monitored for changes.

Note that if a session is being ignored, this takes precedence over setItemMonitored() on that session.

Parameters:
item The item to monitor.
monitored Whether to monitor the item.
void Akonadi::Monitor::setMimeTypeMonitored ( const QString &  mimetype,
bool  monitored = true 
)

Sets whether items of the specified mime type shall be monitored for changes.

If monitoring is turned on for the mime type, all notifications for items matching that mime type will be emitted, but notifications for collections matching that mime type will only be emitted if this is otherwise specified, for example by setCollectionMonitored().

Note that if a session is being ignored, this takes precedence over setMimeTypeMonitored() on that session.

Parameters:
mimetype The mime type to monitor.
monitored Whether to monitor the mime type.
void Akonadi::Monitor::setResourceMonitored ( const QByteArray &  resource,
bool  monitored = true 
)

Sets whether the specified resource shall be monitored for changes.

If monitoring is turned on for the resource, all notifications for collections and items in that resource will be emitted.

Note that if a session is being ignored, this takes precedence over setResourceMonitored() on that session.

Parameters:
resource The resource identifier.
monitored Whether to monitor the resource.
void Akonadi::Monitor::setSession ( Akonadi::Session *  session  ) 

Sets the session used by the Monitor to communicate with the Akonadi server.

If not set, the Akonadi::Session::defaultSession is used.

Since:
4.4

The documentation for this class was generated from the following files:
  • monitor.h
  • monitor.cpp

akonadi

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal