Qt Mobility Reference Documentation

QVersitOrganizerImporter Class Reference

The QVersitOrganizerImporter class converts QVersitDocuments to QOrganizerItems. More...

 #include <QVersitOrganizerImporter>

Public Types

enum Error { NoError, InvalidDocumentError, EmptyDocumentError }

Public Functions

QVersitOrganizerImporter ()
~QVersitOrganizerImporter ()
QMap<int, Error> errors () const
bool importDocument ( const QVersitDocument & document )
QList<QOrganizerItem> items () const
QVersitResourceHandler * resourceHandler () const
void setPropertyHandler ( QVersitOrganizerImporterPropertyHandler * handler )
void setResourceHandler ( QVersitResourceHandler * handler )

Detailed Description

The QVersitOrganizerImporter class converts QVersitDocuments to QOrganizerItems.

This class is used to convert a QVersitDocuments (which may be produced by a QVersitReader) to lists of QOrganizerItems (which may be saved into a QOrganizerItemManager. Unless there is an error, there is a one-to-one mapping between sub-documents of the input Versit document and QOrganizerItems.


Member Type Documentation

enum QVersitOrganizerImporter::Error


Member Function Documentation

QVersitOrganizerImporter::QVersitOrganizerImporter ()

Constructs a new importer

QVersitOrganizerImporter::~QVersitOrganizerImporter ()

Frees the memory used by the importer

QMap<int, Error> QVersitOrganizerImporter::errors () const

Returns the map of errors encountered in the most recent call to importDocuments(). The key is the index into the input list of documents and the value is the error that occurred on that document.

See also importDocuments().

bool QVersitOrganizerImporter::importDocument ( const QVersitDocument & document )

Converts document into a corresponding list of QOrganizerItems. After calling this, the converted organizer items can be retrieved by calling items().

Returns true on success. The document should contain at least one subdocument. In the importing process, each subdocument roughly corresponds to a QOrganizerItem. If any of the subdocuments cannot be imported as organizer items (eg. they don't conform to the iCalendar format), false is returned and errors() will return a list describing the errors that occurred. The successfully imported items will still be available via items().

See also items() and errors().

QList<QOrganizerItem> QVersitOrganizerImporter::items () const

Returns the organizer items imported in the most recent call to importDocuments().

See also importDocuments().

QVersitResourceHandler * QVersitOrganizerImporter::resourceHandler () const

Returns the associated resource handler.

See also setResourceHandler().

void QVersitOrganizerImporter::setPropertyHandler ( QVersitOrganizerImporterPropertyHandler * handler )

Sets handler to be the handler for processing QVersitProperties, or 0 to have no handler.

Does not take ownership of the handler. The client should ensure the handler remains valid for the lifetime of the exporter.

void QVersitOrganizerImporter::setResourceHandler ( QVersitResourceHandler * handler )

Sets handler to be the handler to save files with, or 0 to have no handler.

Does not take ownership of the handler. The client should ensure the handler remains valid for the lifetime of the exporter.

See also resourceHandler().


Copyright © 2009-2010 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Mobility Project 1.1.0