messagingapp/msgui/msgapp/inc/msgviewmanager.h
changeset 43 35b64624a9e7
parent 34 84197e66a4bd
child 47 5b14749788d7
child 52 12db4185673b
equal deleted inserted replaced
34:84197e66a4bd 43:35b64624a9e7
    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;
    30 class MsgBaseView;
    31 class MsgBaseView;
    31 class DraftsListView;
    32 class DraftsListView;
    32 class MsgSettingsView;
    33 class MsgSettingsView;
    33 class HbAction;
    34 class HbAction;
    34 class HbView;
    35 class HbView;
       
    36 class MsgAudioFetcherView;
    35 
    37 
    36 class MsgViewManager: public QObject
    38 class MsgViewManager: public QObject
    37 {
    39 {
    38 Q_OBJECT
    40 Q_OBJECT
    39 
    41 
    40 public:
    42 public:
    41     /**
    43     /**
    42      * constructor
    44      * constructor
    43      */
    45      */
    44     MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, QObject* parent = 0);
    46     MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, 
       
    47                    QObject* parent = 0,int activityMsgId = -1);
    45 
    48 
    46     /**
    49     /**
    47      * Destructor.
    50      * Destructor.
    48      */
    51      */
    49     ~MsgViewManager();
    52     ~MsgViewManager();
    86 
    89 
    87     /**
    90     /**
    88      * Returns the current active view.
    91      * Returns the current active view.
    89      */
    92      */
    90     int currentView();
    93     int currentView();
    91     
    94 	
       
    95     /**
       
    96 	 * Saves the content of editor or Cv to draft.
       
    97 	 */
       
    98     int saveContentToDraft();
    92 private:
    99 private:
    93     /**
   100     /**
    94      * swiches back to last view after service request is complete.
   101      * swiches back to last view after service request is complete.
    95      */
   102      */
    96     void switchToLastSavedView();
   103     void switchToLastSavedView();
   161     
   168     
   162 	/**
   169 	/**
   163 	* Appends the views to be deleted into a QList to be deleted when view is ready
   170 	* Appends the views to be deleted into a QList to be deleted when view is ready
   164 	*/
   171 	*/
   165     void appendViewToBeDeleted(HbView* view);
   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);
   166     
   196     
   167 private slots:
   197 private slots:
   168     /**
   198     /**
   169      * this slot is called on mainwindows back action.
   199      * this slot is called on mainwindows back action.
   170      */
   200      */
   194 	/**
   224 	/**
   195      * This slot is called when save tone dialog is launched.
   225      * This slot is called when save tone dialog is launched.
   196      * @param action selected action (yes or no).
   226      * @param action selected action (yes or no).
   197      */	
   227      */	
   198     void onDialogSaveTone(HbAction* action);
   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();
   199 	
   234 	
   200 private:
   235 private:
   201     /**
   236     /**
   202      * main window reference not owned.
   237      * main window reference not owned.
   203      */
   238      */
   210     MsgListView* mListView;
   245     MsgListView* mListView;
   211     MsgConversationBaseView* mConversationView;
   246     MsgConversationBaseView* mConversationView;
   212     UnifiedViewer* mUniViewer;
   247     UnifiedViewer* mUniViewer;
   213     DraftsListView* mDraftsListView;
   248     DraftsListView* mDraftsListView;
   214     MsgSettingsView* mSettingsView;
   249     MsgSettingsView* mSettingsView;
       
   250     MsgAudioFetcherView* mAudioFetcherView;
   215     HbAction* mBackAction;
   251     HbAction* mBackAction;
   216 
   252 
   217     int mPreviousView;
   253     int mPreviousView;
   218     int mCurrentView;
   254     int mCurrentView;
   219     int mViewAtServiceRequest;
   255     int mViewAtServiceRequest;
   221     qint64 mConversationId;
   257     qint64 mConversationId;
   222     bool mViewServiceRequest;
   258     bool mViewServiceRequest;
   223     QList<HbView*> mViewTobeDeleted;
   259     QList<HbView*> mViewTobeDeleted;
   224     HbView* mDummyview;
   260     HbView* mDummyview;
   225     int mMessageId;
   261     int mMessageId;
       
   262     
       
   263     QVariantList mEditorData;
   226 };
   264 };
   227 
   265 
   228 #endif /* MSGVIEWMANAGER_H_ */
   266 #endif /* MSGVIEWMANAGER_H_ */