commonuis/CommonDialogs/src/CAknFileSelectionModel.h
branchRCL_3
changeset 38 c52421ed5f07
parent 29 a8834a2e9a96
child 55 aecbbf00d063
--- a/commonuis/CommonDialogs/src/CAknFileSelectionModel.h	Wed Jun 09 09:58:37 2010 +0300
+++ b/commonuis/CommonDialogs/src/CAknFileSelectionModel.h	Mon Jun 21 15:57:43 2010 +0300
@@ -29,7 +29,8 @@
 class MAknFileFilter;
 class MAknFileSelectionObserver;
 class CDirectoryLocalizer;
-
+class TResourceReader;
+class TCFDFileTypes;
 
 /**
  *  A model class for file selection dialog. It is derived from
@@ -43,34 +44,7 @@
     {
 
 public:
-
-// Enumerations
-
-    /**
-     * Enumerations for images.
-     */
-    enum TFileTypeIcon
-        {
-        EFolderIcon,
-        EFileIcon,
-        ESubFolderIcon,
-        EThisFolderIcon,
-        EImageFileIcon,
-        EGmsFileIcon,
-        ELinkFileIcon,
-        EVoiceRecFileIcon,
-        ESoundFileIcon,
-        EPlaylistFileIcon,
-        ECompoFileIcon,
-        ENoteFileIcon,
-        EAppFileIcon,
-        EVideoFileIcon,
-        EGameFileIcon,
-        EUnknowTypeIcon,
-        EFolderEmptyIcon,
-        EFlashFileIcon
-        };
-
+    
 // Constructors and destructor
 
     /**
@@ -185,23 +159,47 @@
     CDir* ReadDirectory( const TDesC& aDirectory );
 
     /**
-     * Returns ETrue if a folder contains subfolders.
+     * Test if a folder contains subfolders.
      * @param aFolder Relative folder to current path.
      * @return Returns ETrue if a folder contains subfolders.
      */
     TBool ContainsSubfolders( const TDesC& aFolder );
-
-    void AppendIconForFileL(const TDesC& aFileName);
-
-    TPtrC GetLocalizedName(const TDesC& aFileName);
     
     /**
-     * Returns ETrue if a folder contains files.
+     * Test if a folder contains files.
      * @param aFolder Relative folder to current path.
      * @return Returns ETrue if a folder contains files.
      */
     TBool ContainsFiles( const TDesC& aFolder );
-
+    /**
+     * Test if a folder contains contents.
+     * @param aFolder Relative folder to current path.
+     * @return Returns ETrue if a folder contains contents.
+     */
+    TBool ContainsContents( const TDesC& aFolder, TUint aAttMask );
+    /**
+     * Get the file type icon.
+     * @param aFileName File name to get right icon.
+     * return Return incon index base on the extname of file.
+     */
+    TInt GetIconForFileL( const TDesC& aFileName ) const;
+    /**
+     * Get the file local name.
+     * @param aFileName File name to get its locallize name.
+     * @return Returns file's local name.
+     */
+    TPtrC GetLocalizedName(const TDesC& aFileName);
+    /**
+     * Test if a entry can be added in listbox.
+     * @param aEntry The entry which be added or not.
+     * @return Returns ETrue if a entry can be added.
+     */
+    TBool EntryIsAccepted( const TEntry& aEntry ) const;
+    /**
+     * Read file type and icon index from reader
+     * @param aReader Reader object
+     */
+    void ReadFileExtNameAndIconIndexL( TResourceReader& aReader );
 // Constructors and destructor
 
     void ConstructL();
@@ -216,9 +214,21 @@
 
     // Own: An array of filtered directory entries.
     CArrayPakFlat<TEntry>* iEntryArray;
-
-    // Own: An array for image indices
-    RArray<TInt> iImageIndexArray;
+    
+    /* Own: An array which item has local name of file entry 
+     * with icon index and entry index in iEntryArray
+     * */
+    CDesC16ArraySeg * iLocalFileNameArray;
+    
+    /* Own: An array which item has local name of directory entry 
+     * with icon index and entry index in iEntryArray
+     * */
+    CDesC16ArraySeg * iLocalDirNameArray;
+    
+    /* Own: An array which item has extent name of file entry 
+     * with icon index for the file type
+     * */
+    CArrayFixFlat<TCFDFileTypes>* iFileTypeArray;
 
     // Own: // An array of filters.
     CArrayPtrSeg<MAknFileFilter>* iFilterArray;
@@ -241,14 +251,9 @@
     // Own: Root folder text
     HBufC* iRootFolderText;
 
-    // Own: RApaLsSession for getting mime-types for files:
-    RApaLsSession iApaSession;
-
-    TEntry iFolderEntry;
-
     TParse iParse;
-
-    HBufC * iItemWithImageIndex;
+    // Own: A buffer for using
+    HBufC * iStringBuf;
 
     };