diff -r 3ab5c078b490 -r c63ee96dbe5f taskswitcher/server/inc/tsstorage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/server/inc/tsstorage.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 TSSTORAGE_H +#define TSSTORAGE_H +#include + +#include "tsmodel.h" +#include "tsmodelobserver.h" +#include "tsdataobserver.h" +#include "tsdatastorage.h" + +class CTsStorage: public CBase, + public MTsModel, + public MTsModelObserver, + public MTsDataObserver, + public MTsDataStorage +{ +public: + static CTsStorage* NewL(const TArray &dataProviders); + ~CTsStorage(); + +private: + CTsStorage(); + void ConstructL(const TArray &dataProviders); + TInt resetModel(); + void resetModelL(); + void pullDataL(const MTsModel& src); + void reorderDataL(); + +public://from MTsModelObserver + void dataChanged(MTsModel &model); + void dataChanged(const TTsModelItem &item); + +public://from MTsModel + TInt count() const; + void setObserver(MTsModelObserver *observer); + +private://from MTsModel + const TDesC& displayNameL(TInt offset) const; + TInt iconHandleL(TInt offset) const; + TTime timestampL(TInt offset) const; + TTsModelItemKey keyL(TInt offset) const; + TBool isActiveL(TInt offset) const; + TBool isClosableL(TInt offset) const; + TBool closeL(TTsModelItemKey key) const; + TBool launchL(TTsModelItemKey key) const; + TTsModelItem findL(TTsModelItemKey key) const; + +public://from MTsDataObserver + void DataChanged(); + +public://from MTsDataStorage + TBool isSupported(TInt function) const; + void handleDataL(TInt function, RReadStream& dataStream); + +private: + RPointerArray mDataProviders; + RArray mData; + MTsModelObserver* mDataObserver; + +}; + +#endif //TSSTORAGE_H