kitchensync
KSync::Filter Class Reference
#include <filter.h>
Inheritance diagram for KSync::Filter:

Detailed Description
A Filter is a Dynamically Shared Object that is called to operate on a Syncee before and after syncing is done.For example this feature is used to filter out Records from specific Categories for specefic Syncees. The same feature could be used to have any file downloaded by a Konnector or KIO Resource and then convert an UnknownSyncee to something else before sync is taking place and it gets converted to a UnknownSyncee before writing back to the origin
You need to supply implementation for a configure dialog, a method to determine if you're able and want to filter a Syncee and then methods to convert and convert back (reconvert) this Syncee.
A Filter can have multiple instances with different Config Option set
Definition at line 77 of file filter.h.
Public Types | |
typedef QValueList< Filter * > | List |
Public Member Functions | |
Filter (QObject *parent, const char *name) | |
virtual | ~Filter () |
void | load (KConfig *config) |
void | save (KConfig *) |
QString | name () const |
virtual QString | type () const=0 |
virtual bool | supports (Syncee *syncee)=0 |
virtual QWidget * | configWidget (QWidget *parent)=0 |
virtual void | configWidgetClosed (QWidget *widget)=0 |
virtual void | convert (Syncee *)=0 |
virtual void | reconvert (Syncee *)=0 |
Protected Member Functions | |
KConfig * | config () |
void | setName (const QString &name) |
Member Function Documentation
void KSync::Filter::load | ( | KConfig * | config | ) |
This method will call doLoad() which you need to implement if you need to read configuration data.
- Parameters:
-
config The KConfig from where to load configuration. The group is already set.
Definition at line 37 of file filter.cpp.
QString KSync::Filter::name | ( | ) | const |
Get the translated name of the filter.
Get the name of the filter. Filters can call
Definition at line 49 of file filter.cpp.
virtual bool KSync::Filter::supports | ( | Syncee * | syncee | ) | [pure virtual] |
Test if a filter can operate on the syncee.
Before requesting to convert/reconvert the syncee the KSync::Filter is asked to if it can operate on the syncee. Filters need to implement it.
- Parameters:
-
syncee Can the filter operate on this Syncee
Implemented in KSync::AddressBookFilter, and KSync::CalendarFilter.
virtual QWidget* KSync::Filter::configWidget | ( | QWidget * | parent | ) | [pure virtual] |
Create a new configuration widget.
Create a new configuration widget.
- Parameters:
-
parent The parent widget.
Implemented in KSync::AddressBookFilter, and KSync::CalendarFilter.
virtual void KSync::Filter::configWidgetClosed | ( | QWidget * | widget | ) | [pure virtual] |
Called when config widget is closed.
- Parameters:
-
widget The widget that was created by configWidget().
Implemented in KSync::AddressBookFilter, and KSync::CalendarFilter.
KConfig * KSync::Filter::config | ( | ) | [protected] |
Returns the KConfig instance.
Get KConfig object where the configuration is stored. Do not change the group, and it is only valid from within the doLoad() method
- See also:
- doLoad()
Definition at line 54 of file filter.cpp.
void KSync::Filter::setName | ( | const QString & | name | ) | [protected] |
Set the name of the filter.
Set the name returned by
- See also:
- name() const. Normally a filter implementation will do this from within the constructor.
- Parameters:
-
name Set the name of the filter
Definition at line 59 of file filter.cpp.
The documentation for this class was generated from the following files: