messagingapp/msgui/conversationview/inc/msgconversationview.h
changeset 37 518b245aa84c
parent 25 84d9eb65b26f
child 38 4e4b6adb1024
equal deleted inserted replaced
25:84d9eb65b26f 37:518b245aa84c
    30 class MsgEditorWidget;
    30 class MsgEditorWidget;
    31 class MsgContactCardWidget;
    31 class MsgContactCardWidget;
    32 class MsgConversationViewItem;
    32 class MsgConversationViewItem;
    33 class HbStaticVkbHost;
    33 class HbStaticVkbHost;
    34 class QGraphicsLinearLayout;
    34 class QGraphicsLinearLayout;
    35 
    35 class HbAction;
    36 //Defines
    36 //Defines
    37 #define INVALID_MSG_ID -1
    37 #define INVALID_MSG_ID -1
    38 
    38 
    39 /**
    39 /**
    40  * This class provides the message chat view for the messaging application.
    40  * This class provides the message chat view for the messaging application.
    64      */
    64      */
    65     void clearEditors();
    65     void clearEditors();
    66 
    66 
    67     /**
    67     /**
    68      * Save the content inside editor to drafts
    68      * Save the content inside editor to drafts
    69      * @return true if save is success else false.
    69      * @return valid message id if save is success
    70      */
    70      * else invalid message id ( i.e. -1 )
    71     bool saveContentToDrafts();
    71      */
       
    72     int saveContentToDrafts();
    72 
    73 
    73 private slots:
    74 private slots:
    74 
    75 
    75     /**
    76     /**
    76      * Slot is called when menu is about to be shown.
    77      * Slot is called when menu is about to be shown.
    77      * Populates the menu with relevant actions.
    78      * Populates the menu with relevant actions.
    78      */
    79      */
    79     void menuAboutToShow();
    80     void menuAboutToShow();
    80 
    81     
       
    82 	/**
       
    83      * This slot is called when settings dialog is launched.
       
    84      * @param action selected action (yes or no).
       
    85      */
       
    86     void onDialogSettingsLaunch(HbAction* action);
       
    87     
       
    88 	/**
       
    89      * This slot is called when delete message centre dialog is launched.
       
    90      * @param action selected action (yes or no).
       
    91      */	
       
    92     void onDialogdeleteMsg(HbAction* action);
       
    93 	
       
    94 	/**
       
    95      * This slot is called when download message centre dialog is launched.
       
    96      * @param action selected action (yes or no).
       
    97      */	    
       
    98     void onDialogDownLoadMsg(HbAction* action);
       
    99 	
       
   100 	/**
       
   101      * This slot is called when save tone dialog is launched.
       
   102      * @param action selected action (yes or no).
       
   103      */	
       
   104     void onDialogSaveTone(HbAction* action);
       
   105 
       
   106     /**
       
   107      * This slot is called when the orientation is changed
       
   108      * @param newOrientation orientation
       
   109      */
       
   110     void onOrientationChanged(Qt::Orientation newOrientation);
       
   111 
       
   112     /**
       
   113      * This slot is called when the orientation is about to bechanged
       
   114      */
       
   115     void onOrientationAboutToBeChanged();
       
   116     
       
   117     /**
       
   118      * This slot is called when the view is successfully added to main window
       
   119      */
       
   120     void onViewReady();
       
   121     
    81 private:
   122 private:
    82 
   123 
    83     /**
   124     /**
    84      * View initialization function.
   125      * View initialization function.
    85      */
   126      */
   103      * @param int sendingstate.
   144      * @param int sendingstate.
   104      * @see ConvergedMessage::MessageType
   145      * @see ConvergedMessage::MessageType
   105      */
   146      */
   106     void setContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState);
   147     void setContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState);
   107 	
   148 	
       
   149     /**
       
   150      * Adds context menu entry to context menu for saving items
       
   151      * @param MsgConversationViewItem* item whose information is needed.
       
   152      * @param HbMenu context menu
       
   153      * @param int sendingstate.
       
   154      * @see ConvergedMessage::MessageType
       
   155      */    
       
   156     void addSaveItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState);
       
   157     
   108     /**
   158     /**
   109      * Adds context menu entry to context menu for Opening items
   159      * Adds context menu entry to context menu for Opening items
   110 	 * @param MsgConversationViewItem* item whose information is needed.
   160 	 * @param MsgConversationViewItem* item whose information is needed.
   111      * @param HbMenu context menu
   161      * @param HbMenu context menu
   112      * @param int sendingstate.
   162      * @param int sendingstate.
   146      * @param MsgConversationViewItem* item whose information is needed.
   196      * @param MsgConversationViewItem* item whose information is needed.
   147      * @param HbMenu context menu    
   197      * @param HbMenu context menu    
   148      * @see ConvergedMessage::MessageType
   198      * @see ConvergedMessage::MessageType
   149      */
   199      */
   150     void addDownloadItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu);
   200     void addDownloadItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu);
   151     
       
   152     /**
       
   153      * Validates if message can be forwarded
       
   154      * @param messageType
       
   155      * @param messageId
       
   156      * @return true if message can be forwarded
       
   157      *         false if message cant be forwarded
       
   158      */
       
   159     bool validateMsgForForward(int &messageType,qint32 &messageId);
       
   160 
   201 
   161     /**
   202     /**
   162      * Launches the BT message display service.
   203      * Launches the BT message display service.
   163      * @param index Index of the item activated/touched
   204      * @param index Index of the item activated/touched
   164      */
   205      */
   175 
   216 
   176     /**
   217     /**
   177      * Utility method to scroll the list to show the bottom most item
   218      * Utility method to scroll the list to show the bottom most item
   178      */
   219      */
   179     void scrollToBottom();
   220     void scrollToBottom();
       
   221     
       
   222     void onConversationViewEmpty();
   180 
   223 
   181     /**
   224     /**
   182      * Handler for long tap of a list item.
   225      * Handler for long tap of a list item.
   183      * @param viewItem  Long tapped view item
   226      * @param viewItem  Long tapped view item
   184      * @param point X and Y co-ordinates of long tap
   227      * @param point X and Y co-ordinates of long tap
   222     /**
   265     /**
   223      * slot to receive fetched contacts for addition
   266      * slot to receive fetched contacts for addition
   224      */
   267      */
   225     void contactsFetched(const QVariant& value);
   268     void contactsFetched(const QVariant& value);
   226 
   269 
   227     /*
       
   228      * Get audio files from audio-fetcher and launch editor
       
   229      */
       
   230     void audiosFetched(const QVariant& result );
       
   231     
       
   232     /**
   270     /**
   233      * slot to receive fetched contacts for vcard addition
   271      * slot to receive fetched contacts for vcard addition
   234      */
   272      */
   235     void contactsFetchedForVCards(const QVariant& value);
   273     void contactsFetchedForVCards(const QVariant& value);
   236     
   274     
   293     /**
   331     /**
   294      * Emitted when editor is tapped to reply.
   332      * Emitted when editor is tapped to reply.
   295      */
   333      */
   296     void replyStarted();
   334     void replyStarted();
   297     
   335     
   298 	/**
   336    /**
   299 	* This signal is emitted when vkb is open.
   337     * This signal is emitted when vkb is open/closed.
   300 	*/
   338     * @param state True if keypad is opened else false.
   301     void hideChrome(bool);
   339     */
       
   340     void vkbOpened(bool state);
   302 
   341 
   303 private slots:
   342 private slots:
   304     /**
   343     /**
   305      * Resizes the view when VKB is opened.
   344      * Resizes the view when VKB is opened.
   306      * This slot is triggered when user taps on the CV editor
   345      * This slot is triggered when user taps on the CV editor
   334 
   373 
   335     /**
   374     /**
   336      * Deactivate Input Blocker
   375      * Deactivate Input Blocker
   337      */
   376      */
   338     void deactivateInputBlocker();
   377     void deactivateInputBlocker();
       
   378     
       
   379     /**
       
   380      * Handle provisioning message
       
   381      * @param msgId message id
       
   382      */
       
   383     void handleProvisoningMsg(int msgId);
   339 
   384 
   340 private:
   385 private:
   341 
   386 
   342     /**
   387     /**
   343      * List to hold the conversations
   388      * List to hold the conversations
   369     /**
   414     /**
   370      * Instance of the main layout.
   415      * Instance of the main layout.
   371      */
   416      */
   372     QGraphicsLinearLayout *mMainLayout;
   417     QGraphicsLinearLayout *mMainLayout;
   373 
   418 
   374 	/**
       
   375 	 * Flag to track if item has been long pressed.
       
   376 	 */
       
   377     bool mItemLongPressed;
       
   378     /*
   419     /*
   379      * Instance of VKB 
   420      * Instance of VKB 
   380      */
   421      */
   381     HbStaticVkbHost* mVkbHost;
   422     HbStaticVkbHost* mVkbHost;
   382     
   423     
   383     /**
   424     /**
   384      * Flag to check it vkb is open.
   425      * Flag to check it vkb is open.
   385      */
   426      */
   386     bool mVkbopened;
   427     bool mVkbopened;
   387 
   428 
       
   429     /**
       
   430      * variable holding the visible model index
       
   431      */
       
   432     QModelIndex mVisibleIndex;
       
   433 
   388 };
   434 };
   389 
   435 
   390 #endif // MSG_CONVERSATION_VIEW_H
   436 #endif // MSG_CONVERSATION_VIEW_H
   391 // EOF
   437 // EOF