Akonadi::AgentConfigurationBase

Search for usage in LXR

Akonadi::AgentConfigurationBase Class Reference

#include <agentconfigurationbase.h>

Inheritance diagram for Akonadi::AgentConfigurationBase:

Signals

void enableOkButton (bool enabled)
 

Public Member Functions

 AgentConfigurationBase (const KSharedConfigPtr &config, QWidget *parentWidget, const QVariantList &args)
 
KAboutDataaboutData () const
 
virtual void load ()
 
virtual QSize restoreDialogSize () const
 
virtual bool save () const
 
virtual void saveDialogSize (const QSize &size)
 
virtual QDialogButtonBox::StandardButtons standardButtons () 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
 

Protected Member Functions

KSharedConfigPtr config () const
 
QString identifier () const
 
QWidgetparentWidget () const
 
void setKAboutData (const KAboutData &aboutData)
 
- 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)
 

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)
 
- Public Attributes inherited from QObject
typedef QObjectList
 

Detailed Description

Base class for configuration UI for Akonadi agents.

Each agent that has a graphical configuration should subclass this class and create its configuration UI there.

The subclass must reimplement load() and save() virtual methods which are called automatically. The load() method is called on start to initialize widgets (thus subclasses don't need to call it themselves) or when user clicks a "Reset" button. The save() method is called whenever user decides to save changes.

Since each Akonadi agent instance has its own configuration file whose location and name is opaque to the implementation, config() method can be used to get access to the current configuration object.

The widget will not run in the same process as the Akonadi agent, thus all communication with the resource (if needed) should be done over DBus. The identifier of the instance currently being configured is accessible from the identifier() method.

There is no need to signal back to the resource when configuration is changed. When save() is called and the dialog is destroyed, Akonadi will automatically call AgentBase::reconfigure() in the respective Akonadi agent instance.

It is guaranteed that only a single instance of the configuration dialog for given agent will be opened at the same time.

Subclasses of ConfigurationBase must be registered as Akonadi plugins using AKONADI_AGENTCONFIG_FACTORY macro.

The metadata JSON file then must contain the following values:

{
"X-Akonadi-PluginType": "AgentConfig",
"X-Akonadi-Library": "exampleresourceconfig",
"X-Akonadi-AgentConfig-Type": "akonadi_example_resource"
}

The X-Akonadi-Library value must match the name of the plugin binary without the (optional) "lib" prefix and file extension. The X-Akonadi-AgentConfig-Type value must match the name of the X-Akonadi-Identifier value from the agent's desktop file.

The plugin binary should be installed into pim<version>/akonadi/config subdirectory in one of the paths search by QCoreApplication::libraryPaths().

Definition at line 73 of file agentconfigurationbase.h.

Constructor & Destructor Documentation

◆ AgentConfigurationBase()

AgentConfigurationBase::AgentConfigurationBase ( const KSharedConfigPtr & config,
QWidget * parentWidget,
const QVariantList & args )
explicit

Creates a new AgentConfigurationBase objects.

The parentWidget should be used as a parent widget for the configuration widgets.

Subclasses must provide a constructor with this exact signature.

Definition at line 39 of file agentconfigurationbase.cpp.

◆ ~AgentConfigurationBase()

AgentConfigurationBase::~AgentConfigurationBase ( )
override

Definition at line 45 of file agentconfigurationbase.cpp.

Member Function Documentation

◆ aboutData()

KAboutData * AgentConfigurationBase::aboutData ( ) const

Returns about data for the currently configured component.

May return a null pointer.

Definition at line 81 of file agentconfigurationbase.cpp.

◆ config()

KSharedConfigPtr AgentConfigurationBase::config ( ) const
protected

Returns KConfig object belonging to the current Akonadi agent instance.

Definition at line 49 of file agentconfigurationbase.cpp.

◆ identifier()

QString AgentConfigurationBase::identifier ( ) const
protected

Returns identifier of the Akonadi agent instance currently being configured.

Definition at line 54 of file agentconfigurationbase.cpp.

◆ load()

void AgentConfigurationBase::load ( )
virtual

Reimplement to load settings from the configuration object into widgets.

Warning
Always call the base class implementation at the beginning of your overridden method!
See also
config(), save()

Definition at line 59 of file agentconfigurationbase.cpp.

◆ parentWidget()

QWidget * AgentConfigurationBase::parentWidget ( ) const
protected

Definition at line 71 of file agentconfigurationbase.cpp.

◆ restoreDialogSize()

QSize AgentConfigurationBase::restoreDialogSize ( ) const
virtual

Reimplement to restore dialog size.

Definition at line 86 of file agentconfigurationbase.cpp.

◆ save()

bool AgentConfigurationBase::save ( ) const
virtual

Reimplement to save new settings into the configuration object.

Return true if the configuration has been successfully saved and should be applied to the agent, return false otherwise.

Warning
Always remember call the base class implementation at the end of your overridden method!
See also
config(), load()

Definition at line 64 of file agentconfigurationbase.cpp.

◆ saveDialogSize()

void AgentConfigurationBase::saveDialogSize ( const QSize & size)
virtual

Reimplement to save dialog size.

Definition at line 91 of file agentconfigurationbase.cpp.

◆ setKAboutData()

void AgentConfigurationBase::setKAboutData ( const KAboutData & aboutData)
protected

When KAboutData is provided the dialog will also contain KHelpMenu with access to user help etc.

Definition at line 76 of file agentconfigurationbase.cpp.

◆ standardButtons()

QDialogButtonBox::StandardButtons AgentConfigurationBase::standardButtons ( ) const
virtual

Definition at line 95 of file agentconfigurationbase.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 Sat Apr 27 2024 22:07:20 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.