messagingapp/msgui/msgapp/inc/msgactivityhandler.h
changeset 37 518b245aa84c
child 62 fdbe8253b596
equal deleted inserted replaced
25:84d9eb65b26f 37:518b245aa84c
       
     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:
       
    15  * Handles saving and opening activites. 
       
    16  *
       
    17  */
       
    18 
       
    19 #ifndef MSGACTIVITYHANDLER_H_
       
    20 #define MSGACTIVITYHANDLER_H_
       
    21 
       
    22 #include <QObject>
       
    23 #include <QVariant>
       
    24 
       
    25 class MsgMainWindow;
       
    26 class MsgViewManager;
       
    27 
       
    28 class MsgActivityHandler: public QObject
       
    29 {
       
    30 Q_OBJECT
       
    31 
       
    32 public:
       
    33     /**
       
    34      * Constructor
       
    35      */
       
    36     MsgActivityHandler( QObject* parent = 0);
       
    37                   
       
    38     /**
       
    39      * Destructor.
       
    40      */
       
    41    ~MsgActivityHandler();
       
    42 
       
    43 public slots:
       
    44 
       
    45      /**
       
    46       * Saves the current running activity.
       
    47       */
       
    48     void saveActivity();
       
    49     
       
    50 public:   
       
    51    /** 
       
    52     * Set the message main window pointer.
       
    53     * @param mainWindow message main window.
       
    54     */
       
    55     void setMainWindow(MsgMainWindow* mainWindow);
       
    56    
       
    57     /**
       
    58      * Clears all saved messaging activities. 
       
    59      */
       
    60     void clearActivities();
       
    61     
       
    62     /**
       
    63      * Parses the activity data.
       
    64      * @param activitry data.
       
    65      * @return valid message Id if its editor activity 
       
    66      * else Invalid message id( i.e. -1) for list view activity 
       
    67      */
       
    68     int parseActivityData(const QVariant &activityData);
       
    69     
       
    70 private:
       
    71     /**
       
    72      * main window reference not owned.
       
    73      */
       
    74     MsgMainWindow* mMainWindow;
       
    75 };
       
    76 
       
    77 #endif /* MSGACTIVITYHANDLER_H_ */