filemanager/Engine/inc/TFileManagerDriveInfo.h
changeset 0 6a9f87576119
equal deleted inserted replaced
-1:000000000000 0:6a9f87576119
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  Drive info storage
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TFILEMANAGERDRIVEINFO_H
       
    20 #define TFILEMANAGERDRIVEINFO_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include <f32file.h>
       
    25 
       
    26 
       
    27 // CONSTANTS
       
    28 const TInt KMaxVolumeName = 11; // Limited by FAT
       
    29 // Remove these when there is API available for checking
       
    30 const TInt KFmgrSystemDrive = EDriveC;
       
    31 const TInt KFmgrMemoryCardDrive = EDriveE;
       
    32 const TInt KFmgrRomDrive = EDriveZ;
       
    33 const TInt KFmgrRamDrive = EDriveD;
       
    34 
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 class RFs;
       
    38 class CFileManagerEngine;
       
    39 
       
    40 
       
    41 // CLASS DECLARATION
       
    42 /**
       
    43 *  TFileManagerDriveInfo is used for storing drive info
       
    44 *
       
    45 *  @lib FileManagerEngine.lib
       
    46 *  @since 2.0
       
    47 */
       
    48 class TFileManagerDriveInfo
       
    49     {
       
    50     public:
       
    51         /**
       
    52         * C++ default constructor.
       
    53         */
       
    54         IMPORT_C TFileManagerDriveInfo();
       
    55 
       
    56         /**
       
    57         * Resets contents
       
    58         */
       
    59         IMPORT_C void Reset();
       
    60 
       
    61         TBuf< KMaxVolumeName > iName;
       
    62         TInt64 iCapacity;
       
    63         TInt64 iSpaceFree;
       
    64         TUint iUid;
       
    65         TInt iDrive; // EDriveA...EDriveZ
       
    66         // Drive state bits
       
    67         enum TDriveState
       
    68             {
       
    69             EDrivePresent = 0x1,
       
    70             EDriveLocked = 0x2,
       
    71             EDriveCorrupted = 0x4,
       
    72             EDriveWriteProtected = 0x8,
       
    73             EDriveRemovable = 0x10,
       
    74             EDriveRemote = 0x20,
       
    75             EDriveFormattable = 0x40,
       
    76             EDriveFormatted = 0x80,
       
    77             EDriveLockable = 0x100,
       
    78             EDrivePasswordProtected = 0x200,
       
    79             EDriveBackupped = 0x400,
       
    80             EDriveConnected = 0x800,
       
    81             EDriveEjectable = 0x1000,
       
    82             EDriveInUse = 0x2000,
       
    83             EDriveMassStorage = 0x4000,
       
    84             EDriveUsbMemory = 0x8000
       
    85             };
       
    86         TUint32 iState;
       
    87 
       
    88     public:
       
    89         /**
       
    90          * Gets drive info
       
    91          * @since 3.1
       
    92          * @param aEngine Reference to engine
       
    93          * @param aDrive Drive that info is required
       
    94          */
       
    95         void GetInfoL( const CFileManagerEngine& aEngine, const TInt aDrive );
       
    96 
       
    97     private:
       
    98         void CheckMountL( RFs& aFs, const TInt aDrive ) const;
       
    99 
       
   100         TInt FillStateFromDriveInfo(
       
   101             RFs& aFs, const TInt aDrive, const TDriveInfo& aDrvInfo );
       
   102 
       
   103         TInt FillStateFromVolumeInfo( RFs& aFs, const TInt aDrive );
       
   104 
       
   105     };
       
   106 
       
   107 #endif // TFILEMANAGERDRIVEINFO_H
       
   108 
       
   109 // End of File