filemanager/View/inc/CFileManagerIconArray.h
changeset 0 6a9f87576119
equal deleted inserted replaced
-1:000000000000 0:6a9f87576119
       
     1 /*
       
     2 * Copyright (c) 2002-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:  All the files and folders icons are stored here
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CFILEMANAGERICONARRAY_H
       
    21 #define CFILEMANAGERICONARRAY_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CGulIcon;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 /**
       
    31  * Array of icons.
       
    32  * Is an array of icons that is read from resource file.
       
    33  *
       
    34  *  @lib FileManagerView.lib
       
    35  *  @since S60 2.0
       
    36  */
       
    37 class CFileManagerIconArray : public CArrayPtrFlat< CGulIcon >
       
    38     {
       
    39     public:  // Constructors and destructor
       
    40         /**
       
    41          * Two-phased constructor.
       
    42          * @return a new icon array.
       
    43          */
       
    44         IMPORT_C static CFileManagerIconArray* NewL();
       
    45 
       
    46         /**
       
    47          * Destructor.
       
    48          */
       
    49         IMPORT_C ~CFileManagerIconArray();
       
    50 
       
    51         /**
       
    52          * Updates icons.
       
    53          */
       
    54         IMPORT_C void UpdateIconsL();
       
    55 
       
    56         /**
       
    57          * Finds array index of the icon
       
    58          * @param aIconId Icon id
       
    59          * @return Array index of the icon or KErrNotFound
       
    60          */
       
    61         IMPORT_C TInt FindIcon( TInt aIconId );
       
    62 
       
    63         /**
       
    64          * Loads icon from icon file
       
    65          * @param aIconFile Full path of the icon file
       
    66          * @param aIconId Icon id
       
    67          * @param aMaskId Mask id
       
    68          * @param aMajorSkin Major skin id
       
    69          * @param aMinorSkin Minor skin id
       
    70          * @param aIsColorIcon True if color icon
       
    71          * @return Pointer to new icon and the ownership is transferred.
       
    72          */
       
    73         IMPORT_C static CGulIcon* LoadIconL(
       
    74             const TDesC& aIconFile,
       
    75             TInt aIconId,
       
    76             TInt aMaskId,
       
    77             TInt aMajorSkin,
       
    78             TInt aMinorSkin,
       
    79             TBool aIsColorIcon );
       
    80 
       
    81     private:
       
    82         NONSHARABLE_CLASS(TIconInfo)
       
    83             {
       
    84             public:
       
    85                 HBufC* iFile;
       
    86                 TInt iId;
       
    87                 TInt iIconId;
       
    88                 TInt iMaskId;
       
    89                 TInt iMajorSkinId;
       
    90                 TInt iMinorSkinId;
       
    91                 TInt iIconType;
       
    92                 TInt iIndex;
       
    93             };
       
    94         /**
       
    95          * C++ default constructor.
       
    96          */
       
    97         CFileManagerIconArray();
       
    98 
       
    99         /**
       
   100          * By default Symbian 2nd phase constructor is private.
       
   101          */
       
   102         void ConstructL();
       
   103 
       
   104         void LoadIconL( TIconInfo& aInfo );
       
   105 
       
   106         void LoadMandatoryIconsL();
       
   107 
       
   108     private:    // Data
       
   109         RArray< TIconInfo > iIconInfo;
       
   110 
       
   111     };
       
   112 
       
   113 #endif      // CFILEMANAGERICONARRAY_H   
       
   114             
       
   115 // End of File