Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QMessageServiceAction Class Reference

The QMessageServiceAction class provides the interface for requesting messaging services. More...

    #include <QMessageServiceAction>

This class is under development and is subject to change.

Inherits QObject.


Public Types

enum State { Pending, InProgress, Successful, Failed }

Public Functions

QMessageServiceAction ( QObject * parent = 0 )
~QMessageServiceAction ()
bool compose ( const QMessage & message )
bool countMessages ( const QMessageFilter & filter = QMessageFilter() )
bool exportUpdates ( const QMessageAccountId & id )
QMessageStore::ErrorCode lastError () const
bool queryMessages ( const QMessageFilter & filter = QMessageFilter(), const QMessageOrdering & ordering = QMessageOrdering(), uint limit = 0, uint offset = 0 )
bool queryMessages ( const QMessageFilter & filter, const QString & body, QMessageDataComparator::Options options = 0, const QMessageOrdering & ordering = QMessageOrdering(), uint limit = 0, uint offset = 0 )
bool retrieve ( const QMessageId & messageId, const QMessageContentContainerId & id )
bool retrieveBody ( const QMessageId & id )
bool retrieveHeader ( const QMessageId & id )
bool send ( QMessage & message )
bool show ( const QMessageId & id )
State state () const
  • 29 public functions inherited from QObject

Public Slots

void cancelOperation ()
  • 1 public slot inherited from QObject

Signals

void messagesCounted ( int count )
void messagesFound ( const QMessageIdList & ids )
void progressChanged ( uint value, uint total )
void stateChanged ( QMessageServiceAction::State newState )

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public type inherited from QObject
  • 4 static public members inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QMessageServiceAction class provides the interface for requesting messaging services.

QMessageServiceAction provides the mechanisms for messaging clients to request services, and to receive information in response. All actions present the same interface for communicating status, and progress information.

All actions communicate changes in their operational state by emitting the activityChanged() signal.

Actions report progress information by emitting the progressChanged() signal.

If an action operation fails after being initiated then the lastError() function will return a value indicating the failure mode encountered.

A client may attempt to cancel an operation after it has been initiated. The cancelOperation() slot is provided for this purpose.

A QMessageServiceAction instance supports only a single request at any time. Attempting to initiate an operation on a QMessageServiceAction while another operation is already in progress will result in the later initiating function returning false. A client may, however, use multiple QMessageServiceAction instances to create a queue of requests that will be performed sequentially.

Each QMessageServiceAction instance will report only the changes pertaining to the request that instance delivers.

Except where noted QMessageServiceActions may initiate network activity. Other functions in the mobility messaging API will not initiate network activity, with the exception of Windows mobile and desktop platforms which may initiate network activity during the evaluation of any function call.


Member Type Documentation

enum QMessageServiceAction::State

This enum type is used to describe the state of the requested action.

ConstantValueDescription
QMessageServiceAction::Pending0The action has not yet begun execution.
QMessageServiceAction::InProgress1The action is currently executing.
QMessageServiceAction::Successful2The action has completed successfully.
QMessageServiceAction::Failed3The action could not be completed successfully, and has finished execution.


Member Function Documentation

QMessageServiceAction::QMessageServiceAction ( QObject * parent = 0 )

Constructs a message service action object.

The parent is passed to the QObject constructor.

QMessageServiceAction::~QMessageServiceAction ()

Destroys the message service action.

void QMessageServiceAction::cancelOperation ()   [slot]

Attempts to cancel the last requested operation.

bool QMessageServiceAction::compose ( const QMessage & message )

Open a composer application using message as a prototype.

The default application for handling the type of message should be used.

Returns true if the action can be initiated; otherwise returns false.

On the QMF platform implementation of this function is left as a task for system integrators.

See also QMessage::type().

bool QMessageServiceAction::countMessages ( const QMessageFilter & filter = QMessageFilter() )

Emits via a messagesCounted() signal the number messages in the messaging store matching filter.

Calling this function may result in the progressChanged() signal being emitted multiple times. An emission of the progressChanged() signal with a total of 0 indicates that the number of progress steps is unknown.

Returns true if the action can be initiated; otherwise returns false.

Note: This function should not initiate network activity, instead only message data already stored on the device will be used during evaluation of the function.

See also QMessage, QMessageFilter, messagesCounted(), progressChanged(), and queryMessages().

bool QMessageServiceAction::exportUpdates ( const QMessageAccountId & id )

Iniate synchronization with external servers of local changes that have been queued by message store operations, for messages with parent account id.

On Windows mobile and desktop platforms this function performs no operation, as when a connection is available, local changes are opportunistically synchronized with external servers.

Returns true if the action can be initiated; otherwise returns false.

See also QMessageStore::addMessage(), QMessageStore::updateMessage(), QMessageStore::removeMessage(), and QMessageStore::removeMessages().

QMessageStore::ErrorCode QMessageServiceAction::lastError () const

Returns a value indicating the last error condition encountered by the action.

void QMessageServiceAction::messagesCounted ( int count )   [signal]

This signal is emitted when a countMessages() operation has counted messages.

count is the number of matching messages found.

See also queryMessages().

void QMessageServiceAction::messagesFound ( const QMessageIdList & ids )   [signal]

This signal is emitted when a queryMessages() operation has found messages.

ids is the list of identifiers of messages found.

See also queryMessages().

void QMessageServiceAction::progressChanged ( uint value, uint total )   [signal]

This signal is emitted when the action operation has progressed.

total is the total number of progress steps to perform, or zero if the number of progress steps is unknown.

value is the number of progress steps completed so far.

bool QMessageServiceAction::queryMessages ( const QMessageFilter & filter = QMessageFilter(), const QMessageOrdering & ordering = QMessageOrdering(), uint limit = 0, uint offset = 0 )

Emits via messagesFound() signals QMessageIds of messages in the messaging store. If filter is not empty only identifiers for messages matching the parameters set by filter will be emitted, otherwise identifiers for all messages will be emitted. If ordering is not empty, then the identifiers will be sorted by the parameters set by ordering. If limit is not zero, then limit places an upper bound on the number of ids in the list returned. offset specifies how many ids to skip at the beginning of the list returned.

Calling this function may result in the messagesFound() and progressChanged() signals being emitted multiple times. An emission of the progressChanged() signal with a total of 0 indicates that the number of progress steps is unknown.

Returns true if the action can be initiated; otherwise returns false.

Note: This function should not initiate network activity, instead only message data already stored on the device will be used during evaluation of the function.

See also QMessage, QMessageFilter, QMessageOrdering, messagesFound(), progressChanged(), and countMessages().

bool QMessageServiceAction::queryMessages ( const QMessageFilter & filter, const QString & body, QMessageDataComparator::Options options = 0, const QMessageOrdering & ordering = QMessageOrdering(), uint limit = 0, uint offset = 0 )

Emits via the messagesFound() signal QMessageIds of messages in the messaging store. If filter is not empty only identifiers for messages matching the parameters set by filter and with a body containing the string body will be emitted, otherwise identifiers for all messages with a body containing body using search options options will be emitted. If ordering is not empty, then the identifiers will be sorted by the parameters set by ordering. If limit is not zero, then limit places an upper bound on the number of ids in the list returned. offset specifies how many ids to skip at the beginning of the list returned.

Calling this function may result in the messagesFound() and progressChanged() signals being emitted multiple times. An emission of the progressChanged() signal with a total of 0 indicates that the number of progress steps is unknown.

Returns true if the action can be initiated; otherwise returns false.

Note: This function should not initiate network activity, instead only message data already stored on the device will be used during evaluation of the function.

See also QMessage, QMessageFilter, QMessageOrdering, messagesFound(), progressChanged(), and countMessages().

bool QMessageServiceAction::retrieve ( const QMessageId & messageId, const QMessageContentContainerId & id )

Retrieve the container identified by messageId and id, the contents of the container should also be retrieved.

Returns true if the action can be initiated; otherwise returns false.

See also QMessageContentContainerId.

bool QMessageServiceAction::retrieveBody ( const QMessageId & id )

Retrieve the body of the message identified by id.

If the message can not be found on the originating server it will be marked as removed.

Returns true if the action can be initiated; otherwise returns false.

See also QMessageId and QMessage::Removed.

bool QMessageServiceAction::retrieveHeader ( const QMessageId & id )

Retrieve meta data of the message identified by id.

The meta data (including flags, from, to, subject, and date fields where applicable) of the message identified by id should be retrieved. If only the message envelope information is present, any other accessible header information should be retrieved.

If the message can not be found on the originating server it will be marked as removed.

Returns true if the action can be initiated; otherwise returns false.

See also QMessageId and QMessage::Removed.

bool QMessageServiceAction::send ( QMessage & message )

Transmit message using the account identified by the message's parentAccountId function. If the message does not have a valid parentAccountId, it will be set to the result of QMessageAccount::defaultAccount() for the message's type.

The message will be stored in the standard Outbox folder for the account before transmission, or moved to that folder if it is already stored in another folder. If transmission is successful, the message will be moved to the standard Sent folder for the account.

Returns true if the action can be initiated; otherwise returns false.

See also QMessage and QMessageAccountId.

bool QMessageServiceAction::show ( const QMessageId & id )

Show the message identified by id.

The default application for handling the type of message that id identifies should be used.

Returns true if the action can be initiated; otherwise returns false.

On the QMF platform implementation of this function is left as a task for system integrators.

See also QMessageId and QMessage::type().

State QMessageServiceAction::state () const

Returns the current state of the action.

See also stateChanged().

void QMessageServiceAction::stateChanged ( QMessageServiceAction::State newState )   [signal]

This signal is emitted when the state of the action changes, with the new state described by newState.

See also state().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 85
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 20
  5. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
Page suivante

Le Qt Labs au hasard

Logo

La théorie des chaînes

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtmobility-1.0-tp
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web