messagingapp/msgui/msgapp/inc/msgviewmanager.h
changeset 37 518b245aa84c
parent 25 84d9eb65b26f
child 46 b1f0785c289d
equal deleted inserted replaced
25:84d9eb65b26f 37:518b245aa84c
    18 
    18 
    19 #ifndef MSGVIEWMANAGER_H_
    19 #ifndef MSGVIEWMANAGER_H_
    20 #define MSGVIEWMANAGER_H_
    20 #define MSGVIEWMANAGER_H_
    21 
    21 
    22 #include <QObject>
    22 #include <QObject>
       
    23 #include <QVariantList>
    23 #include <QVariant>
    24 #include <QVariant>
    24 
    25 
    25 class HbMainWindow;
    26 class HbMainWindow;
    26 class MsgUnifiedEditorView;
    27 class MsgUnifiedEditorView;
    27 class MsgListView;
    28 class MsgListView;
    29 class UnifiedViewer;
    30 class UnifiedViewer;
    30 class MsgBaseView;
    31 class MsgBaseView;
    31 class DraftsListView;
    32 class DraftsListView;
    32 class MsgSettingsView;
    33 class MsgSettingsView;
    33 class HbAction;
    34 class HbAction;
       
    35 class HbView;
       
    36 class MsgAudioFetcherView;
    34 
    37 
    35 class MsgViewManager: public QObject
    38 class MsgViewManager: public QObject
    36 {
    39 {
    37 Q_OBJECT
    40 Q_OBJECT
    38 
    41 
    39 public:
    42 public:
    40     /**
    43     /**
    41      * constructor
    44      * constructor
    42      */
    45      */
    43     MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, QObject* parent = 0);
    46     MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, 
       
    47                    QObject* parent = 0,int activityMsgId = -1);
    44 
    48 
    45     /**
    49     /**
    46      * Destructor.
    50      * Destructor.
    47      */
    51      */
    48     ~MsgViewManager();
    52     ~MsgViewManager();
    81      * Opens the viewer to view the message.
    85      * Opens the viewer to view the message.
    82      * @param msgId message id of the message.
    86      * @param msgId message id of the message.
    83      */
    87      */
    84     void view(int msgId);
    88     void view(int msgId);
    85 
    89 
       
    90     /**
       
    91      * Returns the current active view.
       
    92      */
       
    93     int currentView();
       
    94 	
       
    95     /**
       
    96 	 * Saves the content of editor or Cv to draft.
       
    97 	 */
       
    98     int saveContentToDraft();
    86 private:
    99 private:
    87     /**
   100     /**
    88      * swiches back to last view after service request is complete.
   101      * swiches back to last view after service request is complete.
    89      */
   102      */
    90     void switchToLastSavedView();
   103     void switchToLastSavedView();
   150     /**
   163     /**
   151      * handle provisioning message
   164      * handle provisioning message
   152      * @param msgId message id
   165      * @param msgId message id
   153      */
   166      */
   154     void handleProvisoningMsg(int msgId);
   167     void handleProvisoningMsg(int msgId);
   155 
   168     
       
   169 	/**
       
   170 	* Appends the views to be deleted into a QList to be deleted when view is ready
       
   171 	*/
       
   172     void appendViewToBeDeleted(HbView* view);
       
   173 
       
   174 	 /**
       
   175 	  * Save the editor data to be populated
       
   176 	  * @param editorData QVariantList
       
   177 	  */    
       
   178     void populateUniEditorAfterViewReady(const QVariantList& editorData);
       
   179     
       
   180     /**
       
   181      * Launch Audio fetcher view
       
   182      */
       
   183     void switchToAudioFetcher(const QVariantList& data);
       
   184 	
       
   185 	/**
       
   186 	 * opens unieditor as activity.
       
   187 	 * @param activityMsgId activity msg id.
       
   188 	 */
       
   189 	void openUniEditorActivity(int activityMsgId);
       
   190 
       
   191     /**
       
   192     * find contact id corresponding to given phone no.
       
   193     * @param phoneNum
       
   194     */
       
   195     qint32 findContactId(const QString address);
       
   196     
   156 private slots:
   197 private slots:
   157     /**
   198     /**
   158      * this slot is called on mainwindows back action.
   199      * this slot is called on mainwindows back action.
   159      */
   200      */
   160     void onBackAction();
   201     void onBackAction();
   162     /**
   203     /**
   163      * This slot is called when switchView signal is emitted from a view.
   204      * This slot is called when switchView signal is emitted from a view.
   164      */
   205      */
   165     void switchView(const QVariantList& data);
   206     void switchView(const QVariantList& data);
   166 
   207 
       
   208     /**
       
   209      * This slot is called when viewReady signal is emitted from main window.
       
   210      */
       
   211     void setViewInteractive();
       
   212 
       
   213     /**
       
   214      * Slot to delete previous view instances on view switch
       
   215      */
       
   216     void deletePreviousView();
       
   217 	
       
   218 	/**
       
   219      * This slot is called when delete message dialog is launched.
       
   220      * @param action selected action (yes or no).
       
   221      */	
       
   222     void onDialogDeleteMsg(HbAction* action);
       
   223     
       
   224 	/**
       
   225      * This slot is called when save tone dialog is launched.
       
   226      * @param action selected action (yes or no).
       
   227      */	
       
   228     void onDialogSaveTone(HbAction* action);
       
   229     
       
   230     /**
       
   231      * When this slot is called the saved editor data is set to the editor
       
   232      */
       
   233     void populateUniEditorView();
       
   234 	
   167 private:
   235 private:
   168     /**
   236     /**
   169      * main window reference not owned.
   237      * main window reference not owned.
   170      */
   238      */
   171     HbMainWindow* mMainWindow;
   239     HbMainWindow* mMainWindow;
   177     MsgListView* mListView;
   245     MsgListView* mListView;
   178     MsgConversationBaseView* mConversationView;
   246     MsgConversationBaseView* mConversationView;
   179     UnifiedViewer* mUniViewer;
   247     UnifiedViewer* mUniViewer;
   180     DraftsListView* mDraftsListView;
   248     DraftsListView* mDraftsListView;
   181     MsgSettingsView* mSettingsView;
   249     MsgSettingsView* mSettingsView;
       
   250     MsgAudioFetcherView* mAudioFetcherView;
   182     HbAction* mBackAction;
   251     HbAction* mBackAction;
   183 
   252 
   184     int mPreviousView;
   253     int mPreviousView;
   185     int mCurrentView;
   254     int mCurrentView;
   186     int mViewAtServiceRequest;
   255     int mViewAtServiceRequest;
   187     bool mServiceRequest;
   256     bool mServiceRequest;
   188     qint64 mConversationId;
   257     qint64 mConversationId;
   189     bool mViewServiceRequest;
   258     bool mViewServiceRequest;
       
   259     QList<HbView*> mViewTobeDeleted;
       
   260     HbView* mDummyview;
       
   261     int mMessageId;
       
   262     
       
   263     QVariantList mEditorData;
   190 };
   264 };
   191 
   265 
   192 #endif /* MSGVIEWMANAGER_H_ */
   266 #endif /* MSGVIEWMANAGER_H_ */