taskswitcher/server/inc/tsdatalist.h
changeset 116 305818acdca4
child 119 50e220be30d1
equal deleted inserted replaced
112:dbfb5e38438b 116:305818acdca4
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Non-closeable app list class
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TSDATALIST_H
       
    20 #define TSDATALIST_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include <HbIcon>
       
    25 
       
    26 #include "tswindowgroupsobserver.h"
       
    27 #include "tsentry.h"
       
    28 #include "tsdatastorage.h"
       
    29 #include "tsdataobserver.h"
       
    30 
       
    31 class CApaWindowGroupName;
       
    32 class CFbsBitmap;
       
    33 
       
    34 NONSHARABLE_CLASS( CTsDataList ) : public CTsWindowGroupsObserver,
       
    35                                    public MTsDataStorage
       
    36     {
       
    37 public:
       
    38     static CTsDataList* NewL( MTsResourceManager& aResources, 
       
    39                               MTsWindowGroupsMonitor& aMonitor, 
       
    40                               MTsDataObserver& aObserver );
       
    41 
       
    42     ~CTsDataList();
       
    43 
       
    44 private:
       
    45     CTsDataList( MTsResourceManager& aResources,
       
    46                  MTsWindowGroupsMonitor& aMonitor, 
       
    47                  MTsDataObserver& aObserver );
       
    48 
       
    49     void ConstructL();
       
    50 
       
    51 public:
       
    52     const RTsFswArray& Data() const;
       
    53     void HandleWindowGroupChanged( MTsResourceManager &,
       
    54                                    const TArray<RWsSession::TWindowGroupChainInfo> & );
       
    55     TBool IsHiddenUid( TUid aUid );
       
    56     TBool IsSupported(TInt aFunction) const;
       
    57     void HandleDataL(TInt aFunction,RReadStream& aDataStream);
       
    58 
       
    59 private:
       
    60     void CollectAppsL( RTsFswArray& aAppsList,
       
    61                        const TArray<RWsSession::TWindowGroupChainInfo> &aWgList );
       
    62     void AddEntryL( const TTsEntryKey& aKey, 
       
    63                     const TUid& aAppUid,
       
    64                     CApaWindowGroupName* aWgName,
       
    65                     RTsFswArray& aNewList );
       
    66     HBufC* FindAppNameLC( CApaWindowGroupName* aWindowName,
       
    67                           const TUid& aAppUid,
       
    68                           TInt aWgId );
       
    69     TBool CheckIfExists( const CTsEntry& aEntry,
       
    70                          const RTsFswArray& aNewList ) const;
       
    71     void RegisterScreenshotL( RReadStream& aDataStream );
       
    72     void UnregisterScreenshotL( RReadStream& aDataStream );
       
    73     void ChangeVisibilityL( RReadStream& aDataStream );
       
    74     void UpdateTaskTimestampL( RReadStream& aDataStream );
       
    75     void FitDataToListL( RTsFswArray& aListToFit );
       
    76     TBool ConsiderOldDataL( const TTsEntryKey& aKey );
       
    77     CFbsBitmap* GetAppIconL( const TUid& aAppUid );
       
    78     TInt FindEntry( const RTsFswArray& aList, const TTsEntryKey& aKey ) const;
       
    79     TBool EstablishOrder( const RArray<TTsEntryKey>& aKeyList );
       
    80     TTsEntryKey GenerateKeyL( TInt );
       
    81     void HideEntryIfNotAllowed( CTsEntry* aEntry );
       
    82     TBool UpdateEntryData(const RTsFswArray& aList);
       
    83     void RebuildVisibleDataListL();
       
    84     CFbsBitmap* HbIcon2CFbsBitmap( const HbIcon& aIcon );
       
    85 
       
    86 private:
       
    87     MTsResourceManager& iResources;
       
    88     MTsDataObserver &iObserver;
       
    89     RTsFswArray iData; // current fsw content, i.e. the task list
       
    90     RTsFswArray iVisibleData;
       
    91     RArray<TUid> iHiddenUids/** list of hidden uids */;
       
    92     CFbsBitmap* iDefaultIcon /** default icon*/;
       
    93     };
       
    94 
       
    95 #endif //TSDATALIST_H