QtMobility Reference Documentation

QVersitOrganizerExporter Class Reference

The QVersitOrganizerExporter class converts QOrganizerItems into QVersitDocuments. More...

 #include <QVersitOrganizerExporter>

This class was introduced in Qt Mobility 1.1.

Public Types

enum Error { NoError, EmptyOrganizerError, UnknownComponentTypeError, UnderspecifiedOccurrenceError }

Public Functions

QVersitOrganizerExporter ()
QVersitOrganizerExporter ( const QString & profile )
~QVersitOrganizerExporter ()
QVersitDocument document () const
QMap<int, Error> errorMap () const
bool exportItems ( const QList<QOrganizerItem> & items, QVersitDocument::VersitType versitType = QVersitDocument::ICalendar20Type )
void setDetailHandler ( QVersitOrganizerExporterDetailHandler * handler )

Detailed Description

The QVersitOrganizerExporter class converts QOrganizerItems into QVersitDocuments.

This class is used to convert a list of QOrganizerItems (which may be stored in a QOrganizerManager) into a QVersitDocument (which may be written to an I/O device using QVersitReader. While multiple items are provided as input, a single QVersitDocument is produced as output. Unless there is an error, there is a one-to-one mapping between organizer items and sub-documents of the result.

Member Type Documentation

enum QVersitOrganizerExporter::Error

This enum specifies an error that occurred during the most recent call to exportItems()

ConstantValueDescription
QVersitOrganizerExporter::NoError0The most recent operation was successful
QVersitOrganizerExporter::EmptyOrganizerError1One of the organizer items was empty
QVersitOrganizerExporter::UnknownComponentTypeError2One of the components in the iCalendar file is not supported
QVersitOrganizerExporter::UnderspecifiedOccurrenceError3An event or todo exception was found which did not specify both its parent and a specifier for which instance to override

Member Function Documentation

QVersitOrganizerExporter::QVersitOrganizerExporter ()

Constructs a new exporter

QVersitOrganizerExporter::QVersitOrganizerExporter ( const QString & profile )

Constructs a new exporter for the given profile. The profile strings should be one of those defined by QVersitOrganizerHandlerFactory, or a value otherwise agreed to by a Versit plugin.

The profile determines which plugins will be loaded to supplement the exporter.

QVersitOrganizerExporter::~QVersitOrganizerExporter ()

Frees the memory used by the exporter

QVersitDocument QVersitOrganizerExporter::document () const

Returns the document exported in the most recent call to exportItems().

See also exportItems().

QMap<int, Error> QVersitOrganizerExporter::errorMap () const

Returns the map of errors encountered in the most recent call to exportItems(). The key is the index into the input list of organizer items and the value is the error that occurred on that item. If errors occur, export does not generate EmptyContactError or NoNameError errors but just succeeds in creating the empty, albeit invalid, vCard. QVersitContactExporter never fails.

See also exportItems().

bool QVersitOrganizerExporter::exportItems ( const QList<QOrganizerItem> & items, QVersitDocument::VersitType versitType = QVersitDocument::ICalendar20Type )

Converts items into a QVersitDocument, using the format given by versitType. Returns true on success. If any of the items could not be exported, false is returned and errorMap() will return a list describing the errors that occurred. The successfully exported components will still be available via document().

See also document() and errorMap().

void QVersitOrganizerExporter::setDetailHandler ( QVersitOrganizerExporterDetailHandler * handler )

Sets handler to be the handler for processing QOrganizerItemDetails, 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.

Only one detail handler can be set. If another detail handler was previously set, it will no longer be associated with the exporter.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.