Introducing the Messaging Library

As part of the Qt Mobility project, we are introducing the Messaging library. This library enables access to messaging services.

Currently Email, SMS and MMS types of messages are supported by the library. We plan to support other types of messages in the future. Services provided by the message library include searching and sorting messages, sending messages, retrieving message data, and launching the preferred messaging client on the system to either display an existing message, compose a new message, or respond to an existing message.

Like other libraries in the Mobility project, this is a cross platform library that enables access to native services. An implementation for QMF, which was recently introduced here on Qt labs, is mostly complete. A Windows implementation based on MAPI and the Outlook Object Model is about half complete, and unoptimized. Subsequently implementations for Symbian, Windows Mobile, Maemo, and other platforms will be completed.

The code is available on Gitorious, and includes documentation and examples. Qt 4.5 is required to compile the project.

One of the examples included is called 'Keep in touch'. This application demonstrates the searching services provided by the library by finding a list of addresses, and hence people, that messages have not been sent to recently.

Keep in touch example

Predictably the messaging library API contains classes that represent message, message part (MIME/TNEF entities), message address, folder and account objects, additionally identifiers for these objects also exist where appropriate. The API also contains a QMessageServiceAction class, instances of this class, known as 'service actions', can be used to send, retrieve, display and compose messages, with progress information being reported when available.

A QMessageStore singleton class, known as 'the store' is used to access messaging data on the computer. The store and service actions enable retrieval of message, folder and account objects using identifier objects. Identifiers can be retrieved by using the store or service actions to filter and sort messages, folders and accounts stored on the computer. Additionally the store provides Qt signals for detecting the arrival, modification and deletion of messages on the computer.

Messaging API class diagram

Please feel welcome to send your feedback to qtmobility at

Blog Topics: