diff -r 6a20128ce557 -r ebfee66fde93 messagingapp/msgnotifications/msgnotificationdialogplugin/inc/msgnotificationdialogwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgnotifications/msgnotificationdialogplugin/inc/msgnotificationdialogwidget.h Fri Jun 04 10:25:39 2010 +0100 @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Message notification plugin widget. + * + */ + +#ifndef MSGNOTIFICATIONDIALOGWIDGET_H +#define MSGNOTIFICATIONDIALOGWIDGET_H + +#include +#include +#include +#include +#include +#include + + +/** + * Class for sending service request + */ +class ServiceRequestSenderTask : public QRunnable +{ +public: + /** + * Constructor + */ + ServiceRequestSenderTask(qint64 conversationId); + + /** + * Destructor + */ + ~ServiceRequestSenderTask(); + + /** + * create and send service request + */ + void run(); + +private: + qint64 mConvId; +}; + +/** + * Message notification widget class. + * Widget shown for the new message notifications. + * Part of messagenotificationplugin. + */ +class MsgNotificationDialogWidget : public HbNotificationDialog, + public HbDeviceDialogInterface +{ + Q_OBJECT + +public: + + /** + * Constructor + * @param parameters variant map list + */ + MsgNotificationDialogWidget(const QVariantMap ¶meters); + + /** + * @see HbDeviceDialogInterface + */ + bool setDeviceDialogParameters(const QVariantMap ¶meters); + + /** + * @see HbDeviceDialogInterface + */ + int deviceDialogError() const; + + /** + * @see HbDeviceDialogInterface + */ + void closeDeviceDialog(bool byClient); + + /** + * @see HbDeviceDialogInterface + */ + HbDialog *deviceDialogWidget() const; + +public slots: + /** + * Called when the widget is tapped. + * This launches the conversation view. + */ + void widgetActivated(); + +private: + /** + * Prepares the displaname to be shown in the notification. + * This extracts firsname, lastname, nick name and address + * and prepares the display name. + * @param parameters variant map value list + */ + void prepareDisplayName(const QVariantMap ¶meters); + + /** + * Hide event call back function + * Called when widget is about to hide. Closing effect has ended. + * @param event QHideEvent + */ + void hideEvent(QHideEvent *event); + + /** + * Show event call back function + * Called when widget is about to show + * @param event QShowEvent + */ + void showEvent(QShowEvent *event); + + /** + * Extracts the information and constrcuts the widget + * @param parameters QVariantMap values + */ + bool constructDialog(const QVariantMap ¶meters); +signals: + /** + * Signal emitted when dialog is closed + */ + void deviceDialogClosed(); + + /** + * Device dialog data signal + */ + void deviceDialogData(QVariantMap data); + +private: + Q_DISABLE_COPY(MsgNotificationDialogWidget) + + /** + * Hold the last error + */ + int mLastError; + + /** + * Show event has come or not + */ + bool mShowEventReceived; + + /** + * Current conversation id. + */ + qint64 mConversationId; +}; + +#endif // MSGNOTIFICATIONDIALOGWIDGET_P_H