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 | |||
) |
allMonitored | ( | self, | ||
bool | monitored | |||
) |
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
- Signal syntax:
QObject.connect(source, SIGNAL("allMonitored(bool)"), target_slot)
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)
collectionMonitored | ( | self, | ||
Akonadi.Collection | collection, | |||
bool | monitored | |||
) |
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
- Signal syntax:
QObject.connect(source, SIGNAL("collectionMonitored(const Collection&, bool)"), 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)
Akonadi.Collection.List collectionsMonitored | ( | self ) |
Returns the list of collections being monitored.
- Since:
- 4.3
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.
bool isAllMonitored | ( | self ) |
Returns true if everything is being monitored.
- Since:
- 4.3
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
itemLinked | ( | self, | ||
Akonadi.Item | item, | |||
Akonadi.Collection | collection | |||
) |
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
- Signal syntax:
QObject.connect(source, SIGNAL("itemLinked(const Item&, const Collection&)"), target_slot)
itemMonitored | ( | self, | ||
Akonadi.Item | item, | |||
bool | monitored | |||
) |
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
- Signal syntax:
QObject.connect(source, SIGNAL("itemMonitored(const Item&, bool)"), target_slot)
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)
itemUnlinked | ( | self, | ||
Akonadi.Item | item, | |||
Akonadi.Collection | collection | |||
) |
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
- Signal syntax:
QObject.connect(source, SIGNAL("itemUnlinked(const Item&, const Collection&)"), target_slot)
[Item::Id] itemsMonitored | ( | self ) |
Returns the set of items being monitored.
- Since:
- 4.3
mimeTypeMonitored | ( | self, | ||
QString | mimeType, | |||
bool | monitored | |||
) |
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
- Signal syntax:
QObject.connect(source, SIGNAL("mimeTypeMonitored(const QString&, bool)"), target_slot)
QStringList mimeTypesMonitored | ( | self ) |
Returns the set of mimetypes being monitored.
- Since:
- 4.3
resourceMonitored | ( | self, | ||
QByteArray | identifier, | |||
bool | monitored | |||
) |
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
- Signal syntax:
QObject.connect(source, SIGNAL("resourceMonitored(const QByteArray&, bool)"), target_slot)
[QByteArray] resourcesMonitored | ( | self ) |
Returns the set of identifiers for resources being monitored.
- Since:
- 4.3
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.