taskswitcher/server/inc/tsdatalist.h
changeset 117 c63ee96dbe5f
equal deleted inserted replaced
115:3ab5c078b490 117:c63ee96dbe5f
       
     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 #include <tswindowgroupsobserver.h>
       
    24 #include "tsentry.h"
       
    25 #include "tsdatastorage.h"
       
    26 #include "tsdataobserver.h"
       
    27 #include <HbIcon>
       
    28 
       
    29 class CApaWindowGroupName;
       
    30 class CFbsBitmap;
       
    31 
       
    32 NONSHARABLE_CLASS( CTsDataList ) : public CTsWindowGroupsObserver,
       
    33                                    public MTsDataStorage
       
    34     {
       
    35 public:
       
    36     static CTsDataList* NewL(MTsResourceManager& resources, 
       
    37                              MTsWindowGroupsMonitor &monitor, 
       
    38                              MTsDataObserver& observer);
       
    39 
       
    40     ~CTsDataList();
       
    41 
       
    42 private:
       
    43     CTsDataList(MTsResourceManager& resources,
       
    44                 MTsWindowGroupsMonitor &monitor, 
       
    45                 MTsDataObserver& observer);
       
    46 
       
    47     void ConstructL();
       
    48 
       
    49 public:
       
    50     const RTsFswArray& Data() const;
       
    51 
       
    52     void HandleWindowGroupChanged(MTsResourceManager &,
       
    53                                   const TArray<RWsSession::TWindowGroupChainInfo> &);
       
    54 
       
    55     TBool IsHiddenUid( TUid uid );
       
    56 
       
    57     TBool isSupported(TInt function) const;
       
    58     void handleDataL(TInt function,RReadStream& dataStream);
       
    59 
       
    60 private:
       
    61     void registerScreenshotL(RReadStream& dataStream);
       
    62     void unregisterScreenshotL(RReadStream& dataStream);
       
    63     void changeVisibilityL(RReadStream& dataStream);
       
    64     void CollectAppsL(RTsFswArray& appsList,
       
    65                       const TArray<RWsSession::TWindowGroupChainInfo> &wgList);
       
    66 
       
    67     void AddEntryL(const TTsEntryKey& key, 
       
    68                    const TUid& appUid,
       
    69                    CApaWindowGroupName* wgName,
       
    70                    RTsFswArray& newList );
       
    71 
       
    72     TBool ConsiderOldDataL( const TTsEntryKey& key );
       
    73 
       
    74     HBufC* FindAppNameLC(CApaWindowGroupName* windowName,
       
    75                          const TUid& appUid,
       
    76                          TInt wgId );
       
    77 
       
    78     void FitDataToList( RTsFswArray& listToFit);
       
    79 
       
    80     TBool CheckIfExists(const CTsEntry& entry,
       
    81                         const RTsFswArray& newList) const;
       
    82 
       
    83     CFbsBitmap* GetAppIconL(const TUid& aAppUid);
       
    84 
       
    85     TInt FindEntry(const RTsFswArray& list, const TTsEntryKey& key ) const;
       
    86 
       
    87     TBool EstablishOrder(const RArray<TTsEntryKey>& keyList);
       
    88 
       
    89     TTsEntryKey GenerateKeyL(TInt);
       
    90     
       
    91     void HideEntryIfNotAllowed(CTsEntry* entry);
       
    92     
       
    93     TBool UpdateEntryData(const RTsFswArray& list);
       
    94 
       
    95     void RebuildVisibleDataListL();
       
    96     
       
    97     CFbsBitmap* HbIcon2CFbsBitmapL(const HbIcon& icon);
       
    98 private:
       
    99     /**
       
   100      * Resource manager. Not own
       
   101      */
       
   102     MTsResourceManager& mResources;
       
   103     
       
   104     MTsDataObserver &mObserver;
       
   105     
       
   106     RTsFswArray mData; // current fsw content, i.e. the task list
       
   107     RTsFswArray mVisibleData;
       
   108 
       
   109     // list of hidden uids
       
   110     RArray<TUid> mHiddenUids;
       
   111     
       
   112     // default icon
       
   113     CFbsBitmap* mDefaultIcon;
       
   114     };
       
   115 
       
   116 #endif //TSDATALIST_H