tstaskmonitor/server/inc/tsfswdatalist.h
changeset 103 b99b84bcd2d1
parent 83 156f692b1687
equal deleted inserted replaced
83:156f692b1687 103:b99b84bcd2d1
    18 
    18 
    19 #ifndef TSFSWDATALIST_H
    19 #ifndef TSFSWDATALIST_H
    20 #define TSFSWDATALIST_H
    20 #define TSFSWDATALIST_H
    21 
    21 
    22 #include <e32base.h>
    22 #include <e32base.h>
    23 #include <apgcli.h>
    23 #include <tswindowgroupsobserver.h>
    24 #include <w32std.h>
       
    25 #include "tsfswentry.h"
    24 #include "tsfswentry.h"
    26 #include "tsdataobserver.h"
    25 #include "tsdataobserver.h"
    27 
    26 
    28 class CApaWindowGroupName;
    27 class CApaWindowGroupName;
    29 class CFbsBitmap;
    28 class CFbsBitmap;
    30 
    29 
    31 /**
    30 /**
    32  * Engine's data list.
    31  * Engine's data list.
    33  */
    32  */
    34 NONSHARABLE_CLASS( CTsFswDataList ) : public CBase
    33 NONSHARABLE_CLASS( CTsFswDataList ) : public CTsWindowGroupsObserver
    35     {
    34     {
    36 public:
    35 public:
    37     /**
    36     /**
    38      * Two-phased constructor.
    37      * Two-phased constructor.
    39      *
    38      */
    40      * @param aParent
    39     static CTsFswDataList* NewL(MTsResourceManager& resources, 
    41      */
    40                                 MTsWindowGroupsMonitor &monitor, 
    42     static CTsFswDataList* NewL(MHsDataObserver& observer);
    41                                 MHsDataObserver& observer);
    43 
    42 
    44     /*
    43     /*
    45      * Destructor
    44      * Destructor
    46      */
    45      */
    47     ~CTsFswDataList();
    46     ~CTsFswDataList();
    48 
    47 
    49 private:
    48 private:
    50     /**
    49     /**
    51      * Constructor.
    50      * Constructor.
    52      */
    51      */
    53     CTsFswDataList(MHsDataObserver& observer);
    52     CTsFswDataList(MTsResourceManager& resources,
       
    53                    MTsWindowGroupsMonitor &monitor, 
       
    54                    MHsDataObserver& observer);
    54 
    55 
    55     /**
    56     /**
    56      * Performs 2nd phase construction.
    57      * Performs 2nd phase construction.
    57      */
    58      */
    58     void ConstructL();
    59     void ConstructL();
    65      * @return  ref to content array
    66      * @return  ref to content array
    66      */
    67      */
    67     const RTsFswArray& FswDataL();
    68     const RTsFswArray& FswDataL();
    68 
    69 
    69     /**
    70     /**
    70      * Gets the window group list and reconstructs the fsw content.
    71      * Interface implementation
    71      * @return   TBool   ETrue if the content iData has been modified
    72      * @see MTsWindowGroupsObserver HandleWindowGroupChanged
    72      */
    73      */
    73     TBool CollectTasksL();
    74     void HandleWindowGroupChanged(MTsResourceManager &,
       
    75                                   const TArray<RWsSession::TWindowGroupChainInfo> &);
    74     
    76     
    75     /**
    77     /**
    76      * Checks if given uid is on hidden list
    78      * Checks if given uid is on hidden list
    77      * @param   aUid uid to be checked
    79      * @param   aUid uid to be checked
    78      * @return  ETrue if uid is on hidden list
    80      * @return  ETrue if uid is on hidden list
    80     TBool IsHiddenUid( TUid uid );
    82     TBool IsHiddenUid( TUid uid );
    81 
    83 
    82     /**
    84     /**
    83      * Set screenshot 
    85      * Set screenshot 
    84      */
    86      */
    85     TBool SetScreenshotL(const CFbsBitmap* bitmap, UpdatePriority priority, TInt wgId);
    87     void SetScreenshotL(const CFbsBitmap* bitmap, UpdatePriority priority, TInt wgId);
    86     
    88     
    87     /**
    89     /**
    88      * Removes screenshot 
    90      * Removes screenshot 
    89      */    
    91      */    
    90     TBool RemoveScreenshotL(TInt wgId);
    92     void RemoveScreenshotL(TInt wgId);
    91     
    93     
    92 private:
    94 private:
    93     /**
    95     /**
    94      * Adds running apps to the list.
    96      * Adds running apps to the list.
    95      * @param   appsList    array to add to
    97      * @param   appsList    array to add to
    96      */
    98      */
    97     void CollectAppsL( RTsFswArray& appsList );
    99     void CollectAppsL(RTsFswArray& appsList,
       
   100                       const TArray<RWsSession::TWindowGroupChainInfo> &wgList);
    98 
   101 
    99     /**
   102     /**
   100      * Called from CollectTasksL for each entry in the task list.
   103      * Called from CollectTasksL for each entry in the task list.
   101      * @param   key       entry key
   104      * @param   key       entry key
   102      * @param   appUid     application uid
   105      * @param   appUid     application uid
   103      * @param   wgName     window group name or NULL
   106      * @param   wgName     window group name or NULL
   104      * @param   newList    list to add to
   107      * @param   newList    list to add to
   105      */
   108      */
   106     void AddEntryL( const TTsEntryKey& key, 
   109     void AddEntryL(const TTsEntryKey& key, 
   107 			const TUid& appUid,
   110                    const TUid& appUid,
   108             CApaWindowGroupName* wgName,
   111                    CApaWindowGroupName* wgName,
   109 			RTsFswArray& newList );
   112                    RTsFswArray& newList );
   110 
   113 
   111     /**
   114     /**
   112      * Checks if there is an entry for same app in the content list.
   115      * Checks if there is an entry for same app in the content list.
   113      * If yes then it takes some of the data for the entry that
   116      * If yes then it takes some of the data for the entry that
   114      * will correspond to the same app in the refreshed content list.
   117      * will correspond to the same app in the refreshed content list.
   133      * Fit existing class contained data list into give one.
   136      * Fit existing class contained data list into give one.
   134      * Data is being changed with application type consideration that is based 
   137      * Data is being changed with application type consideration that is based 
   135      * on aConsiderWidgets param. 
   138      * on aConsiderWidgets param. 
   136      * Function removes or add entries into data depend on given list.
   139      * Function removes or add entries into data depend on given list.
   137      * @param   listToFit          list with actual data  
   140      * @param   listToFit          list with actual data  
   138      * @return  ETrue if change occours on data list, EFalse otherwise   
   141      */
   139      */
   142     void FitDataToList( RTsFswArray& listToFit);
   140     TBool FitDataToListL( RTsFswArray& listToFit);
       
   141 
   143 
   142     /**
   144     /**
   143      * Checks if there is an entry for same app in the given list.
   145      * Checks if there is an entry for same app in the given list.
   144      * @param   entry      entry
   146      * @param   entry      entry
   145      * @param   newList    ref to list
   147      * @param   newList    ref to list
   174     TBool EstablishOrder(const RArray<TTsEntryKey>& keyList);
   176     TBool EstablishOrder(const RArray<TTsEntryKey>& keyList);
   175     
   177     
   176     /**
   178     /**
   177      * Gets allowed uids, tries to filter non GUI application 
   179      * Gets allowed uids, tries to filter non GUI application 
   178      */
   180      */
   179     void GetAllowedUidsL();
   181     TBool VerifyApplicationL(TUid);
   180     
   182     
       
   183     /**
       
   184      * Function generate task key using window group id
       
   185      * @param wgId - window group id of running application
       
   186      * @param entry key 
       
   187      */
       
   188     TTsEntryKey GenerateKeyL(TInt);
       
   189     
       
   190     /**
       
   191      * Analyse and compress lookup table id needed
       
   192      * @param array - lookup table that has to be checked
       
   193      * 
       
   194      */
       
   195     void CompressLookupTable(RArray<TUid> &array);
       
   196     
       
   197     /**
       
   198      * Change priority of an item in the lookup table
       
   199      * @param array - look up table
       
   200      * @param offset - index of an item in the table
       
   201      */
       
   202     void UpdateLookupTableL(RArray<TUid> &array, TInt offset);
   181 
   203 
   182 private:
   204 private:
       
   205     /**
       
   206      * Resource manager. Not own
       
   207      */
       
   208     MTsResourceManager& mResources;
       
   209     
   183     MHsDataObserver &mObserver;
   210     MHsDataObserver &mObserver;
   184     
   211     
   185     RTsFswArray mData; // current fsw content, i.e. the task list
   212     RTsFswArray mData; // current fsw content, i.e. the task list
   186 
   213 
   187     // window server session
       
   188     RWsSession mWsSession;
       
   189 
       
   190     // apparc session
       
   191     RApaLsSession mAppArcSession;
       
   192     
       
   193     // list of hidden uids
   214     // list of hidden uids
   194     RArray<TUid> mHiddenUids;
   215     RArray<TUid> mHiddenUids;
   195     
   216     
   196     // list of allowed uids
   217     // list of allowed uids
   197     RArray<TUid> mAllowedUids;
   218     RArray<TUid> mAllowedUids;