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