Akonadi::Monitor

Search for usage in LXR

Akonadi::Monitor Class Reference

#include <monitor.h>

Inheritance diagram for Akonadi::Monitor:

Public Types

enum  Type {
  Collections = 1 , Items , Tags , Subscribers ,
  Notifications
}
 
- Public Types inherited from QObject
typedef  QObjectList
 

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 collectionSubscribed (const Akonadi::Collection &collection, const Akonadi::Collection &parent)
 
void collectionUnsubscribed (const Akonadi::Collection &collection)
 
void debugNotification (const Akonadi::ChangeNotification &notification)
 
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 itemsFlagsChanged (const Akonadi::Item::List &items, const QSet< QByteArray > &addedFlags, const QSet< QByteArray > &removedFlags)
 
void itemsLinked (const Akonadi::Item::List &items, const Akonadi::Collection &collection)
 
void itemsMoved (const Akonadi::Item::List &items, const Akonadi::Collection &collectionSource, const Akonadi::Collection &collectionDestination)
 
void itemsRemoved (const Akonadi::Item::List &items)
 
void itemsTagsChanged (const Akonadi::Item::List &items, const QSet< Akonadi::Tag > &addedTags, const QSet< Akonadi::Tag > &removedTags)
 
void itemsUnlinked (const Akonadi::Item::List &items, const Akonadi::Collection &collection)
 
void itemUnlinked (const Akonadi::Item &item, const Akonadi::Collection &collection)
 
void mimeTypeMonitored (const QString &mimeType, bool monitored)
 
void monitorReady ()
 
void notificationSubscriberAdded (const Akonadi::NotificationSubscriber &subscriber)
 
void notificationSubscriberChanged (const Akonadi::NotificationSubscriber &subscriber)
 
void notificationSubscriberRemoved (const Akonadi::NotificationSubscriber &subscriber)
 
void resourceMonitored (const QByteArray &identifier, bool monitored)
 
void tagAdded (const Akonadi::Tag &tag)
 
void tagChanged (const Akonadi::Tag &tag)
 
void tagMonitored (const Akonadi::Tag &tag, bool monitored)
 
void tagRemoved (const Akonadi::Tag &tag)
 
void typeMonitored (const Akonadi::Monitor::Type type, bool monitored)
 

Public Member Functions

 Monitor (QObject *parent=nullptr)
 
 ~Monitor () override
 
CollectionFetchScopecollectionFetchScope ()
 
Collection::List collectionsMonitored () const
 
bool exclusive () const
 
void fetchChangedOnly (bool enable)
 
void fetchCollection (bool enable)
 
void fetchCollectionStatistics (bool enable)
 
void ignoreSession (Session *session)
 
bool isAllMonitored () const
 
ItemFetchScopeitemFetchScope ()
 
QList< Item::IditemsMonitoredEx () const
 
QStringList mimeTypesMonitored () const
 
int numItemsMonitored () const
 
int numMimeTypesMonitored () const
 
int numResourcesMonitored () const
 
QList< QByteArrayresourcesMonitored () const
 
Sessionsession () const
 
void setAllMonitored (bool monitored=true)
 
void setCollectionFetchScope (const CollectionFetchScope &fetchScope)
 
void setCollectionMonitored (const Collection &collection, bool monitored=true)
 
void setCollectionMoveTranslationEnabled (bool enabled)
 
void setExclusive (bool exclusive=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)
 
void setTagFetchScope (const TagFetchScope &fetchScope)
 
void setTagMonitored (const Tag &tag, bool monitored=true)
 
void setTypeMonitored (Type type, bool monitored=true)
 
TagFetchScopetagFetchScope ()
 
QList< Tag::Id > tagsMonitored () const
 
QList< TypetypesMonitored () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

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.

There are various ways to filter these notifications. There are three types of filter evaluation:

  • (-) removal-only filter, ie. if the filter matches the notification is dropped, if not filter evaluation continues with the next one
  • (+) pass-exit filter, ie. if the filter matches the notification is delivered, if not evaluation is continued
  • (f) final filter, ie. evaluation ends here if the corresponding filter criteria is set, the notification is delivered depending on the result, evaluation is only continued if no filter criteria is defined

The following filter are available, listed in evaluation order: (1) ignored sessions (-) (2) monitor everything (+) (3a) resource and mimetype filters (f) (items only) (3b) resource filters (f) (collections only) (4) item is monitored (+) (5) collection is monitored (+)

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

Note that as a consequence of rule 3a, it is not possible to monitor (more than zero resources OR more than zero mimetypes) AND more than zero collections.

Todo

Distinguish between monitoring collection properties and collection content.

Special case for collection content counts changed

Author
Volker Krause vkrau.nosp@m.se@k.nosp@m.de.or.nosp@m.g

Definition at line 70 of file monitor.h.

Member Enumeration Documentation

◆ Type

Enumerator
Collections 

This must be kept in sync with Akonadi::NotificationMessageV2::Type

Subscribers 

Listen to subscription changes of other Monitors connected to Akonadi.

This is only for debugging purposes and should not be used in real applications.

Since
5.4
Notifications 

Listens to all notifications being emitted by the server and provides additional information about them.

This is only for debugging purposes and should not be used in real applications.

Note
Enabling monitoring this type has performance impact on the Akonadi Server.
Since
5.4

Definition at line 75 of file monitor.h.

Constructor & Destructor Documentation

◆ Monitor()

Monitor::Monitor ( QObject * parent = nullptr)
explicit

Creates a new monitor.

Parameters
parentThe parent object.

Definition at line 21 of file monitor.cpp.

◆ ~Monitor()

Monitor::~Monitor ( )
override

Destroys the monitor.

Definition at line 43 of file monitor.cpp.

Member Function Documentation

◆ allMonitored

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

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

Parameters
monitoredWhether everything is now being monitored or not.
Since
4.3

◆ collectionAdded

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
collectionThe new collection.
parentThe parent collection.

◆ collectionChanged [1/2]

void Akonadi::Monitor::collectionChanged ( const Akonadi::Collection & collection)
signal

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

Parameters
collectionThe changed collection.

◆ collectionChanged [2/2]

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
collectionThe changed collection.
attributeNamesThe names of the collection attributes that have been changed.
Since
4.4

◆ collectionFetchScope()

CollectionFetchScope & 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

Definition at line 235 of file monitor.cpp.

◆ collectionMonitored

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
collectionThe collection
monitoredWhether the collection is now being monitored or not.
Since
4.3

◆ collectionMoved

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
collectionThe moved collection.
sourceThe previous parent collection.
destinationThe new parent collection.
Since
4.4

◆ collectionRemoved

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
collectionThe removed collection.

◆ collectionsMonitored()

Akonadi::Collection::List Monitor::collectionsMonitored ( ) const
nodiscard

Returns the list of collections being monitored.

Since
4.3

Definition at line 259 of file monitor.cpp.

◆ collectionStatisticsChanged

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
idThe collection identifier of the changed collection.
statisticsThe updated collection statistics, invalid if automatic fetching of statistics changes is disabled.

◆ collectionSubscribed

void Akonadi::Monitor::collectionSubscribed ( const Akonadi::Collection & collection,
const Akonadi::Collection & parent )
signal

This signal is emitted if a collection has been subscribed to by the user.

It will be emitted even for unmonitored collections as the check for whether to monitor it has not been applied yet.

Parameters
collectionThe subscribed collection
parentThe parent collection of the subscribed collection.
Since
4.6

◆ collectionUnsubscribed

void Akonadi::Monitor::collectionUnsubscribed ( const Akonadi::Collection & collection)
signal

This signal is emitted if a user unsubscribes from a collection.

Parameters
collectionThe unsubscribed collection
Since
4.6

◆ debugNotification

void Akonadi::Monitor::debugNotification ( const Akonadi::ChangeNotification & notification)
signal

This signal is emitted when Notifications are monitored and the server emits any change notification.

Since
5.4
Note
Getting introspection into all change notifications only makes sense if you want to globally debug Notifications. There is no reason to use this in regular applications.

◆ exclusive()

bool Monitor::exclusive ( ) const
nodiscard

Definition at line 173 of file monitor.cpp.

◆ fetchChangedOnly()

void Monitor::fetchChangedOnly ( bool enable)

Instructs the monitor to fetch only those parts that were changed and were requested in the fetch scope.

This is taken in account only for item modifications. Example usage:

monitor->itemFetchScope().fetchFullPayload( true );
monitor->fetchChangedOnly(true);

In the example if an item was changed, but its payload was not, the full payload will not be retrieved. If the item's payload was changed, the monitor retrieves the changed payload as well.

The default is to fetch everything requested.

Since
4.8
Parameters
enabletrue to enable the feature, false means everything that was requested will be fetched.

Definition at line 221 of file monitor.cpp.

◆ fetchCollection()

void Monitor::fetchCollection ( bool enable)

Enables automatic fetching of changed collections from the Akonadi storage.

Parameters
enabletrue enables automatic fetching, false disables automatic fetching.

Definition at line 193 of file monitor.cpp.

◆ fetchCollectionStatistics()

void Monitor::fetchCollectionStatistics ( bool enable)

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

Parameters
enabletrue to enables automatic fetching, false disables automatic fetching.

Definition at line 199 of file monitor.cpp.

◆ ignoreSession()

void Monitor::ignoreSession ( Session * session)

Ignores all change notifications caused by the given session.

This overrides all other settings on this session.

Parameters
sessionThe session you want to ignore.

Definition at line 179 of file monitor.cpp.

◆ isAllMonitored()

bool Monitor::isAllMonitored ( ) const
nodiscard

Returns true if everything is being monitored.

Since
4.3

Definition at line 322 of file monitor.cpp.

◆ itemAdded

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
itemThe new item.
collectionThe collection the item has been added to.

◆ itemChanged

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
itemThe changed item.
partIdentifiersThe identifiers of the item parts that has been changed.

◆ itemFetchScope()

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 213 of file monitor.cpp.

◆ itemLinked

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
itemThe linked item.
collectionThe collection the item is linked to.
Since
4.2

◆ itemMonitored

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
itemThe item
monitoredWhether the item is now being monitored or not.
Since
4.3

◆ itemMoved

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
itemThe moved item.
collectionSourceThe collection the item has been moved from.
collectionDestinationThe collection the item has been moved to.

◆ itemRemoved

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
itemThe removed item.

◆ itemsFlagsChanged

void Akonadi::Monitor::itemsFlagsChanged ( const Akonadi::Item::List & items,
const QSet< QByteArray > & addedFlags,
const QSet< QByteArray > & removedFlags )
signal

This signal is emitted if flags of monitored items have changed.

Parameters
itemsItems that were changed
addedFlagsFlags that have been added to each item in items
removedFlagsFlags that have been removed from each item in items
Since
4.11

◆ itemsLinked

void Akonadi::Monitor::itemsLinked ( const Akonadi::Item::List & items,
const Akonadi::Collection & collection )
signal

This signal is emitted if a reference to multiple items is added to a virtual collection.

Parameters
itemsThe linked items
collectionThe collections the items are linked to
Since
4.11

◆ itemsMonitoredEx()

QList< Item::Id > Monitor::itemsMonitoredEx ( ) const
nodiscard

Returns the set of items being monitored.

Faster version (at least on 32-bit systems) of itemsMonitored().

Since
4.6

Definition at line 265 of file monitor.cpp.

◆ itemsMoved

void Akonadi::Monitor::itemsMoved ( const Akonadi::Item::List & items,
const Akonadi::Collection & collectionSource,
const Akonadi::Collection & collectionDestination )
signal

This is signal is emitted when multiple monitored items have been moved between two collections.

Parameters
itemsMoved items
collectionSourceThe collection the items have been moved from.
collectionDestinationThe collection the items have been moved to.
Since
4.11

◆ itemsRemoved

void Akonadi::Monitor::itemsRemoved ( const Akonadi::Item::List & items)
signal

This signal is emitted if monitored items have been removed from Akonadi storage of items have been removed from a monitored collection.

Parameters
itemsRemoved items
Since
4.11

◆ itemsTagsChanged

void Akonadi::Monitor::itemsTagsChanged ( const Akonadi::Item::List & items,
const QSet< Akonadi::Tag > & addedTags,
const QSet< Akonadi::Tag > & removedTags )
signal

This signal is emitted if tags of monitored items have changed.

Parameters
itemsItems that were changed
addedTagsTags that have been added to each item in items.
removedTagsTags that have been removed from each item in items
Since
4.13

◆ itemsUnlinked

void Akonadi::Monitor::itemsUnlinked ( const Akonadi::Item::List & items,
const Akonadi::Collection & collection )
signal

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

Parameters
itemsThe unlinked items
collectionThe collections the items are unlinked from
Since
4.11

◆ itemUnlinked

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
itemThe unlinked item.
collectionThe collection the item is unlinked from.
Since
4.2

◆ mimeTypeMonitored

void Akonadi::Monitor::mimeTypeMonitored ( const QString & mimeType,
bool monitored )
signal

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

Parameters
mimeTypeThe mimeType.
monitoredWhether the mimeType is now being monitored or not.
Since
4.3

◆ mimeTypesMonitored()

QStringList Monitor::mimeTypesMonitored ( ) const
nodiscard

Returns the set of mimetypes being monitored.

Since
4.3

Definition at line 298 of file monitor.cpp.

◆ notificationSubscriberAdded

void Akonadi::Monitor::notificationSubscriberAdded ( const Akonadi::NotificationSubscriber & subscriber)
signal

This signal is emitted when Subscribers are monitored and a new subscriber subscribers to the server.

Parameters
subscriberThe new subscriber
Since
5.4
Note
Monitoring for subscribers and listening to this signal only makes sense if you want to globally debug Monitors. There is no reason to use this in regular applications.

◆ notificationSubscriberChanged

void Akonadi::Monitor::notificationSubscriberChanged ( const Akonadi::NotificationSubscriber & subscriber)
signal

This signal is emitted when Subscribers are monitored and an existing subscriber changes its subscription.

Parameters
subscriberThe changed subscriber
Since
5.4
Note
Monitoring for subscribers and listening to this signal only makes sense if you want to globally debug Monitors. There is no reason to use this in regular applications.

◆ notificationSubscriberRemoved

void Akonadi::Monitor::notificationSubscriberRemoved ( const Akonadi::NotificationSubscriber & subscriber)
signal

This signal is emitted when Subscribers are monitored and an existing subscriber unsubscribes from the server.

Parameters
subscriberThe removed subscriber
Since
5.4
Note
Monitoring for subscribers and listening to this signal only makes sense if you want to globally debug Monitors. There is no reason to use this in regular applications.

◆ numItemsMonitored()

int Monitor::numItemsMonitored ( ) const
nodiscard

Returns the number of items being monitored.

Optimization.

Since
4.14.3

Definition at line 274 of file monitor.cpp.

◆ numMimeTypesMonitored()

int Monitor::numMimeTypesMonitored ( ) const
nodiscard

Returns the number of mimetypes being monitored.

Optimization.

Since
4.14.3

Definition at line 304 of file monitor.cpp.

◆ numResourcesMonitored()

int Monitor::numResourcesMonitored ( ) const
nodiscard

Returns the number of resources being monitored.

Optimization.

Since
4.14.3

Definition at line 316 of file monitor.cpp.

◆ resourceMonitored

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
identifierThe identifier of the resource.
monitoredWhether the resource is now being monitored or not.
Since
4.3

◆ resourcesMonitored()

QList< QByteArray > Monitor::resourcesMonitored ( ) const
nodiscard

Returns the set of identifiers for resources being monitored.

Since
4.3

Definition at line 310 of file monitor.cpp.

◆ session()

Session * Monitor::session ( ) const
nodiscard

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

Since
4.4

Definition at line 349 of file monitor.cpp.

◆ setAllMonitored()

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

Sets whether all items shall be monitored.

Parameters
monitoredsets all items as monitored if set as true Note that if a session is being ignored, this takes precedence over setAllMonitored() on that session.

Definition at line 150 of file monitor.cpp.

◆ setCollectionFetchScope()

void 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
fetchScopeThe new scope for collection fetch operations.
See also
collectionFetchScope()
Since
4.4

Definition at line 227 of file monitor.cpp.

◆ setCollectionMonitored()

void 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
collectionThe collection to monitor. If this collection is Collection::root(), all collections in the Akonadi storage will be monitored.
monitoredWhether to monitor the collection.

Definition at line 48 of file monitor.cpp.

◆ setCollectionMoveTranslationEnabled()

void Monitor::setCollectionMoveTranslationEnabled ( bool enabled)

Allows to enable/disable collection move translation.

If enabled (the default), move notifications are automatically translated into add/remove notifications if the source/destination is outside of the monitored collection hierarchy.

Parameters
enabledenables collection move translation if set as true
Since
4.9

Definition at line 355 of file monitor.cpp.

◆ setExclusive()

void Monitor::setExclusive ( bool exclusive = true)

Definition at line 165 of file monitor.cpp.

◆ setItemFetchScope()

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
fetchScopeThe new scope for item fetch operations.
See also
itemFetchScope()

Definition at line 205 of file monitor.cpp.

◆ setItemMonitored()

void 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
itemThe item to monitor.
monitoredWhether to monitor the item.

Definition at line 65 of file monitor.cpp.

◆ setMimeTypeMonitored()

void 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
mimetypeThe mime type to monitor.
monitoredWhether to monitor the mime type.

Definition at line 99 of file monitor.cpp.

◆ setResourceMonitored()

void 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
resourceThe resource identifier.
monitoredWhether to monitor the resource.

Definition at line 82 of file monitor.cpp.

◆ setSession()

void 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.

Parameters
sessionthe session to be set
Since
4.4

Definition at line 328 of file monitor.cpp.

◆ setTagFetchScope()

void Monitor::setTagFetchScope ( const TagFetchScope & fetchScope)

Sets the tag fetch scope.

Controls how much of an tag's data is fetched from the server.

Parameters
fetchScopeThe new scope for tag fetch operations.
See also
tagFetchScope()

Definition at line 243 of file monitor.cpp.

◆ setTagMonitored()

void Monitor::setTagMonitored ( const Tag & tag,
bool monitored = true )

Sets whether the specified tag shall be monitored for changes.

Same rules as for item monitoring apply.

Parameters
tagTag to monitor.
monitoredWhether to monitor the tag.
Since
4.13

Definition at line 116 of file monitor.cpp.

◆ setTypeMonitored()

void Monitor::setTypeMonitored ( Monitor::Type type,
bool monitored = true )

Sets whether given type (Collection, Item, Tag should be monitored).

By default all types are monitored, but once you change one, you have to explicitly enable all other types you want to monitor.

Parameters
typeType to monitor.
monitoredWhether to monitor the type
Since
4.13

Definition at line 133 of file monitor.cpp.

◆ tagAdded

void Akonadi::Monitor::tagAdded ( const Akonadi::Tag & tag)
signal

This signal is emitted if a tag has been added to Akonadi storage.

Parameters
tagThe added tag
Since
4.13

◆ tagChanged

void Akonadi::Monitor::tagChanged ( const Akonadi::Tag & tag)
signal

This signal is emitted if a monitored tag is changed on the server.

Parameters
tagThe changed tag.
Since
4.13

◆ tagFetchScope()

TagFetchScope & Monitor::tagFetchScope ( )

Returns the tag 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.

Returns
a reference to the current tag fetch scope
See also
setTagFetchScope() for replacing the current tag fetch scope

Definition at line 251 of file monitor.cpp.

◆ tagMonitored

void Akonadi::Monitor::tagMonitored ( const Akonadi::Tag & tag,
bool monitored )
signal

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

Parameters
tagThe tag.
monitoredWhether the tag is now being monitored or not.
Since
4.13

◆ tagRemoved

void Akonadi::Monitor::tagRemoved ( const Akonadi::Tag & tag)
signal

This signal is emitted if a monitored tag is removed from the server storage.

The monitor will also emit itemTagsChanged() signal for all monitored items (if any) that were tagged by tag.

Parameters
tagThe removed tag.
Since
4.13

◆ tagsMonitored()

QList< Tag::Id > Monitor::tagsMonitored ( ) const
nodiscard

Returns the set of tags being monitored.

Since
4.13

Definition at line 280 of file monitor.cpp.

◆ typeMonitored

void Akonadi::Monitor::typeMonitored ( const Akonadi::Monitor::Type type,
bool monitored )
signal

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

Parameters
typeThe type.
monitoredWhether the type is now being monitored or not.
Since
4.13

◆ typesMonitored()

QList< Monitor::Type > Monitor::typesMonitored ( ) const
nodiscard

Returns the set of types being monitored.

Since
4.13

Definition at line 289 of file monitor.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.