diff -r 3ab5c078b490 -r c63ee96dbe5f taskswitcher/server/inc/tsdatalist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/server/inc/tsdatalist.h Thu Sep 16 12:11:40 2010 +0100 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2008 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: Non-closeable app list class + * +*/ + + +#ifndef TSDATALIST_H +#define TSDATALIST_H + +#include +#include +#include "tsentry.h" +#include "tsdatastorage.h" +#include "tsdataobserver.h" +#include + +class CApaWindowGroupName; +class CFbsBitmap; + +NONSHARABLE_CLASS( CTsDataList ) : public CTsWindowGroupsObserver, + public MTsDataStorage + { +public: + static CTsDataList* NewL(MTsResourceManager& resources, + MTsWindowGroupsMonitor &monitor, + MTsDataObserver& observer); + + ~CTsDataList(); + +private: + CTsDataList(MTsResourceManager& resources, + MTsWindowGroupsMonitor &monitor, + MTsDataObserver& observer); + + void ConstructL(); + +public: + const RTsFswArray& Data() const; + + void HandleWindowGroupChanged(MTsResourceManager &, + const TArray &); + + TBool IsHiddenUid( TUid uid ); + + TBool isSupported(TInt function) const; + void handleDataL(TInt function,RReadStream& dataStream); + +private: + void registerScreenshotL(RReadStream& dataStream); + void unregisterScreenshotL(RReadStream& dataStream); + void changeVisibilityL(RReadStream& dataStream); + void CollectAppsL(RTsFswArray& appsList, + const TArray &wgList); + + void AddEntryL(const TTsEntryKey& key, + const TUid& appUid, + CApaWindowGroupName* wgName, + RTsFswArray& newList ); + + TBool ConsiderOldDataL( const TTsEntryKey& key ); + + HBufC* FindAppNameLC(CApaWindowGroupName* windowName, + const TUid& appUid, + TInt wgId ); + + void FitDataToList( RTsFswArray& listToFit); + + TBool CheckIfExists(const CTsEntry& entry, + const RTsFswArray& newList) const; + + CFbsBitmap* GetAppIconL(const TUid& aAppUid); + + TInt FindEntry(const RTsFswArray& list, const TTsEntryKey& key ) const; + + TBool EstablishOrder(const RArray& keyList); + + TTsEntryKey GenerateKeyL(TInt); + + void HideEntryIfNotAllowed(CTsEntry* entry); + + TBool UpdateEntryData(const RTsFswArray& list); + + void RebuildVisibleDataListL(); + + CFbsBitmap* HbIcon2CFbsBitmapL(const HbIcon& icon); +private: + /** + * Resource manager. Not own + */ + MTsResourceManager& mResources; + + MTsDataObserver &mObserver; + + RTsFswArray mData; // current fsw content, i.e. the task list + RTsFswArray mVisibleData; + + // list of hidden uids + RArray mHiddenUids; + + // default icon + CFbsBitmap* mDefaultIcon; + }; + +#endif //TSDATALIST_H