taskswitcher/server/inc/tsrunningappmodel.h
changeset 117 c63ee96dbe5f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/taskswitcher/server/inc/tsrunningappmodel.h	Thu Sep 16 12:11:40 2010 +0100
@@ -0,0 +1,77 @@
+/*
+* 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;
+
+NONSHARABLE_CLASS(CTsRunningAppModel) : public CBase, public MTsModel, public MTsDataStorage, public MTsDataObserver
+{
+
+public:
+    static CTsRunningAppModel *NewL(MTsResourceManager &resources, MTsWindowGroupsMonitor &monitor);
+    static CTsRunningAppModel *NewLC(MTsResourceManager &resources, MTsWindowGroupsMonitor &monitor);
+
+    ~CTsRunningAppModel();
+    
+private:
+    CTsRunningAppModel(MTsResourceManager &resources);
+    void ConstructL(MTsResourceManager &resources, MTsWindowGroupsMonitor &monitor);
+
+// MHsDataObserver interface implementation
+public:
+    virtual void DataChanged();    
+    
+// MTsDataStorage interface implementation    
+public:
+    TBool isSupported(TInt function) const;
+    void handleDataL(TInt function, RReadStream& dataStream);
+    
+public:
+    virtual TInt count() const;
+    virtual void setObserver(MTsModelObserver *observer);
+
+public:
+    virtual const TDesC& displayNameL(TInt offset) const;
+    virtual TInt iconHandleL(TInt offset) const;
+    virtual TTime timestampL(TInt offset) const;
+    virtual TTsModelItemKey keyL(TInt offset) const;
+    virtual TBool isActiveL(TInt offset) const;
+    virtual TBool isClosableL(TInt offset) const;
+
+public:
+    virtual TBool closeL(TTsModelItemKey key) const;
+    virtual TBool launchL(TTsModelItemKey key) const;
+    
+private: // owned
+    CTsDataList *mDataList;
+    
+private: // not owned
+    MTsModelObserver *mObserver;
+    CTsScreenshotProvider *mScreenshotProvider;
+    MTsResourceManager &mResources;
+
+};
+
+#endif //TSRUNNINGAPPMODEL_H