messagingapp/msgui/conversationview/inc/msgconversationbaseview.h
branchRCL_3
changeset 57 ebe688cedc25
equal deleted inserted replaced
54:fa1df4b99609 57:ebe688cedc25
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:Conversation Base view.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef MSG_CONVERSATION_VIEW_INTERFACE_H
       
    19 #define MSG_CONVERSATION_VIEW_INTERFACE_H
       
    20 
       
    21 #ifdef  CONVERSATIONVIEW_DLL
       
    22 #define CONVERSATION_VIEW_EXPORT Q_DECL_EXPORT
       
    23 #else
       
    24 #define CONVERSATION_VIEW_EXPORT Q_DECL_IMPORT
       
    25 #endif
       
    26 
       
    27 #include <xqsettingskey.h>
       
    28 #include "msgbaseview.h"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class MsgConversationView;
       
    32 class HbListWidgetItem;
       
    33 class MsgContactCardWidget;
       
    34 class QGraphicsLinearLayout;
       
    35 class XQSettingsManager;
       
    36 class XQPublishAndSubscribeUtils;
       
    37 
       
    38 class CONVERSATION_VIEW_EXPORT MsgConversationBaseView: public MsgBaseView
       
    39 {
       
    40 Q_OBJECT
       
    41 
       
    42 public:
       
    43 
       
    44     /**
       
    45      * Constructor
       
    46      */
       
    47     MsgConversationBaseView(QGraphicsItem* parent = 0);
       
    48 
       
    49     /**
       
    50      * Destructor
       
    51      */
       
    52     ~MsgConversationBaseView();
       
    53 
       
    54 public:
       
    55     /**
       
    56      * openConversationView
       
    57      * Launches conversation view
       
    58      * @param entryId, the conversation index to be open
       
    59      *
       
    60      */
       
    61     void openConversation(qint64 entryId);
       
    62 
       
    63     /**
       
    64      * clearContent
       
    65      * Clear conversation view content
       
    66      */
       
    67     void clearContent();
       
    68 
       
    69     /**
       
    70      * saveContentToDrafts
       
    71      * Saves the editors content in cv to drafts
       
    72      * @return valid message id if save is success
       
    73      * else invalid message id ( i.e. -1 )
       
    74      */
       
    75     int saveContentToDrafts();
       
    76 
       
    77     /**
       
    78      * conversationId
       
    79      * Get the conversationId
       
    80      */
       
    81     qint64 conversationId();
       
    82 
       
    83 public slots:
       
    84     /**
       
    85      * Close the conversation view 
       
    86      * This slot is triggered when user presses back(seconday sofykey)
       
    87      */
       
    88     void closeConversationView();
       
    89 
       
    90     /**
       
    91      * Mark messages as read
       
    92      * Slot is triiggered when replying started
       
    93      */
       
    94     void markMessagesAsRead();
       
    95 
       
    96     /**
       
    97      * Publish the conversation id based on the flag.
       
    98      * @param setId if true previous conversation id 
       
    99      * will be published else -1 will be published.
       
   100      */
       
   101     void setPSCVId(bool setId);
       
   102 
       
   103 private slots:
       
   104     /**
       
   105      * Slot for delayed construction
       
   106      */
       
   107     void doDelayedConstruction();
       
   108 
       
   109     /**
       
   110      * Hides chrome when itu-t is up
       
   111      */
       
   112     void hideChrome(bool hide);
       
   113 
       
   114     /**
       
   115      * Slot for handling valid returns from the framework.
       
   116      * 
       
   117      * @param result const QVariant&
       
   118      */
       
   119     void handleOk(const QVariant& result);
       
   120 
       
   121     /**
       
   122      * Slot for handling errors. Error ids are provided as 
       
   123      * 32-bit integers.
       
   124      * @param errorCode qint32
       
   125      */
       
   126     void handleError(int errorCode, const QString& errorMessage);
       
   127 
       
   128     /**
       
   129      * Slot for handling the timer expiry event fired from view reay indication
       
   130      */
       
   131     void handleViewReady();
       
   132 
       
   133     /**
       
   134      *
       
   135      */
       
   136     void handleConversationIdChange(qint64 convId);
       
   137 
       
   138 signals:
       
   139     /**
       
   140      * Signal emitted when the conversation view is closed.
       
   141      */
       
   142     void conversationViewClosed();
       
   143 
       
   144 private:
       
   145     /**
       
   146      * Create and initialise the view
       
   147      */
       
   148     void initView();
       
   149 
       
   150 private:
       
   151 
       
   152     /**
       
   153      * Conversation ID
       
   154      */
       
   155     qint64 mConversationId;
       
   156 
       
   157     /**
       
   158      * MsgConversationView, main view class
       
   159      * Owned
       
   160      */
       
   161     MsgConversationView *mConversationView;
       
   162 
       
   163     /**
       
   164      * Contact card widget.
       
   165      */
       
   166     MsgContactCardWidget* mContactCard;
       
   167 
       
   168     /**
       
   169      * Main layout.
       
   170      */
       
   171     QGraphicsLinearLayout* mMainLayout;
       
   172 
       
   173     /**
       
   174      * Object of XQSettingsKey. 
       
   175      */
       
   176     XQSettingsKey mCVIdkey;
       
   177 
       
   178     /**
       
   179      * mSettingsManager
       
   180      * Instance of the XQSettingsManager
       
   181      * Own.
       
   182      */
       
   183     XQSettingsManager* mSettingsManager;
       
   184 };
       
   185 
       
   186 #endif // MSG_CONVERSATION_VIEW_INTERFACE_H
       
   187 // EOF