Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference

MergeInterface Class Reference

The MergeInterface class provides an interface for merging Qtopia and Qtopia Desktop data. More...

#include <interfaces/merge.h>

List of all member functions.

Public Members


Detailed Description

The MergeInterface class provides an interface for merging Qtopia and Qtopia Desktop data.

This interface should be implemented by all Qtopia Desktop plugins that want to be able to merge data between a Qtopia device and a desktop computer. For example, all the built-in PIM (Personal Information Management) applications provide a MergeInterface.

For each data type exactly one PluginInterface must be implemented. Any number of merge interfaces may be defined for the same type of data to allow for merging from a variety of different sources.

Writing a merge interface plugin is achieved by subclassing this base class, reimplementing the pure virtual functions data(), applyChanges(), pluginApplicationName(), palmtopApplicationName() and dataSets() and exporting the class with the Q_EXPORT_PLUGIN macro. See the Plugins documentation for details.

See also Qtopia Desktop Classes.


Member Function Documentation

bool MergeInterface::applyChanges ( const QString & dataSet, const QValueList<MergeML::Change> & changes ) [pure virtual]

This function is called by Qtopia Desktop after a merge has taken place. The name of the format is passed in dataSet, and a list of changes is passed in changes. The plugin is expected to apply the changes to its own dataSet format data.

Returns TRUE if all the changes were successfully applied; otherwise returns FALSE.

bool MergeInterface::data ( const QString & dataSet, QValueList<MergeML::Record> & outRecs ) [pure virtual]

All plugins that can synchronize the dataSets() will be synchronized at the same time.

This function should return a list of records in outRecs that should be merged together with those from other plugins maintaining records for the given dataSet.

The function should return TRUE if the plugin was able to succesfully retrieve the data from it's source; FALSE if it failed retrieving it's data.

QStringList MergeInterface::dataSets () const [pure virtual]

Returns a list of the formats that this merge interface can handle.

Qtopia Desktop can merge data in the "addressbook", "datebook", "todolist" and "categories" formats.

QString MergeInterface::palmtopApplicationName () const [pure virtual]

Returns the name of the Qtopia application that can handle data in the same format that this plugin can handle.

QString MergeInterface::pluginApplicationName () const [pure virtual]

Returns the name of the application that handles data in the same format that this plugin can handle.

void MergeInterface::reassignCategory ( int oldCatId, int newCatId, const QString & oldName, const QString & newName ) [pure virtual]

This function is called if the merging of the categories detects conflicts. If your plugin contains any records with category id oldCatId or oldName you must reassign those records to belong to category newCatId or newName.

void MergeInterface::setup ( CenterInterface * center, MergeProgress * p ) [pure virtual]

This function is called by Qtopia Desktop at the beginning of synchronization. It is passed center for use throughout the existence of the plugin to interact with Qtopia Desktop.

The plugin should set its expected time needed for synchronization by calling MergeProgress::setTotals() using p.


This file is part of the Qtopia platform, copyright © 1995-2005 Trolltech, all rights reserved.


Copyright © 2005 Trolltech Trademarks
Qtopia version 2.2.0