Akonadi::AgentBase::Observer
#include <agentbase.h>
Public Member Functions | |
Observer () | |
virtual | ~Observer () |
virtual void | collectionAdded (const Akonadi::Collection &collection, const Akonadi::Collection &parent) |
virtual void | collectionChanged (const Akonadi::Collection &collection) |
virtual void | collectionRemoved (const Akonadi::Collection &collection) |
virtual void | itemAdded (const Akonadi::Item &item, const Akonadi::Collection &collection) |
virtual void | itemChanged (const Akonadi::Item &item, const QSet< QByteArray > &partIdentifiers) |
virtual void | itemRemoved (const Akonadi::Item &item) |
Detailed Description
The interface for reacting on monitored or replayed changes.
The Observer provides an interface to react on monitored or replayed changes.
Since the this base class does only tell the change recorder that the change has been processed, an AgentBase subclass which wants to actually process the change needs to subclass Observer and reimplement the methods it is interested in.
Such an agent specific Observer implementation can either be done stand-alone, i.e. as a separate object, or by inheriting both AgentBase and AgentBase::Observer.
The observer implementation then has registered with the agent, so it can forward the incoming changes to the observer.
- Note
- In the multiple inheritance approach the init() method automatically registers itself as the observer.
- Do not call the base implementation of reimplemented virtual methods! The default implementation disconnected themselves from the Akonadi::ChangeRecorder to enable internal optimizations for unused notifications.
Example for stand-alone observer:
Example for observer through multiple inheritance:
- Deprecated
- Use ObserverV2 instead
Definition at line 178 of file agentbase.h.
Constructor & Destructor Documentation
◆ Observer()
AgentBase::Observer::Observer | ( | ) |
Creates an observer instance.
Definition at line 59 of file agentbase.cpp.
◆ ~Observer()
|
virtual |
Destroys the observer instance.
Definition at line 63 of file agentbase.cpp.
Member Function Documentation
◆ collectionAdded()
|
virtual |
Reimplement to handle adding of new collections.
- Parameters
-
collection The newly added collection. parent The parent collection.
Definition at line 93 of file agentbase.cpp.
◆ collectionChanged()
|
virtual |
Reimplement to handle changes to existing collections.
- Parameters
-
collection The changed collection.
Reimplemented in Akonadi::AgentBase::ObserverV2.
Definition at line 102 of file agentbase.cpp.
◆ collectionRemoved()
|
virtual |
Reimplement to handle deletion of collections.
- Parameters
-
collection The deleted collection.
Definition at line 110 of file agentbase.cpp.
◆ itemAdded()
|
virtual |
Reimplement to handle adding of new items.
- Parameters
-
item The newly added item. collection The collection item
got added to.
Definition at line 67 of file agentbase.cpp.
◆ itemChanged()
|
virtual |
Reimplement to handle changes to existing items.
- Parameters
-
item The changed item. partIdentifiers The identifiers of the item parts that has been changed.
Definition at line 76 of file agentbase.cpp.
◆ itemRemoved()
|
virtual |
Reimplement to handle deletion of items.
- Parameters
-
item The deleted item.
Definition at line 85 of file agentbase.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 13 2024 11:54:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.