Monitor Class Reference
from PyKDE4.akonadi import *
Inherits: QObject
Subclasses: Akonadi.ChangeRecorder
Namespace: Akonadi
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
Method Documentation
__init__ | ( | self, | ||
QObject | parent=0 | |||
) |
Creates a new monitor.
- Parameters:
-
parent The parent object.
__init__ | ( | self, | ||
MonitorPrivate | d, | |||
QObject | parent=0 | |||
) |
collectionAdded | ( | self, | ||
Akonadi.Collection | collection, | |||
Akonadi.Collection | parent | |||
) |
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.
- Signal syntax:
QObject.connect(source, SIGNAL("collectionAdded(const Collection&, const Collection&)"), target_slot)
collectionChanged | ( | self, | ||
Akonadi.Collection | collection | |||
) |
This signal is emitted if a monitored collection has been changed (properties or content) or has been reparented.
- Parameters:
-
collection The changed collection.
- Signal syntax:
QObject.connect(source, SIGNAL("collectionChanged(const Collection&)"), target_slot)
collectionRemoved | ( | self, | ||
Akonadi.Collection | collection | |||
) |
This signal is emitted if a monitored collection has been removed from the Akonadi storage.
- Parameters:
-
collection The removed collection.
- Signal syntax:
QObject.connect(source, SIGNAL("collectionRemoved(const Collection&)"), target_slot)
collectionStatisticsChanged | ( | self, | ||
Akonadi.Collection.Id | id, | |||
Akonadi.CollectionStatistics | statistics | |||
) |
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.
- Signal syntax:
QObject.connect(source, SIGNAL("collectionStatisticsChanged(Id, const CollectionStatistics&)"), target_slot)
fetchCollection | ( | self, | ||
bool | enable | |||
) |
Enables automatic fetching of changed collections from the Akonadi storage.
- Parameters:
-
enable true enables automatic fetching, false disables automatic fetching.
fetchCollectionStatistics | ( | self, | ||
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.
ignoreSession | ( | self, | ||
Akonadi.Session | session | |||
) |
Ignores all change notifications caused by the given session.
- Parameters:
-
session The session you want to ignore.
itemAdded | ( | self, | ||
Akonadi.Item | item, | |||
Akonadi.Collection | collection | |||
) |
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.
- Signal syntax:
QObject.connect(source, SIGNAL("itemAdded(const Item&, const Collection&)"), target_slot)
itemChanged | ( | self, | ||
Akonadi.Item | item, | |||
QSet |
partIdentifiers | |||
) |
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.
- Signal syntax:
QObject.connect(source, SIGNAL("itemChanged(const Item&, const QSet
&)"), target_slot)
Akonadi.ItemFetchScope itemFetchScope | ( | self ) |
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
itemMoved | ( | self, | ||
Akonadi.Item | item, | |||
Akonadi.Collection | collectionSource, | |||
Akonadi.Collection | collectionDestination | |||
) |
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.
- Signal syntax:
QObject.connect(source, SIGNAL("itemMoved(const Item&, const Collection&, const Collection&)"), target_slot)
itemRemoved | ( | self, | ||
Akonadi.Item | item | |||
) |
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.
- Signal syntax:
QObject.connect(source, SIGNAL("itemRemoved(const Item&)"), target_slot)
setAllMonitored | ( | self, | ||
bool | monitored=1 | |||
) |
Sets whether all items shall be monitored.
setCollectionMonitored | ( | self, | ||
Akonadi.Collection | collection, | |||
bool | monitored=1 | |||
) |
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.
setItemFetchScope | ( | self, | ||
Akonadi.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()
setItemMonitored | ( | self, | ||
Akonadi.Item | item, | |||
bool | monitored=1 | |||
) |
Sets whether the specified item shall be monitored for changes.
- Parameters:
-
item The item to monitor.
setMimeTypeMonitored | ( | self, | ||
QString | mimetype, | |||
bool | monitored=1 | |||
) |
Sets whether objects of the specified mime type shall be monitored for changes.
- Parameters:
-
mimetype The mime type to monitor.
setResourceMonitored | ( | self, | ||
QByteArray | resource, | |||
bool | monitored=1 | |||
) |
Sets whether the specified resource shall be monitored for changes.
- Parameters:
-
resource The resource identifier.