tstaskmonitor/server/inc/tsdatalist.h
changeset 104 9b022b1f357c
equal deleted inserted replaced
103:b99b84bcd2d1 104:9b022b1f357c
       
     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 
       
    28 class CApaWindowGroupName;
       
    29 class CFbsBitmap;
       
    30 
       
    31 NONSHARABLE_CLASS( CTsDataList ) : public CTsWindowGroupsObserver,
       
    32                                    public MTsDataStorage
       
    33     {
       
    34 public:
       
    35     static CTsDataList* NewL(MTsResourceManager& resources, 
       
    36                              MTsWindowGroupsMonitor &monitor, 
       
    37                              MHsDataObserver& observer);
       
    38 
       
    39     ~CTsDataList();
       
    40 
       
    41 private:
       
    42     CTsDataList(MTsResourceManager& resources,
       
    43                 MTsWindowGroupsMonitor &monitor, 
       
    44                 MHsDataObserver& observer);
       
    45 
       
    46     void ConstructL();
       
    47 
       
    48 public:
       
    49     const RTsFswArray& Data() const;
       
    50 
       
    51     void HandleWindowGroupChanged(MTsResourceManager &,
       
    52                                   const TArray<RWsSession::TWindowGroupChainInfo> &);
       
    53 
       
    54     TBool IsHiddenUid( TUid uid );
       
    55 
       
    56     void UpdateL(TInt key,const CFbsBitmap& data, TInt param, TInt priority);
       
    57     
       
    58     void UpdateL(TInt key, const Visibility& data, TInt param);
       
    59 
       
    60     void RemoveL(TInt key, TInt param);
       
    61 
       
    62 private:
       
    63     void CollectAppsL(RTsFswArray& appsList,
       
    64                       const TArray<RWsSession::TWindowGroupChainInfo> &wgList);
       
    65 
       
    66     void AddEntryL(const TTsEntryKey& key, 
       
    67                    const TUid& appUid,
       
    68                    CApaWindowGroupName* wgName,
       
    69                    RTsFswArray& newList );
       
    70 
       
    71     TBool ConsiderOldDataL( const TTsEntryKey& key );
       
    72 
       
    73     HBufC* FindAppNameLC(CApaWindowGroupName* windowName,
       
    74                          const TUid& appUid,
       
    75                          TInt wgId );
       
    76 
       
    77     void FitDataToList( RTsFswArray& listToFit);
       
    78 
       
    79     TBool CheckIfExists(const CTsEntry& entry,
       
    80                         const RTsFswArray& newList) const;
       
    81 
       
    82     void GetAppIconL(const TUid& appUid,
       
    83                      CFbsBitmap*& bitmapArg, 
       
    84                      CFbsBitmap*& maskArg);
       
    85 
       
    86     TInt FindEntry(const RTsFswArray& list, const TTsEntryKey& key ) const;
       
    87 
       
    88     TBool EstablishOrder(const RArray<TTsEntryKey>& keyList);
       
    89 
       
    90     TBool VerifyApplicationL(TUid);
       
    91 
       
    92     TTsEntryKey GenerateKeyL(TInt);
       
    93 
       
    94     void CompressLookupTable(RArray<TUid> &array);
       
    95 
       
    96     void UpdateLookupTableL(RArray<TUid> &array, TInt offset);
       
    97 
       
    98 private:
       
    99     /**
       
   100      * Resource manager. Not own
       
   101      */
       
   102     MTsResourceManager& mResources;
       
   103     
       
   104     MHsDataObserver &mObserver;
       
   105     
       
   106     RTsFswArray mData; // current fsw content, i.e. the task list
       
   107 
       
   108     // list of hidden uids
       
   109     RArray<TUid> mHiddenUids;
       
   110     
       
   111     // list of allowed uids
       
   112     RArray<TUid> mAllowedUids;
       
   113     };
       
   114 
       
   115 #endif //TSDATALIST_H