Home · All Classes · Grouped Classes · Annotated · Functions

QMailComposerInterface Class Reference

The QMailComposerInterface class defines the interface to objects that can compose a mail message. More...

    #include <QMailComposerInterface>

Inherits QObject.

Public Functions

Public Slots


Additional Inherited Members

Detailed Description

The QMailComposerInterface class defines the interface to objects that can compose a mail message.

Qtopia uses the QMailComposerInterface interface for composing mail messages. A class may implement the QMailComposerInterface interface to compose a mail message format.

The composer class may start composing with no associated message, or it may be provided with an existing message to edit, via the setMessage() or setText() functions. A client can query whether the composer object is empty with the isEmpty() function, and extract the composed message with the message() function. If the message type supports attachments, these can be attached with the attach() function. The current state of composition can be cleared with the clear() function.

The composer object should emit the contentChanged() signal whenever the composed message changes.

Each composer class must export metadata describing itself and the messages it is able to compose. To do this, the composer must implement the key(), messageType(), name(), displayName() and displayIcon() functions.

Rather than creating objects that implement the QMailComposerInterface directly, clients should create an object of an appropriate type by using the QMailComposerFactory class:

    QString key = QMailComposerFactory::defaultKey( QMailMessage::Email );
    QMailComposerInterface* emailComposer = QMailComposerFactory::create( key, this, "emailComposer" );

To allow a class to be created through the QMailComposerFactory interface, a plug-in class derived from QMailComposerPlugin should be implemented.

See also QMailComposerFactory and QMailComposerPlugin.

Member Function Documentation

QMailComposerInterface::QMailComposerInterface ( QWidget * parent = 0 )

Constructs the QMailComposerInterface object with the parent widget parent.

QMailComposerInterface::~QMailComposerInterface ()   [virtual]

Destructs the QMailComposerInterface object.

void QMailComposerInterface::addActions ( QMenu * menu ) const   [virtual]

Allows the composer object to add any relevant actions to the application menu supplied.

void QMailComposerInterface::attach ( const QContent & item, QMailMessage::AttachmentsAction action = QMailMessage::LinkToAttachments )   [virtual slot]

Adds item as an attachment to the message in the composer. The action parameter specifies what the composer should do with item.

void QMailComposerInterface::clear ()   [pure virtual slot]

Clears any message content contained in the composer.

void QMailComposerInterface::contentChanged ()   [signal]

This signal is emitted whenever the composer's content is changed.

QIcon QMailComposerInterface::displayIcon () const

Returns the icon representing the message type created by the composer.

QString QMailComposerInterface::displayName () const

Returns the translated name of the message type created by the composer, in a form suitable for display on a button or menu.

void QMailComposerInterface::finished ()   [signal]

This signal is emitted when the user has completed editing.

bool QMailComposerInterface::isEmpty () const   [pure virtual]

Returns true if the composer contains no message content; otherwise returns false.

QString QMailComposerInterface::key () const

Returns a string identifying the composer.

QMailMessage QMailComposerInterface::message () const   [pure virtual]

Returns the current content of the composer.

See also setMessage().

QMailMessage::MessageType QMailComposerInterface::messageType () const

Returns the type of message created by the composer.

QString QMailComposerInterface::name () const

Returns the translated name of the message type created by the composer.

void QMailComposerInterface::setMessage ( const QMailMessage & mail )   [pure virtual slot]

Sets the content of the composer to mail.

See also message().

void QMailComposerInterface::setSignature ( const QString & signature )   [virtual slot]

Sets the composer to append signature to the body of the message, when creating a message.

void QMailComposerInterface::setText ( const QString & text, const QString & type )   [virtual slot]

Sets the message to contain text, if that is meaningful to the message type created by the composer. The text has the mime-type type.

QWidget * QMailComposerInterface::widget () const   [pure virtual]

Returns the widget implementing the composer interface.

Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3