/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \example serviceactions
    \title Service Actions Example

    This simple example demonstrates how to compose, send, show, query and retrieve messages,
    and also react to message store events using the QtMobility Messaging API.

    Each of these actions is demonstrated in a separate sub example accessible from
    the "File" menu of each platform.

\section1 Send and Compose

    Messages are sent and composed from a composition widget under the "Compose/Send"
    menu. Relevant message details such as sending account, recipients and
    message bodies (attachments for email accounts) can be entered by the user
    via corresponding UI elements. A QMessage is constructed using these details:

    \snippet    ../../demos/serviceactions/mainwindow.cpp construct-message

    The message is then passed to the QMessageService::compose() or QMessageService::send()
    service actions to initiate sending of the message by the platform, or trigger
    display by the platforms' message composer with the QMessage contents:

    \snippet    ../../demos/serviceactions/mainwindow.cpp send-compose-message

\section1 Show

    Messages are displayed by a show widget under the "Show" menu. This widget
    displays the users last 50 messages. (Ensure the platform has one or more messages
    in its mail accounts).

    The last 50 messages (incoming/outgoing) are queried from the store using
    the QMessageService::queryMessages() service request:

    \snippet    ../../demos/serviceactions/mainwindow.cpp load-message

    Once the results of the query are returned via the QMessageService::messagesFound() signal,
    the widget loads each of the returned messages in turn and populates it's list with
    message subjects.

    \snippet    ../../demos/serviceactions/mainwindow.cpp process-results

    \snippet    ../../demos/serviceactions/mainwindow.cpp process-results2

    Selecting "Show" from the action menu will display the selected message using the
    platforms' message viewer via the QMessageService::show() service action.

    \snippet    ../../demos/serviceactions/mainwindow.cpp show-message

\section1 Query and Retrieve

    Message contents are displayed/retrieved by a retrieve widget under the "Query/Retrieve" menu.
    This example displays the last 50 messages, as in the "Show" example, but also displays
    message content in a QTextBrowser widget and provides the option to download messages that are incomplete.

    After the message list is populated, the message display widget will attempt to load
    and display the currently selected message. The completeness of the message body is checked using the
    QMessageContentContainer::isContentAvailable function. If the message body is partially downloaded, a download link
    is displayed.

    \snippet    ../../demos/serviceactions/mainwindow.cpp partial-message-check

    When the download link is clicked, the message body is retrieved using the QMessageService::retrieveBody() service action.

    \snippet    ../../demos/serviceactions/mainwindow.cpp retrieve-message-body

\section1 Store Signals

    This example displays the activities of the QMessageManager in a QListWidget by connecting to QMessageManager::message(Added/Updated/Removed) signals.

    \snippet    ../../demos/serviceactions/mainwindow.cpp store-signals

*/


