KDE PIM / Developers / API Docs / kitchensync

KSync::Filter Class Reference

A Filter is a Dynamically Shared Object that is called to operate on a Syncee before and after syncing is done. More...

#include <filter.h>

Inherits QObject.

List of all members.

Public Types

Public Member Functions

Protected Member Functions


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


Member Function Documentation

void KSync::Filter::load KConfig *  cfg  ) 
 

This method will call doLoad() which you need to implement if you need to read configuration data.

Parameters:
cfg The KConfig from where to load Configuration. The group is already set

QString KSync::Filter::name  )  const
 

Get the translated name of the Filter.

Get the Name of the Filter. Filters can call

See also:
setName to set the Filters Name.

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

QWidget * KSync::Filter::configWidget QWidget *  parent  )  [pure virtual]
 

Create a new Configure Widget.

Create a new KConfig widget. Use

Parameters:
parent as the parent.
Use the current values for your Config Widget.

void KSync::Filter::configWidgetClosed QWidget *  widget  )  [pure virtual]
 

Called when config widget is closed.

Parameters:
widget is the widget that was created by configWidget().

Syncee * KSync::Filter::convert Syncee syn  )  [pure virtual]
 

Convert the Syncee before emitting the Read signal.

Before the Syncee emits the read signal you can filter the Syncee. If you return a different Syncee the old one will be replaced. The old one will be cleaned up and removed by the KonnectorManager

Parameters:
syn The Syncee to filter
Returns:
The filtered Syncee or a new one

Syncee * KSync::Filter::reconvert Syncee syn  )  [pure virtual]
 

Convert the Syncee before writing back.

Before the Syncees gets written back to the Konnector you can filter it. If you return a different Syncee the old one will be replaced. The old one will be cleaned up and removed by the KonnectorManager

Parameters:
syn The Syncee to filter
Returns:
The filtered Syncee or a new one

KConfig * KSync::Filter::config  )  [protected]
 

Return 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()

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

The documentation for this class was generated from the following files: