diff -r 3ab5c078b490 -r 0b3699f6c654 taskswitcher/server/inc/tsdatalist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/server/inc/tsdatalist.h Fri Sep 17 08:32:18 2010 +0300 @@ -0,0 +1,95 @@ +/* +* 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 "tswindowgroupsobserver.h" +#include "tsentry.h" +#include "tsdatastorage.h" +#include "tsdataobserver.h" + +class CApaWindowGroupName; +class CFbsBitmap; + +NONSHARABLE_CLASS( CTsDataList ) : public CTsWindowGroupsObserver, + public MTsDataStorage + { +public: + static CTsDataList* NewL( MTsResourceManager& aResources, + MTsWindowGroupsMonitor& aMonitor, + MTsDataObserver& aObserver ); + + ~CTsDataList(); + +private: + CTsDataList( MTsResourceManager& aResources, + MTsWindowGroupsMonitor& aMonitor, + MTsDataObserver& aObserver ); + + void ConstructL(); + +public: + const RTsFswArray& Data() const; + void HandleWindowGroupChanged( MTsResourceManager &, + const TArray & ); + TBool IsHiddenUid( TUid aUid ); + TBool IsSupported(TInt aFunction) const; + void HandleDataL(TInt aFunction,RReadStream& aDataStream); + +private: + void CollectAppsL( RTsFswArray& aAppsList, + const TArray &aWgList ); + void AddEntryL( const TTsEntryKey& aKey, + const TUid& aAppUid, + CApaWindowGroupName* aWgName, + RTsFswArray& aNewList ); + HBufC* FindAppNameLC( CApaWindowGroupName* aWindowName, + const TUid& aAppUid, + TInt aWgId ); + TBool CheckIfExists( const CTsEntry& aEntry, + const RTsFswArray& aNewList ) const; + void RegisterScreenshotL( RReadStream& aDataStream ); + void UnregisterScreenshotL( RReadStream& aDataStream ); + void ChangeVisibilityL( RReadStream& aDataStream ); + void UpdateTaskTimestampL( RReadStream& aDataStream ); + void FitDataToListL( RTsFswArray& aListToFit ); + TBool ConsiderOldDataL( const TTsEntryKey& aKey ); + CFbsBitmap* GetAppIconL( const TUid& aAppUid ); + TInt FindEntry( const RTsFswArray& aList, const TTsEntryKey& aKey ) const; + TBool EstablishOrder( const RArray& aKeyList ); + TTsEntryKey GenerateKeyL( TInt ); + void HideEntryIfNotAllowed( CTsEntry* aEntry ); + TBool UpdateEntryData(const RTsFswArray& aList); + void RebuildVisibleDataListL(); + CFbsBitmap* HbIcon2CFbsBitmap( const HbIcon& aIcon ); + +private: + MTsResourceManager& iResources; + MTsDataObserver &iObserver; + RTsFswArray iData; // current fsw content, i.e. the task list + RTsFswArray iVisibleData; + RArray iHiddenUids/** list of hidden uids */; + CFbsBitmap* iDefaultIcon /** default icon*/; + }; + +#endif //TSDATALIST_H