QMessageStore Class ReferenceThe QMessageStore class represents the main interface for storage and retrieval of messages, folders and accounts in the messaging store. More... #include <QMessageStore> This class is under development and is subject to change. Inherits QObject. Public Types
Public Functions
Signals
Static Public Members
Additional Inherited Members
Detailed DescriptionThe QMessageStore class represents the main interface for storage and retrieval of messages, folders and accounts in the messaging store. The QMessageStore class is accessed through a singleton interface and provides functions for adding, updating and deleting messages in the messaging store. QMessageStore provides the countFolders() and queryFolders() functions for counting and listing the folders contained by the messaging store, and the countAccounts() and queryAccounts() functions for counting and listing the accounts contained by the store. These functions use the QMessageFolderFilter and QMessageFolderOrdering classes, and the QMessageAccountFilter and QMessageAccountOrdering classes to constrain their searches. QMessageStore also implements functionality allowing the messages contained by the store to be counted or listed, using various filtering and ordering constraints. Clients can access this functionality via the countMessages and queryMessages functions of the QMessageServiceAction class. With the exception of Windows mobile and desktop platforms, QMessageStore functions should not initiate network activity. Instead functions are restricted to operating on data already on the device. See QMessageServiceAction for functions related to initiating network activity. If a QMessageStore operation fails, the lastError() function will return an error code value indicating the failure mode encountered. A successful operation will set the lastError() result to QMessageStore::NoError. Messages in the messaging store are identified by QMessageId objects. The data associated with a message is retrieved in the form of a QMessage object using message(). Likewise a folder is retrieved in the form of a QMessageFolder object using folder(), and an account is retrieved in the form of a QMessageAccount object using account(). Messages can be inserted into the store using the addMessage() function, messages in the store can be manipulated via the updateMessage() function ,and removed by the removeMessage() functions. Messaging store manipulations involving messages are reported via the messagesAdded(), messagesUpdated() and messagesRemoved() signals. See also QMessage, QMessageId, QMessageContentContainerId, and QMessageServiceAction. Member Type Documentation
|
Constant | Value | Description |
---|---|---|
QMessageStore::NoError | 0 | The operation was successfully performed. |
QMessageStore::InvalidId | 1 | The operation failed due to the specification of an invalid identifier. |
QMessageStore::ConstraintFailure | 2 | The operation failed due to a constraint violation. |
QMessageStore::ContentInaccessible | 3 | The operation failed because the content data cannot be accessed by the messaging store. |
QMessageStore::NotYetImplemented | 4 | The operation failed because the messaging store does not yet implement the operation. |
QMessageStore::FrameworkFault | 5 | The operation failed because the messaging store encountered an error in performing the operation. |
QMessageStore::WorkingMemoryOverflow | 6 | The operation failed because the messaging store exhausted all memory available for evaluating queries. |
QMessageStore::Busy | 7 | The operation failed because the messaging store is being used by another thread. |
This type contains a value identifying a registered message filter.
This type contains a set of values identifying registered message filters.
Defines whether or not a message will be removed from the originating server.
Constant | Value | Description |
---|---|---|
QMessageStore::RemoveLocalCopyOnly | 1 | Do not remove the message from the originating server. |
QMessageStore::RemoveOnOriginatingServer | 2 | Remove the message both from the local store and from the originating server if any. |
Returns the QMessageAccount identified by id from the store.
Updates the existing QMessage m on the messaging store. Returns true if the operation successfully updates the store; otherwise returns false.
To ensure the change is propagated to any affected external server QMessageServiceAction::exportUpdates() should be subsequently called.
See also message(), updateMessage(), removeMessage(), and QMessageServiceAction::exportUpdates().
Returns the number of messages which match the filtering criteria defined in QMessageAccountFilter filter. If filter is empty a count of all messages is returned.
See also lastError() and queryAccounts().
Returns the number of messages which match the filtering criteria defined in QMessageFolderFilter filter. If filter is empty a count of all messages is returned.
See also lastError() and queryFolders().
Returns the number of messages which match the filtering criteria defined in QMessageFilter filter. If filter is empty a count of all messages is returned.
See also lastError() and queryMessages().
Returns the QMessageFolder identified by id from the store.
Returns the single instance of the QMessageStore class.
If necessary, the store will be instantiated and initialized.
Returns the code of the last error condition reported by the messaging store.
Returns the QMessage identified by id from the store.
Signal that is emitted when the message identified by id is added to the message store. matchingFilterIds contains a set of values identifiying registered notification filters that matched the message.
See also messageRemoved(), messageUpdated(), and registerNotificationFilter().
Signal that is emitted when the message identified by id is removed from the message store. matchingFilterIds contains a set of values identifiying registered notification filters that matched the message.
Since the filters apply to the state of the data after the message removal, the only data item that may be subject to filtration is the identifier of the removed message.
See also messageAdded(), messageUpdated(), and registerNotificationFilter().
Signal that is emitted when the message identified by id is updated in the message store. matchingFilterIds contains a set of values identifiying registered notification filters that matched the message.
Since the filters apply to the state of the data after the message modification, updates to messages which matched a given filter prior to modification but not afterwards will not result in the emission of the messageUpdated signal.
See also messageAdded(), messageRemoved(), and registerNotificationFilter().
Returns the QMessageAccountIds of accounts in the messaging store. If filter is not empty only accounts matching the parameters set by filter will be returned, otherwise identifiers for all accounts will be returned. 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.
See also lastError() and countAccounts().
Returns the QMessageFolderIds of folders in the messaging store. If filter is not empty only folders matching the parameters set by filter will be returned, otherwise identifiers for all folders will be returned. 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.
See also lastError() and countFolders().
Returns the QMessageIds of messages in the messaging store. If filter is not empty only messages matching the parameters set by filter will be returned, otherwise identifiers for all messages will be returned. 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.
See also lastError() and countMessages().
Returns the QMessageIds of messages in the messaging store. If filter is not empty only messages matching the parameters set by filter and with a body containing the string body will be returned, otherwise identifiers for all messages with a body containing body will be returned. 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. options specifies the search optons to use.
See also lastError() and countMessages().
Registers a message filter that will be used to generate messageAdded(), messageRemoved() and messageUpdated() signals. Returns an identifier value that can be used to identify the reason that a signal was emitted, and to unregister the filter at a later time.
The filter is applied to the state of the data after the occurrence of the event for which a notification may be emitted.
See also unregisterNotificationFilter(), messageAdded(), messageRemoved(), and messageUpdated().
Removes the message with QMessageId id from the messaging store. If option is QMessageStore::RemoveOnOriginatingServer then when synchronization is performed the message should be removed from both the local message store and the originating server if any.
Returns true if the operation successfully updates the store; otherwise returns false.
To ensure the change is propagated to any affected external server QMessageServiceAction::exportUpdates() should be subsequently called.
option is ignored on Windows mobile and desktop platforms.
See also removeMessages(), addMessage(), updateMessage(), and QMessageServiceAction::exportUpdates().
Removes all messages identified by the filter filter from the messaging store. If option is QMessageStore::RemoveOnOriginatingServer then when synchronization is performed the messages should be removed from both the local message store and the originating server if any.
Returns true if the operation successfully updates the store; otherwise returns false.
To ensure the change is propagated to any affected external server QMessageServiceAction::exportUpdates() should be subsequently called.
option is ignored on Windows mobile and desktop platforms.
For example:
To implement a function to remove a list messages identified by QMessageIds from the messaging store.
bool removeMessages(const QMessageIdList& ids) { QMessageFilter idsFilter(ids); return QMessageStore::instance()->removeMessages(idsFilter); }
See also removeMessage(), addMessage(), updateMessage(), and QMessageServiceAction::exportUpdates().
Removes the message filter associated with notificationFilterId from the set used to generate message event signals.
See also registerNotificationFilter(), messageAdded(), messageRemoved(), and messageUpdated().
Updates the existing QMessage m on the messaging store. Returns true if the operation successfully updates the store; otherwise returns false.
To ensure the change is propagated to any affected external server QMessageServiceAction::exportUpdates() should be subsequently called.
See also addMessage(), removeMessage(), and QMessageServiceAction::exportUpdates().
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 ! |
Copyright © 2000-2012 - www.developpez.com