connectivitymodules/SeCon/servers/pcconn/inc/sconfolderlister.h
branchRCL_3
changeset 20 4a793f564d72
parent 18 453dfc402455
equal deleted inserted replaced
19:0aa8cc770c8a 20:4a793f564d72
       
     1 /*
       
     2 * Copyright (c) 2009 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:  CSconFolderLister declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSCONFOLDERLISTER_H
       
    20 #define CSCONFOLDERLISTER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 #include <s32mem.h> // For RMemReadStream
       
    26 #include <f32file.h>
       
    27 // CLASS DECLARATION
       
    28 
       
    29 class TSconDriveInfoEntry
       
    30     {
       
    31 public:
       
    32     TUint8 iDriveType;
       
    33     TUint8 iDriveTypeCount;
       
    34     TInt64 iSize;
       
    35     TInt64 iFree;
       
    36     };
       
    37 
       
    38 class TSconDriveInfo : public TSconDriveInfoEntry
       
    39     {
       
    40 public:
       
    41     TUint iDriveStatus;
       
    42     TBuf16<2> iDriveLetter;
       
    43     TUint iDriveAttr;
       
    44     TBufC<KMaxFileName> iVolumeName;
       
    45     };
       
    46 
       
    47 
       
    48 class CSconFolderEntry : public CBase
       
    49     {
       
    50 public:
       
    51     static CSconFolderEntry* NewLC();
       
    52     static CSconFolderEntry* NewLC( const TEntry& aEntry );
       
    53     ~CSconFolderEntry();
       
    54 private:
       
    55     CSconFolderEntry();
       
    56     void ConstructL( const TEntry& aEntry );
       
    57     
       
    58 public:
       
    59     TUint iAtt;
       
    60     TTime iModified;
       
    61     HBufC *iName;
       
    62     HBufC *iLabel;
       
    63     TBool iDriveInfoEntryExists;
       
    64     TSconDriveInfoEntry iDriveInfoEntry;
       
    65     };
       
    66 
       
    67 
       
    68 class CDirectoryLocalizer;
       
    69 
       
    70 /**
       
    71  *  CSconFolderLister
       
    72  * 
       
    73  */
       
    74 class CSconFolderLister : public CBase
       
    75     {
       
    76 public:
       
    77     // Constructors and destructor
       
    78 
       
    79     /**
       
    80      * Destructor.
       
    81      */
       
    82     ~CSconFolderLister();
       
    83     
       
    84     /**
       
    85      * Two-phased constructor.
       
    86      */
       
    87     static CSconFolderLister* NewL( RFs& aFs );
       
    88     
       
    89     /**
       
    90      * 
       
    91      * @param aStream
       
    92      * @param aStartPath
       
    93      * @param aLevelsToSearch -1 = Search all levels, 0 = Search only current level, 1..N Search N levels
       
    94      */
       
    95     void GenerateFolderListL( RBufWriteStream& aStream, const TDesC& aStartPath, const TInt aLevelsToSearch );
       
    96     
       
    97 private:  
       
    98     
       
    99     void ListAllDrivesL( RBufWriteStream& aStream, const TInt aLevelsToSearch );
       
   100     void ListDriveAndPathL( RBufWriteStream& aStream, TInt aDrive, const TDesC& aStartPath, const TInt aLevelsToSearch );
       
   101     
       
   102     void ExportDriveL( RBufWriteStream& aStream, const TSconDriveInfo& aDriveInfo,
       
   103             const TDesC& aPathName, const TInt aLevelsToSearch );
       
   104     
       
   105     /**
       
   106      * 
       
   107      * @param aStream
       
   108      * @param aPathName
       
   109      */
       
   110     void ExportPathL( RBufWriteStream& aStream, const TDesC& aPathName, 
       
   111             const CSconFolderEntry& aEntry, const TBool aLocalize, const TInt aLevelsToSearch );
       
   112     
       
   113     void GetDriveTypeNumberL( TInt aDrive , TUint driveStatus, TInt& aTypeNumber);
       
   114     
       
   115     /**
       
   116      * Constructor for performing 1st stage construction
       
   117      */
       
   118     CSconFolderLister( RFs& aFs );
       
   119 
       
   120     /**
       
   121      * EPOC default constructor for performing 2nd stage construction
       
   122      */
       
   123     void ConstructL();
       
   124     
       
   125     TBool IsDirectoryPrintable( const TDesC& aParentPath, const TEntry& aFolderEntry );
       
   126     
       
   127     void GetLocalizedVolumeNameL( CSconFolderEntry& aDriveEntry );
       
   128 private:
       
   129     RFs&    iFs;
       
   130     TInt    iFolders;
       
   131     TInt    iFiles;
       
   132     TInt    iCriticalLevel;
       
   133     CDirectoryLocalizer* iLocalizer;
       
   134     };
       
   135 
       
   136 #endif // CSCONFOLDERLISTER_H