tstaskmonitor/utils/inc/tsfswentry.h
changeset 94 dbb8300717f7
child 83 156f692b1687
equal deleted inserted replaced
93:82b66994846c 94:dbb8300717f7
       
     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 
       
    25 class CTsFswEntry;
       
    26 class RReadStream;
       
    27 class RWriteStream;
       
    28 class CFbsBitmap;
       
    29 
       
    30 typedef RPointerArray<CTsFswEntry> RTsFswArray;
       
    31 
       
    32 enum TAppType
       
    33 {
       
    34     EApp = 0,
       
    35     EWidget,
       
    36     EJava    
       
    37 };
       
    38 
       
    39 /**
       
    40  * An entry in the task list.
       
    41  */
       
    42 NONSHARABLE_CLASS( CTsFswEntry ) : public CBase
       
    43     {
       
    44 public:
       
    45     static CTsFswEntry* NewL();
       
    46     static CTsFswEntry* NewLC();
       
    47     ~CTsFswEntry();
       
    48 
       
    49     /**
       
    50      * Window group id.
       
    51      * In case of wrt widgets this is negative and is not a valid window group id.
       
    52      * Use this when calling CloseApp or SwitchToApp. (these work with widgets too)
       
    53      */
       
    54     TInt WgId() const;
       
    55     
       
    56     /**
       
    57      * Application uid.
       
    58      */
       
    59     TUid AppUid() const;
       
    60     
       
    61     /**
       
    62      * Application type.
       
    63      */
       
    64     TAppType Type() const;
       
    65     
       
    66     /**
       
    67      * Application name.
       
    68      */
       
    69     const TDesC& AppName() const;    
       
    70     
       
    71     /**
       
    72      * ETrue if the application is closeable
       
    73      */
       
    74     TBool CloseableApp() const;
       
    75     
       
    76     /**
       
    77      * Application icon bitmap
       
    78      */
       
    79     CFbsBitmap* AppIconBitmap() const;
       
    80     
       
    81     /**
       
    82      * Application icon mask.
       
    83      * @see AppIconBitmapHandle
       
    84      */
       
    85     CFbsBitmap* AppIconMask() const;
       
    86 
       
    87 
       
    88     void SetWgId( TInt aWgId );
       
    89     void SetAppUid( const TUid& aUid );
       
    90     void SetAppNameL( const TDesC& aAppName );
       
    91     void SetCloseableApp( TBool aValue );
       
    92     
       
    93     // takes ownership of bitmaps
       
    94     void SetAppIcon( CFbsBitmap* aBitmap, CFbsBitmap* aMask );
       
    95     void ExternalizeL( RWriteStream& aStream );
       
    96     void InternalizeL( RReadStream& aStream );
       
    97 
       
    98     static void ExternalizeArrayL( RWriteStream& aStream,
       
    99         const RTsFswArray& aArray );
       
   100     static void InternalizeArrayL( RReadStream& aStream,
       
   101         RTsFswArray& aArray );
       
   102 
       
   103 private:
       
   104     TInt iWgId;
       
   105     TUid iAppUid;
       
   106     HBufC* iAppName;
       
   107     TBool iCloseableApp;
       
   108     CFbsBitmap* iAppIconBitmap;
       
   109     CFbsBitmap* iAppIconMask;  
       
   110     };
       
   111 
       
   112 #endif