QVersitResourceHandler Class

The QVersitResourceHandler class is an interface for clients wishing to implement custom behaviour for loading and saving files to disk when exporting and importing. More...

Header: #include <QVersitResourceHandler>
Inherited By:

QVersitDefaultResourceHandler

Public Functions

virtual ~QVersitResourceHandler()
virtual bool loadResource(const QString &location, QByteArray *contents, QString *mimeType) = 0
virtual bool saveResource(const QByteArray &contents, const QVersitProperty &property, QString *location) = 0

Detailed Description

The QVersitResourceHandler class is an interface for clients wishing to implement custom behaviour for loading and saving files to disk when exporting and importing.

See also QVersitContactImporter, QVersitContactExporter, and QVersitDefaultResourceHandler.

Member Function Documentation

[virtual] QVersitResourceHandler::~QVersitResourceHandler()

Frees any memory used by the handler.

[pure virtual] bool QVersitResourceHandler::loadResource(const QString &location, QByteArray *contents, QString *mimeType)

Loads a file from location. *contents is filled with the contents of the file and *mimeType is set to the MIME type that it is determined to be. Returns true on success, false on failure.

[pure virtual] bool QVersitResourceHandler::saveResource(const QByteArray &contents, const QVersitProperty &property, QString *location)

Saves the binary data contents to a file on a persistent storage medium.

property holds the QVersitProperty which is the context in which the binary is coming from. The QVersitResourceHandler can use this, for example, to determine file extension it should choose. *location is filled with the contents of the file. Returns true on success, false on failure.