Client Application Programming

This section explains the important steps that must be followed when programming a message client application.

Basic set-up

A client application performs the following steps in a set-up function, such as the ConstructL() function of the application UI class:

  1. Create a CMsvSession session to Message Server.

  2. Create registry classes, so that MTM components can later be instantiated.

  3. From the session, obtain the root entry of the index, from which other entries can later be obtained.

User interface

Your message client application can now discover the immediate children of the root entry. To display entries to the user in a message or folder view format, the application can query the MTM type of each entry, and load icon resources from the appropriate User Interface MTMs.

After an initial message view display, it is up to the message client application to handle user input events and access User Interface MTMs if required. For example, if the user selects an entry and then chooses an Edit command, the application must:

  • identify the selected entry and set the context to this entry (so it has instances of the generic message header class TMsvEntry and of the message encapsulation class CMsvEntry for the entry)

  • use the data from the TMsvEntry object to discover the MTM type that handles the entry

  • request instances of the relevant Client MTM and User Interface MTM objects from the registries

  • inform the Client MTM of the current context

  • call the EditL() function provided by the User Interface MTM. This returns a CMsvOperation operation object to manage the asynchronous operation.

See the example code for detailed illustration of the above steps.