akonadi
Akonadi::Monitor Class Reference
#include <monitor.h>

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 fetchCollection(), fetchItemMetaData(), fetchItemData().
- Todo:
- : distinguish between monitoring collection properties and collection content.
- Todo:
- : special case for collection content counts changed
Definition at line 49 of file monitor.h.
Signals | |
void | collectionAdded (const Akonadi::Collection &collection, const Akonadi::Collection &parent) |
void | collectionChanged (const Akonadi::Collection &collection) |
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 | itemMoved (const Akonadi::Item &item, const Akonadi::Collection &collectionSource, const Akonadi::Collection &collectionDestination) |
void | itemRemoved (const Akonadi::Item &item) |
Public Member Functions | |
void | fetchCollection (bool enable) |
void | fetchCollectionStatistics (bool enable) |
void | ignoreSession (Session *session) |
ItemFetchScope & | itemFetchScope () |
Monitor (QObject *parent=0) | |
void | setAllMonitored (bool monitored=true) |
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) |
virtual | ~Monitor () |
Constructor & Destructor Documentation
Monitor::Monitor | ( | QObject * | parent = 0 |
) | [explicit] |
Creates a new monitor.
- Parameters:
-
parent The parent object.
Definition at line 39 of file monitor.cpp.
Monitor::~Monitor | ( | ) | [virtual] |
Member Function Documentation
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) or has been reparented.
- Parameters:
-
collection The changed collection.
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.
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 Monitor::fetchCollection | ( | bool | enable | ) |
Enables automatic fetching of changed collections from the Akonadi storage.
- Parameters:
-
enable true
enables automatic fetching,false
disables automatic fetching.
Definition at line 101 of file monitor.cpp.
void 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.
Definition at line 106 of file monitor.cpp.
void Monitor::ignoreSession | ( | Session * | session | ) |
Ignores all change notifications caused by the given session.
- Parameters:
-
session The session you want to ignore.
Definition at line 96 of file monitor.cpp.
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 & 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
Definition at line 116 of file monitor.cpp.
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.
void Akonadi::Monitor::setAllMonitored | ( | bool | monitored = true |
) |
void Monitor::setCollectionMonitored | ( | const Collection & | collection, | |
bool | monitored = true | |||
) |
Sets whether the specified collection shall be monitored for changes.
- Parameters:
-
collection The collection to monitor. If this collection is Collection::root(), all collections in the Akonadi storage will be monitored.
Definition at line 59 of file monitor.cpp.
void 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()
Definition at line 111 of file monitor.cpp.
void Monitor::setItemMonitored | ( | const Item & | item, | |
bool | monitored = true | |||
) |
Sets whether the specified item shall be monitored for changes.
- Parameters:
-
item The item to monitor.
Definition at line 67 of file monitor.cpp.
void Monitor::setMimeTypeMonitored | ( | const QString & | mimetype, | |
bool | monitored = true | |||
) |
Sets whether objects of the specified mime type shall be monitored for changes.
- Parameters:
-
mimetype The mime type to monitor.
Definition at line 83 of file monitor.cpp.
void Monitor::setResourceMonitored | ( | const QByteArray & | resource, | |
bool | monitored = true | |||
) |
Sets whether the specified resource shall be monitored for changes.
- Parameters:
-
resource The resource identifier.
Definition at line 75 of file monitor.cpp.
The documentation for this class was generated from the following files: