tstaskmonitor/utils/inc/tsfswentry.h
changeset 104 9b022b1f357c
parent 103 b99b84bcd2d1
child 105 e7325f632549
child 109 e0aa398e6810
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:  Task list entry
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TSFSWENTRY_H
       
    20 #define TSFSWENTRY_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 CTsFswEntry;
       
    30 class RReadStream;
       
    31 class RWriteStream;
       
    32 class CFbsBitmap;
       
    33 class MHsDataObserver;
       
    34 
       
    35 typedef RPointerArray<CTsFswEntry> 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( CTsFswEntry ) : public CBase,
       
    48                                    private MImageReadyCallBack
       
    49     {
       
    50 public:
       
    51     static CTsFswEntry* NewL();
       
    52     static CTsFswEntry* NewLC();
       
    53     
       
    54     static CTsFswEntry* NewL(const TTsEntryKey& key, MHsDataObserver* observer =0);
       
    55     static CTsFswEntry* NewLC(const TTsEntryKey& key, MHsDataObserver* observer =0);
       
    56     
       
    57     ~CTsFswEntry();
       
    58 
       
    59     /**
       
    60      * Window group id.
       
    61      * In case of wrt widgets this is negative and is not a valid window group id.
       
    62      * Use this when calling CloseApp or SwitchToApp. (these work with widgets too)
       
    63      */
       
    64     TInt WgId() const;
       
    65     
       
    66     /**
       
    67      * Application uid.
       
    68      */
       
    69     TUid AppUid() const;
       
    70     
       
    71     /**
       
    72      * Application type.
       
    73      */
       
    74     TAppType Type() const;
       
    75     
       
    76     /**
       
    77      * Application name.
       
    78      */
       
    79     const TDesC& AppName() const;    
       
    80     
       
    81     /**
       
    82      * ETrue if the application is closeable
       
    83      */
       
    84     TBool CloseableApp() const;
       
    85     
       
    86     /**
       
    87      * Application icon bitmap
       
    88      */
       
    89     CFbsBitmap* AppIconBitmap() const;
       
    90     
       
    91     /**
       
    92      * Application icon mask.
       
    93      */
       
    94     CFbsBitmap* AppIconMask() const;
       
    95     
       
    96     /**
       
    97      * Application screenshot.
       
    98      */
       
    99     CFbsBitmap* Screenshot() const;
       
   100     
       
   101     /**
       
   102      * Priority.
       
   103      */
       
   104     UpdatePriority Priority() const;
       
   105     
       
   106     /**
       
   107      * Entry's key
       
   108      */
       
   109     const TTsEntryKey& Key() const;
       
   110 
       
   111 
       
   112     void SetWgId( TInt wgId );
       
   113     void SetAppUid( const TUid& uid );
       
   114     void SetAppNameL( const TDesC& appName );
       
   115     void SetCloseableApp( TBool value );
       
   116     void SetScreenshotL(const CFbsBitmap* bitmap, UpdatePriority priority);
       
   117     void RemoveScreenshotL();
       
   118     
       
   119     // takes ownership of bitmaps
       
   120     void SetAppIcon( CFbsBitmap* aBitmap, CFbsBitmap* aMask );
       
   121     void ExternalizeL( RWriteStream& aStream );
       
   122     void InternalizeL( RReadStream& aStream );
       
   123 
       
   124     static void ExternalizeArrayL( RWriteStream& aStream,
       
   125         const RTsFswArray& aArray );
       
   126     static void InternalizeArrayL( RReadStream& aStream,
       
   127         RTsFswArray& aArray );
       
   128 
       
   129 private:
       
   130     //constructors
       
   131     CTsFswEntry();
       
   132     CTsFswEntry(const TTsEntryKey& aKey, MHsDataObserver* observer);
       
   133     void ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap );
       
   134     
       
   135 private:
       
   136     TInt mWgId;
       
   137     TUid mAppUid;
       
   138     HBufC* mAppName;
       
   139     TBool mCloseableApp;
       
   140     CFbsBitmap* mAppIconBitmap;
       
   141     CFbsBitmap* mAppIconMask;
       
   142     CFbsBitmap* mScreenshot;
       
   143     TTsEntryKey mKey;
       
   144     UpdatePriority mPriority;
       
   145     MHsDataObserver* mObserver;
       
   146     CTsGraphicFileScalingHandler* mImgTool;
       
   147     };
       
   148 
       
   149 #endif