filemanager/Engine/inc/CFilemanagerMimeIconArray.h
changeset 0 6a9f87576119
equal deleted inserted replaced
-1:000000000000 0:6a9f87576119
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:  Maps the mime or file extension to icon
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CFILEMANAGERMIMEICONARRAY_H
       
    20 #define CFILEMANAGERMIMEICONARRAY_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "FileManagerEngine.hrh"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CGflmNavigatorModel;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  Contains the array of the icons. Formats the given string with given item.
       
    33 *
       
    34 *  @lib FileManagerEngine.lib
       
    35 *  @since 2.0
       
    36 */
       
    37 NONSHARABLE_CLASS(CFileManagerMimeIconArray) : public CBase
       
    38     {
       
    39     public:
       
    40 
       
    41         /**
       
    42         * Two-phased constructor.
       
    43         * @param aResId resource id of mime icon array
       
    44         * @param aNavigator ref to GFLM navigator
       
    45         * @return pointer to CFileManagerMimeIconArray object
       
    46         */
       
    47         static CFileManagerMimeIconArray* NewL(
       
    48             TInt aResId, CGflmNavigatorModel& aNavigator );
       
    49 
       
    50         /**
       
    51         * Gets the icon id of the item
       
    52         * @since 2.0
       
    53         * @param aFullPath Item with full path information
       
    54         * @return TFileManagerIconId, icon id of the item.
       
    55         *         If not found other icon id is used.
       
    56         */
       
    57         TInt ResolveIconL( const TDesC& aFullPath );
       
    58 
       
    59         /**
       
    60         * Destructor.
       
    61         */
       
    62         ~CFileManagerMimeIconArray();
       
    63 
       
    64     private:
       
    65 
       
    66         /**
       
    67         * C++ default constructor.
       
    68         */
       
    69         CFileManagerMimeIconArray( CGflmNavigatorModel& aNavigator );
       
    70 
       
    71         /**
       
    72         * By default Symbian 2nd phase constructor is private.
       
    73         */
       
    74         void ConstructFromResourceL( TInt aResId );
       
    75 
       
    76         NONSHARABLE_CLASS(CMimeIconEntry) : public CBase
       
    77             {
       
    78             public: // Constructor and destructor
       
    79                 static CMimeIconEntry* NewLC(
       
    80                     const TDesC& aMime, const TInt aIconId );
       
    81 
       
    82                 CMimeIconEntry( const TInt aIconId );
       
    83 
       
    84                 void ConstructL( const TDesC& aMime );
       
    85 
       
    86                 ~CMimeIconEntry();
       
    87             public: // Data
       
    88                 // Own: MIME type string
       
    89                 HBufC* iMime;
       
    90                 // ID of the icon this entry represents.
       
    91                 TInt iIconId;
       
    92 
       
    93             };
       
    94 
       
    95     private: // Data
       
    96         // Own: Array of icons
       
    97         RPointerArray< CMimeIconEntry > iArray;
       
    98 
       
    99         // Ref: To get the current directory and MIME type of the item
       
   100         CGflmNavigatorModel& iNavigator;
       
   101 
       
   102     };
       
   103 
       
   104 #endif      // CFILEMANAGERMIMEICONARRAY_H
       
   105             
       
   106 // End of File