Home

QMailComposerInterface Class Reference

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

    #include <QMailComposerInterface>

Inherits QWidget.


Public Functions

QMailComposerInterface ( QWidget * parent = 0 )
virtual QList<QAction *> actions () const
virtual void compose ( QMailMessage::ResponseType type, const QMailMessage & source = QMailMessage(), const QMailMessagePart::Location & sourceLocation = QMailMessagePart::Location(), QMailMessage::MessageType messageType = QMailMessage::AnyType ) = 0
virtual QList<QMailMessage::ContentType> contentTypes () const = 0
virtual QIcon displayIcon ( QMailMessage::MessageType type ) const = 0
virtual QString displayName ( QMailMessage::MessageType type ) const = 0
virtual bool isEmpty () const = 0
virtual bool isReadyToSend () const = 0
virtual bool isSupported ( QMailMessage::MessageType t, QMailMessage::ContentType c = QMailMessage::NoContent ) const
virtual QString key () const = 0
virtual QMailMessage message () const = 0
virtual QList<QMailMessage::MessageType> messageTypes () const = 0
virtual QString name ( QMailMessage::MessageType type ) const = 0
virtual QString status () const
virtual QString title () const = 0

Public Slots

virtual void clear () = 0
virtual void setSendingAccountId ( const QMailAccountId & accountId )
virtual void setSignature ( const QString & signature )

Signals

void cancel ()
void changed ()
void sendMessage ()
void statusChanged ( const QString & status )

Additional Inherited Members


Detailed Description

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

Qt Extended 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 compose() function. A client can query whether the composer object is empty with the isEmpty() function, and extract the composed message with the message() function. The current state of composition can be cleared with the clear() function.

The composer object should emit the changed() signal whenever the composed message changes. If composition is cancelled, the composer should emit the cancel() signal. When the message is ready to send, the composer should emit the sendMessage() signal. For composers which need to inform of state changes during composition, such as multi-page composers, the statusChanged() signal should be emitted to allow container objects to update their view of the status() string.

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(), messageTypes(), name(), displayName() and displayIcon() functions.

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

See also QMailComposerFactory.


Member Function Documentation

QMailComposerInterface::QMailComposerInterface ( QWidget * parent = 0 )

Constructs the QMailComposerInterface object with the parent widget parent.

QList<QAction *> QMailComposerInterface::actions () const   [virtual]

Returns a list of actions that are exported by the composer.

void QMailComposerInterface::cancel ()   [signal]

Signal that is emitted when message composition is cancelled.

See also changed().

void QMailComposerInterface::changed ()   [signal]

Signal that is emitted when the currently composed message has been changed.

See also cancel().

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

Clears any message content contained in the composer.

void QMailComposerInterface::compose ( QMailMessage::ResponseType type, const QMailMessage & source = QMailMessage(), const QMailMessagePart::Location & sourceLocation = QMailMessagePart::Location(), QMailMessage::MessageType messageType = QMailMessage::AnyType )   [pure virtual]

Directs the composer to compose a message, of the form required for the response type type. If source is non-empty, then it should be interpreted as preset content to be composed. If sourceLocation is non-empty, then it should be interpreted as indicating a message part that forms preset content for the composition. messageType indicates the type of message that the composer should produce.

QList<QMailMessage::ContentType> QMailComposerInterface::contentTypes () const   [pure virtual]

Returns the content types created by the composer.

QIcon QMailComposerInterface::displayIcon ( QMailMessage::MessageType type ) const   [pure virtual]

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

QString QMailComposerInterface::displayName ( QMailMessage::MessageType type ) const   [pure virtual]

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

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

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

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

Returns true if the composed message is ready to send or false otherwise.

bool QMailComposerInterface::isSupported ( QMailMessage::MessageType t, QMailMessage::ContentType c = QMailMessage::NoContent ) const   [virtual]

Returns true if the composer can produce a message of type t, containing data of content type c.

QString QMailComposerInterface::key () const   [pure virtual]

Returns a string identifying the composer.

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

Returns the current content of the composer.

QList<QMailMessage::MessageType> QMailComposerInterface::messageTypes () const   [pure virtual]

Returns the message types created by the composer.

QString QMailComposerInterface::name ( QMailMessage::MessageType type ) const   [pure virtual]

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

void QMailComposerInterface::sendMessage ()   [signal]

Signal that is emitted when message composition has finished and the message is ready to send.

See also isReadyToSend().

void QMailComposerInterface::setSendingAccountId ( const QMailAccountId & accountId )   [virtual slot]

Sets the composer to use the account identified by accountId for outgoing messages.

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

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

QString QMailComposerInterface::status () const   [virtual]

Returns a string description of the current composition state.

void QMailComposerInterface::statusChanged ( const QString & status )   [signal]

Signal that is emitted when the message composition state has changed, to a new state described by status. For example, when transitioning from message body composition to message details composition in a multi-page composer.

See also status(), cancel(), and changed().

QString QMailComposerInterface::title () const   [pure virtual]

Returns a string that may be used as the title for the composer presentation.


Copyright © 2010 QtSoftware
Messaging Framework