• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • Akonadi
  • PreprocessorBase
Public Types | Public Member Functions | Protected Member Functions | List of all members
Akonadi::PreprocessorBase Class Referenceabstract

#include <preprocessorbase.h>

Inheritance diagram for Akonadi::PreprocessorBase:
Inheritance graph
[legend]

Public Types

enum  ProcessingResult { ProcessingCompleted, ProcessingDelayed, ProcessingFailed, ProcessingRefused }
 
- Public Types inherited from Akonadi::AgentBase
enum  Status { Idle = 0, Running, Broken, NotConfigured }
 

Public Member Functions

ItemFetchScope & fetchScope ()
 
void finishProcessing (ProcessingResult result)
 
virtual ProcessingResult processItem (const Item &item)=0
 
void setFetchScope (const ItemFetchScope &fetchScope)
 
- Public Member Functions inherited from Akonadi::AgentBase
QString agentName () const
 
virtual void cleanup ()
 
QString identifier () const
 
virtual int progress () const
 
virtual QString progressMessage () const
 
void registerObserver (Observer *observer)
 
void setAgentName (const QString &name)
 
virtual int status () const
 
virtual QString statusMessage () const
 
WId winIdForDialogs () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Protected Member Functions

 PreprocessorBase (const QString &id)
 
virtual ~PreprocessorBase ()
 
- Protected Member Functions inherited from Akonadi::AgentBase
 AgentBase (const QString &id)
 
 ~AgentBase ()
 
virtual void aboutToQuit ()
 
void changeProcessed ()
 
ChangeRecorder * changeRecorder () const
 
KSharedConfigPtr config ()
 
virtual void doSetOnline (bool online)
 
bool isOnline () const
 
void setNeedsNetwork (bool needsNetwork)
 
void setOnline (bool state)
 
void setTemporaryOffline (int makeOnlineInSeconds=300)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Member Functions inherited from QDBusContext
bool calledFromDBus () const
 
QDBusConnection connection () const
 
bool isDelayedReply () const
 
const QDBusMessage & message () const
 
void sendErrorReply (QDBusError::ErrorType type, const QString &msg) const
 
void sendErrorReply (const QString &name, const QString &msg) const
 
void setDelayedReply (bool enable) const
 

Additional Inherited Members

- Public Slots inherited from Akonadi::AgentBase
virtual void configure (WId windowId)
 
- Signals inherited from Akonadi::AgentBase
void abortRequested ()
 
void advancedStatus (const QVariantMap &status)
 
void agentNameChanged (const QString &name)
 
void configurationDialogAccepted ()
 
void configurationDialogRejected ()
 
void error (const QString &message)
 
void onlineChanged (bool online)
 
void percent (int progress)
 
void reloadConfiguration ()
 
void status (int status, const QString &message=QString())
 
void warning (const QString &message)
 
- Static Public Member Functions inherited from Akonadi::AgentBase
static KComponentData componentData ()
 
template<typename T >
static int init (int argc, char **argv)
 
- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
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)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

The base class for all Akonadi preprocessor agents.

This class should be used as a base class by all preprocessor agents since it encapsulates large parts of the protocol between preprocessor agent, agent manager and the Akonadi storage.

Preprocessor agents are special agents that are informed about newly added items before any other agents. This allows them to do filtering on the items or any other task that shall be done before the new item is visible in the Akonadi storage system.

The method all the preprocessors must implement is processItem().

Author
Szymon Stefanek s.ste.nosp@m.fane.nosp@m.k@gma.nosp@m.il.c.nosp@m.om
Since
4.4

Definition at line 55 of file preprocessorbase.h.

Member Enumeration Documentation

enum Akonadi::PreprocessorBase::ProcessingResult

Describes the possible return values of the processItem() method.

Enumerator
ProcessingCompleted 

Processing completed successfully for this item.

The Akonadi server will push in a new item when it's available.

ProcessingDelayed 

Processing was delayed to a later stage.

This must be returned when implementing asynchronous preprocessing.

If this value is returned, finishProcessing() has to be called when processing is done.

ProcessingFailed 

Processing for this item failed (and the failure is unrecoverable).

The Akonadi server will push in a new item when it's available, after possibly logging the failure.

ProcessingRefused 

Processing for this item was refused.

This is very similar to ProcessingFailed above but additionally remarks that the item that the Akonadi server pushed in wasn't meant for this Preprocessor. The Akonadi server will push in a new item when it's available, after possibly logging the failure and maybe taking some additional action.

Definition at line 63 of file preprocessorbase.h.

Constructor & Destructor Documentation

PreprocessorBase::PreprocessorBase ( const QString &  id)
protected

Creates a new preprocessor base agent.

Parameters
idThe instance id of the preprocessor base agent.

Definition at line 30 of file preprocessorbase.cpp.

PreprocessorBase::~PreprocessorBase ( )
protectedvirtual

Destroys the preprocessor base agent.

Definition at line 35 of file preprocessorbase.cpp.

Member Function Documentation

ItemFetchScope & PreprocessorBase::fetchScope ( )

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
setFetchScope() for replacing the current item fetch scope

Definition at line 58 of file preprocessorbase.cpp.

void PreprocessorBase::finishProcessing ( ProcessingResult  result)

This method must be called if processing is implemented asynchronously.

Parameters
resultthe processing result You should call it when you have completed the processing or if an abortRequest() signal arrives (and in this case you will probably use ProcessingFailed as result).

Valid values for result are ProcessingCompleted, PocessingRefused and ProcessingFailed. Passing any other value will lead to a runtime assertion.

Definition at line 39 of file preprocessorbase.cpp.

virtual ProcessingResult Akonadi::PreprocessorBase::processItem ( const Item &  item)
pure virtual

This method must be implemented by every preprocessor subclass.

Parameters
itemthe item to process It must realize the preprocessing of the given item.

The Akonadi server will push in for preprocessing any newly created item: it's your responsibility to decide if you want to process the item or not.

The method should return ProcessingCompleted on success, ProcessingDelayed if processing is implemented asynchronously and ProcessingRefused or ProcessingFailed if the processing didn't complete.

If your operation is asynchronous then you should also connect to the abortRequested() signal and handle it appropriately (as the server MAY abort your async job if it decides that it's taking too long).

void PreprocessorBase::setFetchScope ( const ItemFetchScope &  fetchScope)

Sets the item fetch scope.

The ItemFetchScope 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
fetchScope()

Definition at line 51 of file preprocessorbase.cpp.


The documentation for this class was generated from the following files:
  • preprocessorbase.h
  • preprocessorbase.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal