taskswitcher/server/inc/tsrunningappmodel.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 04 Oct 2010 00:38:31 +0300
changeset 124 e36b2f4799c0
parent 121 0b3699f6c654
child 125 26079c1bb561
permissions -rw-r--r--
Revision: 201037 Kit: 201039

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/
#ifndef TSRUNNINGAPPMODEL_H
#define TSRUNNINGAPPMODEL_H

#include "tsmodel.h"
#include "tsdatastorage.h"
#include "tsdataobserver.h"

#include "tswindowgroupsobserver.h"

class CTsDataList;
class CTsScreenshotProvider;
class TsEnv;

NONSHARABLE_CLASS(CTsRunningAppModel) : public CBase, 
                                        public MTsModel, 
                                        public MTsDataStorage, 
                                        public MTsDataObserver
{

public:
    static CTsRunningAppModel *NewL( MTsResourceManager &aResources, 
                                     MTsWindowGroupsMonitor &aMonitor,
                                     TsEnv& aEnv );
    static CTsRunningAppModel *NewLC( MTsResourceManager &aResources, 
                                      MTsWindowGroupsMonitor &aMonitor,
                                      TsEnv& aEnv );
    ~CTsRunningAppModel();
    
private:
    CTsRunningAppModel( MTsResourceManager &aResources );
    void ConstructL( MTsResourceManager &aResources, 
                     MTsWindowGroupsMonitor &aMonitor,
                     TsEnv& aEnv);

// MHsDataObserver interface implementation
public:
    virtual void DataChanged();
    
// MTsDataStorage interface implementation    
public:
    TBool IsSupported( TInt aFunction ) const;
    void HandleDataL( TInt aFunction, RReadStream& aDataStream );
    
public:
    virtual TInt Count() const;
    virtual void SetObserver( MTsModelObserver *aObserver );

public:
    virtual const TDesC& DisplayNameL( TInt aOffset ) const;
    virtual TInt IconHandleL( TInt aOffset ) const;
    virtual TTime TimestampL( TInt aOffset ) const;
    virtual TTime TimestampUpdateL(TInt offset) const; 
    virtual TTsModelItemKey KeyL( TInt aOffset ) const;
    virtual TBool IsActiveL( TInt aOffset ) const;
    virtual TBool IsClosableL( TInt aOffset ) const;
    virtual TBool IsMandatoryL( TInt aOffset ) const;

public:
    virtual TBool CloseL( TTsModelItemKey aKey ) const;
    virtual TBool LaunchL( TTsModelItemKey aKey ) const;
    
private: // owned
    CTsDataList *iDataList;
    
private: // not owned
    MTsModelObserver* iObserver;
    CTsScreenshotProvider* iScreenshotProvider;
    MTsResourceManager& iResources;

};

#endif //TSRUNNINGAPPMODEL_H