tstaskmonitor/utils/inc/tsentry.h
changeset 102 8b8b34fa9751
parent 100 0920c6a9b6c8
child 106 e78d6e055a5b
equal deleted inserted replaced
100:0920c6a9b6c8 102:8b8b34fa9751
     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:  Task list entry
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TSENTRY_H
       
    20 #define TSENTRY_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <e32cmn.h>
       
    24 #include <tsgraphicfilescalinghandler.h>
       
    25 
       
    26 #include "tsentrykey.h"
       
    27 #include "tstaskmonitorglobals.h"
       
    28 
       
    29 class CTsEntry;
       
    30 class RReadStream;
       
    31 class RWriteStream;
       
    32 class CFbsBitmap;
       
    33 class MHsDataObserver;
       
    34 
       
    35 typedef RPointerArray<CTsEntry> RTsFswArray;
       
    36 
       
    37 enum TAppType
       
    38 {
       
    39     EApp = 0,
       
    40     EWidget,
       
    41     EJava
       
    42 };
       
    43 
       
    44 /**
       
    45  * An entry in the task list.
       
    46  */
       
    47 NONSHARABLE_CLASS( CTsEntry ) : public CBase,
       
    48                                 private MImageReadyCallBack
       
    49     {
       
    50 public:
       
    51     static CTsEntry* NewL();
       
    52 
       
    53     static CTsEntry* NewLC();
       
    54 
       
    55     static CTsEntry* NewL(const TTsEntryKey& key, MHsDataObserver* observer =0);
       
    56 
       
    57     static CTsEntry* NewLC(const TTsEntryKey& key, MHsDataObserver* observer =0);
       
    58 
       
    59     ~CTsEntry();
       
    60 
       
    61     TUid AppUid() const;
       
    62 
       
    63     TAppType Type() const;
       
    64 
       
    65     const TDesC& AppName() const;
       
    66 
       
    67     TBool CloseableApp() const;
       
    68 
       
    69     Visibility GetVisibility() const;
       
    70     
       
    71     void SetVisibility(Visibility visibility);
       
    72 
       
    73     CFbsBitmap* AppIconBitmap() const;
       
    74 
       
    75     CFbsBitmap* AppIconMask() const;
       
    76 
       
    77     CFbsBitmap* Screenshot() const;
       
    78 
       
    79     UpdatePriority Priority() const;
       
    80 
       
    81     const TTsEntryKey& Key() const;
       
    82 
       
    83     void SetAppUid( const TUid& uid );
       
    84 
       
    85     void SetAppNameL( const TDesC& appName );
       
    86 
       
    87     void SetCloseableApp( TBool value );
       
    88 
       
    89     void SetScreenshotL(const CFbsBitmap& bitmap, UpdatePriority priority);
       
    90 
       
    91     void RemoveScreenshotL();
       
    92 
       
    93     void SetAppIcon( CFbsBitmap* aBitmap, CFbsBitmap* aMask );
       
    94 
       
    95     void ExternalizeL( RWriteStream& aStream ) const;
       
    96 
       
    97     void InternalizeL( RReadStream& aStream );
       
    98 
       
    99     static void ExternalizeArrayL( RWriteStream& stream,
       
   100         const RTsFswArray& array );
       
   101 
       
   102     static void InternalizeArrayL( RReadStream& stream,
       
   103         RTsFswArray& array );
       
   104 
       
   105 private:
       
   106     CTsEntry();
       
   107 
       
   108     CTsEntry(const TTsEntryKey& aKey, MHsDataObserver* observer);
       
   109 
       
   110     void ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap );
       
   111 
       
   112 private:
       
   113     TUid mAppUid;
       
   114     HBufC* mAppName;
       
   115     TBool mCloseableApp;
       
   116     Visibility mVisibility;
       
   117     CFbsBitmap* mAppIconBitmap;
       
   118     CFbsBitmap* mAppIconMask;
       
   119     CFbsBitmap* mScreenshot;
       
   120     TTsEntryKey mKey;
       
   121     UpdatePriority mPriority;
       
   122     MHsDataObserver* mObserver;
       
   123     CTsGraphicFileScalingHandler* mImgTool;
       
   124     };
       
   125 
       
   126 #endif