filemanager/Engine/inc/CFileManagerEngine.h
changeset 0 6a9f87576119
child 9 60626d494346
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:  Main class of the File Manager Engine
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CFILEMANAGERENGINE_H
       
    21 #define CFILEMANAGERENGINE_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <badesca.h>
       
    26 #include <f32file.h>
       
    27 #include <AknServerApp.h>
       
    28 #include "MFileManagerProcessObserver.h"
       
    29 #include "FileManagerEngine.hrh"
       
    30 #include "TFileManagerDriveInfo.h"
       
    31 #include "CFileManagerRestoreSettings.h"
       
    32 
       
    33 // CONSTANTS
       
    34 // File Manager engine spcific error codes
       
    35 // defined numbers should be far away from system wide error code numbers
       
    36 const TInt KErrFmgrSeveralFilesInUse    = -4500;
       
    37 const TInt KErrFmgrDefaultFolder        = -4501;
       
    38 const TInt KErrFmgrNotSupportedRemotely = -4502;
       
    39 
       
    40 // FORWARD DECLARATIONS
       
    41 class CGflmNavigatorModel;
       
    42 class CFileManagerItemProperties;
       
    43 class CFileManagerActiveDelete;
       
    44 class CFileManagerActiveSize;
       
    45 class CFileManagerActiveExecute;
       
    46 class CFileManagerRefresher;
       
    47 class CFileManagerFileSystemEvent;
       
    48 class CFileManagerUtils;
       
    49 //class CMGXFileManager;
       
    50 class CFileManagerItemFilter;
       
    51 class CFileManagerRemovableDriveHandler;
       
    52 class CFileManagerRemoteDriveHandler;
       
    53 class CFileManagerDocHandler;
       
    54 class CFileManagerBackupSettings;
       
    55 class CFileManagerRestoreSettings;
       
    56 class CFileManagerActiveRename;
       
    57 class CFileManagerFeatureManager;
       
    58 class MAknServerAppExitObserver;
       
    59 
       
    60 
       
    61 // CLASS DECLARATION
       
    62 /**
       
    63 *  This class implements the main functionalities of File Manager Engine
       
    64 *
       
    65 *  @lib FileManagerEngine.lib
       
    66 *  @since 2.0
       
    67 */
       
    68 NONSHARABLE_CLASS(CFileManagerEngine) : public CBase
       
    69     {
       
    70 
       
    71     public:
       
    72 
       
    73         // Engine state
       
    74         enum TState
       
    75             {
       
    76             ENavigation = 0, // For using navigation list model
       
    77             ESearch // For using search list model
       
    78             };
       
    79 
       
    80         // Sort method
       
    81         enum TSortMethod
       
    82             {
       
    83             EByName = 0,
       
    84             EByType,
       
    85             EMostRecentFirst,
       
    86             ELargestFirst,
       
    87             EByMatch
       
    88             };
       
    89 
       
    90     public:
       
    91         /**
       
    92         * Two-phased constructor.
       
    93         * @param aFs Shareable file server session, see RFs::ShareProtected()
       
    94         * @return Pointer to a CFileManagerEngine instance
       
    95         */
       
    96         IMPORT_C static CFileManagerEngine* NewL( RFs& aFs );
       
    97 
       
    98         /**
       
    99         * Destructor.
       
   100         */
       
   101         IMPORT_C ~CFileManagerEngine();
       
   102 
       
   103     public: // Interface
       
   104     
       
   105         /**
       
   106         * Set currently viewed memory
       
   107         * @since 2.0
       
   108         * @param aMemory The memory type
       
   109         * @return system wide error code
       
   110         */
       
   111         IMPORT_C TInt SetMemoryL( TFileManagerMemory aMemory );
       
   112 
       
   113         /**
       
   114         * Returns the currently viewed memory
       
   115         * @since 2.0
       
   116         * @return TFileManagerMemory, the memory type
       
   117         */
       
   118         IMPORT_C TFileManagerMemory Memory() const;
       
   119 
       
   120         /**
       
   121         * Returns selected views item in array, which ListBox can show
       
   122         * @since 2.0
       
   123         * @return Array of formatted strings of current view
       
   124         */
       
   125         IMPORT_C MDesCArray* FileList() const;
       
   126 
       
   127         /**
       
   128         * Engine signals events with this observer
       
   129         * @since 2.0
       
   130         * @param aObserver The process observer or NULL, ownership is not transferred
       
   131         */
       
   132         IMPORT_C void SetObserver( MFileManagerProcessObserver* aObserver );
       
   133 
       
   134         /**
       
   135         * Returns full path of the current directory
       
   136         * @since 2.0
       
   137         * @return Full path of current directory
       
   138         */
       
   139         IMPORT_C TPtrC CurrentDirectory() const;
       
   140 
       
   141         /**
       
   142         * Returns localized name of the current directory
       
   143         * @since 2.0
       
   144         * @return Full path of current directory
       
   145         */
       
   146         IMPORT_C TPtrC LocalizedNameOfCurrentDirectory() const;
       
   147 
       
   148         /**
       
   149         * This backsteps the navigator to previously visible folder
       
   150         * @since 2.0
       
   151         */
       
   152         IMPORT_C void BackstepL();
       
   153 
       
   154         /**
       
   155         * Returns the type of given item index in CFileManagerItemProperties bitmask
       
   156         * @since 2.0
       
   157         * @param aIndex The index to current view index.
       
   158         * @return CFileManagerItemProperties bitmask
       
   159         */
       
   160         IMPORT_C TUint32 FileTypeL( const TInt aIndex ) const;
       
   161 
       
   162         /**
       
   163         * Returns the type of given item index in CFileManagerItemProperties bitmask
       
   164         * @since 2.0
       
   165         * @param aFullPath  Full path to item which type is needed..
       
   166         * @return CFileManagerItemProperties bitmask
       
   167         */
       
   168         IMPORT_C TUint32 FileTypeL( const TDesC& aFullPath ) const;
       
   169 
       
   170         /**
       
   171         * Delete file(s) or folder, caller should delete the returned object.
       
   172         * @since 2.0
       
   173         * @param aIndexList List of indexes from current directory which is going to be deleted
       
   174         * @return pointer to newly created CFileManagerActiveDelete object
       
   175         */
       
   176         IMPORT_C CFileManagerActiveDelete* CreateActiveDeleteL(
       
   177             CArrayFixFlat< TInt >& aIndexList );
       
   178 
       
   179         /**
       
   180         * Creates a new folder
       
   181         * @since 2.0
       
   182         * @param aFolderName Name of the new folder which is created current directory
       
   183         */
       
   184         IMPORT_C void NewFolderL( const TDesC& aFolderName );
       
   185 
       
   186         /**
       
   187         * Set the current item name
       
   188         * @since 5.0
       
   189         * @param aFileName File name to be set
       
   190         */
       
   191         IMPORT_C void SetCurrentItemName( const TDesC& aFileName );
       
   192         
       
   193         /**
       
   194         * Rename the file or folder.
       
   195         * @since 3.2
       
   196         * @param aIndex index of the file or folder from current directory 
       
   197         * @param aNewFileName name where that file or folder name is changed
       
   198         * @return System wide error code
       
   199         */
       
   200         IMPORT_C void RenameL( const TInt aIndex, const TDesC& aNewFileName );
       
   201 
       
   202         /**
       
   203         * Opens the file or folder
       
   204         * @since 2.0
       
   205         * @param aIndex from the current directory list
       
   206         */
       
   207         IMPORT_C void OpenL( const TInt aIndex );
       
   208 
       
   209         /**
       
   210         * Returns the depth of the current folder
       
   211         * @since 2.0
       
   212         * @return Current depth in folder tree, 0 is root, 1 one folder down
       
   213         */
       
   214         IMPORT_C TInt FolderLevel();
       
   215 
       
   216         /**
       
   217         * Checks from current directory, if the name is found
       
   218         * @since 2.0
       
   219         * @param aString Name which is matched with current directory files and folders
       
   220         * @return ETrue if exists
       
   221         *         EFalse if not exists in current directory
       
   222         */
       
   223         IMPORT_C TBool IsNameFoundL(const TDesC& aString);
       
   224 
       
   225         /**
       
   226         * returns number of the current drive.
       
   227         * @since 2.0
       
   228         * @returns TDriveNumber type, or KErrNotFound if no current drive set
       
   229         */
       
   230         IMPORT_C TInt CurrentDrive();
       
   231 
       
   232         /**
       
   233         * returns info class of the item
       
   234         * @since 2.0
       
   235         * @param aIndex to current directory item
       
   236         * @return class which contains all necessary data for info box, receiver must delete it
       
   237         */
       
   238         IMPORT_C CFileManagerItemProperties* GetItemInfoL( const TInt aIndex );
       
   239 
       
   240         /**
       
   241         * returns info about MMC status
       
   242         * @since 2.0
       
   243         * @return class which contains all necessary data for MMC status
       
   244         */
       
   245         IMPORT_C TFileManagerDriveInfo GetMMCInfoL() const;
       
   246 
       
   247         /**
       
   248         * Sets the state of the engine
       
   249         * @since 2.0
       
   250         * @param aState TState, the state type
       
   251         */
       
   252         IMPORT_C void SetState( TState aState );
       
   253 
       
   254         /**
       
   255         * Gets the state of the engine
       
   256         * @since 2.0
       
   257         * @return TState, the state type
       
   258         */
       
   259         IMPORT_C CFileManagerEngine::TState State() const;
       
   260 
       
   261         /**
       
   262         * Updates the current view
       
   263         * @since 2.0
       
   264         */
       
   265         IMPORT_C void RefreshDirectory();
       
   266 
       
   267         /**
       
   268         * Returns string which was used for finding items
       
   269         * @since 2.0
       
   270         * @return Ref to string 
       
   271         */
       
   272         IMPORT_C TPtrC SearchString() const;
       
   273 
       
   274         /**
       
   275         * Is given file name valid
       
   276         * @since 2.0
       
   277         * @param aDriveAndPath root path
       
   278         * @param aName name of the file
       
   279         * @param aIsFolder ETrue folder and EFalse file name
       
   280         * @return ETrue if file name is valid
       
   281         */
       
   282         IMPORT_C TBool IsValidName(
       
   283             const TDesC& aDriveAndPath,
       
   284             const TDesC& aName,
       
   285             TBool aIsFolder ) const;
       
   286 
       
   287         /**
       
   288         * Check that if given file name contains illegal characters
       
   289         * @since 2.0
       
   290         * @param aName name of the file
       
   291         * @return ETrue if file name is valid
       
   292         */
       
   293         IMPORT_C TBool IllegalChars( const TDesC& aName ) const;
       
   294 
       
   295         /**
       
   296         * Check that there is enough memory to do specific operation
       
   297         * @since 2.0
       
   298         * @param aToFolder Target memory
       
   299         * @param aSize Space needed bytes
       
   300         * @param aOperation Move or Copy
       
   301         * @return ETrue if there is enough space for operation
       
   302         */
       
   303         IMPORT_C TBool EnoughSpaceL(
       
   304             const TDesC& aToFolder,
       
   305             TInt64 aSize,
       
   306             MFileManagerProcessObserver::TFileManagerProcess aOperation ) const;
       
   307 
       
   308         /**
       
   309         * Sets the file system event on or off
       
   310         * @since 2.0
       
   311         * @param aSet   ETrue sets file system event
       
   312         *               EFalse turns events off
       
   313         */
       
   314         IMPORT_C void FileSystemEvent( TBool aEventOn );
       
   315 
       
   316         /**
       
   317         * Returns the current focus index if rename, copy/move or new folder
       
   318         * operation has happened
       
   319         * @since 2.0
       
   320         * @return   index to current focused item, 
       
   321         *           KErrNotFound if not found
       
   322         */
       
   323         IMPORT_C TInt CurrentIndex();
       
   324 
       
   325         /**
       
   326         * returns the file name with full path which is behind given index
       
   327         * @since 2.0
       
   328         * @param aIndex to current directory item
       
   329         * @return HBufC buffer which caller must release after usage
       
   330         */
       
   331         IMPORT_C HBufC* IndexToFullPathL( const TInt aIndex) const; 
       
   332 
       
   333         /**
       
   334         * returns the file name with full path which is behind given index
       
   335         * @since 3.2
       
   336         * @param aIndex to current directory item
       
   337         * @return HBufC buffer which caller must release after usage
       
   338         */
       
   339         IMPORT_C HBufC* IndexToFullPathLC( const TInt aIndex ) const;
       
   340 
       
   341         /**
       
   342         * Checks given item that can it be deleted.
       
   343         * @since 2.0
       
   344         * @param aFullPath full path to item which is checked
       
   345         * @returns ETrue if item can be deleted, EFalse if not
       
   346         */
       
   347         TBool CanDelete( const TDesC& aFullPath ) const;
       
   348 
       
   349         /**
       
   350         * returns localized name of the given item
       
   351         * @since 2.0
       
   352         * @param aFullPath full path to item which is checked
       
   353         * @returns TDesC reference to localized name
       
   354         */
       
   355         IMPORT_C TPtrC LocalizedName( const TDesC& aFullPath ) const;
       
   356 
       
   357         /**
       
   358         * returns the count of files in folder
       
   359         * @since 2.0
       
   360         * @return count of files in folder
       
   361         */
       
   362         IMPORT_C TInt FilesInFolderL();
       
   363 
       
   364         /**
       
   365         * Cancels the refresh operation
       
   366         * @since 2.0
       
   367         * @return   ETrue if refresh process is cancelled, 
       
   368         *           EFalse if there wasn't any refresh process ongoing
       
   369         */
       
   370         IMPORT_C TBool CancelRefresh();
       
   371 
       
   372         /**
       
   373         * Checks given index is it folder, this call is very quick
       
   374         * because it uses icon information to retrieve item type
       
   375         * @since 2.0
       
   376         * @param aIndex index to item 
       
   377         * @return   ETrue item behind the index is folder 
       
   378         *           EFalse item behind the index is not folder
       
   379         */
       
   380         IMPORT_C TBool IsFolder( const TInt aIndex ) const;
       
   381 
       
   382         /**
       
   383         * Notifies about drive added or changed
       
   384         * @since 3.1
       
   385         */
       
   386         void DriveAddedOrChangedL();
       
   387 
       
   388         /**
       
   389         * Notifies about folder content changed
       
   390         * @since 3.2
       
   391         */
       
   392         void FolderContentChangedL();
       
   393 
       
   394         /**
       
   395         * Resolves the icon id of the given item index
       
   396         * @since 2.7
       
   397         * @param aIndex index to item 
       
   398         * @return   Icon id of the item behind the index
       
   399         *           
       
   400         */
       
   401         IMPORT_C TInt IconIdL( const TInt aIndex ) const;
       
   402 
       
   403         /**
       
   404         * Checks is given folder system folder
       
   405         * @since 3.1
       
   406         * @param aFull Full path to item
       
   407         * @return ETrue if folder is system folder, EFalse if not
       
   408         */
       
   409         IMPORT_C TBool IsSystemFolder( const TDesC& aFullPath ) const;
       
   410 
       
   411         /**
       
   412         * Gets current drive name
       
   413         * @since 3.2
       
   414         * @return Drive name
       
   415         */
       
   416         IMPORT_C TPtrC CurrentDriveName();
       
   417 
       
   418         /**
       
   419          * Renames the current drive
       
   420          * @since 3.1
       
   421          * @param aDrive Drive number EDriveA...EDriveZ
       
   422          * @param aName The new name
       
   423          * @return System wide error code
       
   424          */
       
   425         IMPORT_C TInt RenameDrive(
       
   426             const TInt aDrive, const TDesC& aName );
       
   427 
       
   428         /**
       
   429          * Retrieves current drive information
       
   430          * @param aInfo A reference to a TFileManagerDriveInfo object
       
   431          */
       
   432         IMPORT_C void GetDriveInfoL( TFileManagerDriveInfo& aInfo );
       
   433 
       
   434         /**
       
   435          * Sets password on current drive
       
   436          * @since 3.1
       
   437          * @param aDrive Drive number EDriveA...EDriveZ
       
   438          * @param aOld The old password
       
   439          * @param aNew The new password
       
   440          * @return System wide error code
       
   441          */
       
   442         IMPORT_C TInt SetDrivePassword(
       
   443             const TInt aDrive,
       
   444             const TMediaPassword& aOld,
       
   445             const TMediaPassword& aNew );
       
   446 
       
   447         /**
       
   448          * Removes password from current drive
       
   449          * @since 3.1
       
   450          * @param aDrive Drive number EDriveA...EDriveZ
       
   451          * @param aPwd The current password
       
   452          * @return System wide error code
       
   453          */
       
   454         IMPORT_C TInt RemoveDrivePassword(
       
   455             const TInt aDrive,
       
   456             const TMediaPassword& aPwd );
       
   457 
       
   458         /**
       
   459          * Unlocks the current drive
       
   460          * @since 3.1
       
   461          * @param aDrive Drive number EDriveA...EDriveZ
       
   462          * @param aPwd The current password
       
   463          * @return System wide error code
       
   464          */
       
   465         IMPORT_C TInt UnlockDrive(
       
   466             const TInt aDrive,
       
   467             const TMediaPassword& aPwd );
       
   468 
       
   469        /**
       
   470          * Starts format process
       
   471          * @since 3.1
       
   472          * @param aDrive Drive number EDriveA...EDriveZ
       
   473          */
       
   474         IMPORT_C void StartFormatProcessL( const TInt aDrive );
       
   475 
       
   476        /**
       
   477          * Starts eject process
       
   478          * @since 3.2
       
   479          * @param aDrive Drive number EDriveA...EDriveZ
       
   480          */
       
   481         IMPORT_C void StartEjectProcessL( const TInt aDrive );
       
   482 
       
   483         /**
       
   484          * Initiates backup or restore process
       
   485          * @since 3.1
       
   486          * @param aProcess The process to start:
       
   487          *                 EBackupProcess or ERestoreProcess
       
   488          */
       
   489         IMPORT_C void StartBackupProcessL(
       
   490             MFileManagerProcessObserver::TFileManagerProcess aProcess );
       
   491 
       
   492         /**
       
   493          * Cancels ongoing process
       
   494          * @since 3.1
       
   495          * @param aProcess The process to cancel
       
   496          */
       
   497         IMPORT_C void CancelProcess(
       
   498             MFileManagerProcessObserver::TFileManagerProcess aProcess );
       
   499 
       
   500         /**
       
   501          * Get drive state
       
   502          * @since 3.1
       
   503          * @param aState For TFileManagerDriveInfo::TDriveState bits
       
   504          * @param aPath Only drive letter is used
       
   505          * @return System wide error code
       
   506          */
       
   507         IMPORT_C TInt DriveState( TUint32& aState, const TDesC& aPath ) const;
       
   508 
       
   509         /**
       
   510          * Get drive state
       
   511          * @since 3.1
       
   512          * @param aState For TFileManagerDriveInfo::TDriveState bits
       
   513          * @param aDrive
       
   514          * @return System wide error code
       
   515          */
       
   516         IMPORT_C TInt DriveState( TUint32& aState, const TInt aDrive ) const;
       
   517 
       
   518         /**
       
   519          * Determine if given file must be protected (kept on the device)
       
   520          * @since 3.1
       
   521          * @param aFullPath Full path to item
       
   522          * @param aIsProtected The protection status
       
   523          * @return System wide error code
       
   524          */
       
   525         IMPORT_C TInt IsDistributableFile( const TDesC& aFullPath,
       
   526                                            TBool& aIsProtected ) const;
       
   527 
       
   528         /**
       
   529          * Connects or disconnects remote drive
       
   530          * @since 3.1
       
   531          * @param aDrive Drive number EDriveA...EDriveZ
       
   532          * @param aConnect ETrue when connecting, EFalse when disconnecting
       
   533          * @return System wide error code
       
   534          */
       
   535         IMPORT_C TInt SetRemoteDriveConnection(
       
   536             const TInt aDrive, TBool aConnect );
       
   537 
       
   538         /**
       
   539          * Deletes the remote drive settings from remote storage framework
       
   540          * @since 3.1
       
   541          * @param aDrive Drive number EDriveA...EDriveZ
       
   542          * @return System wide error code
       
   543          */
       
   544         IMPORT_C TInt DeleteRemoteDrive( const TInt aDrive );
       
   545 
       
   546         /**
       
   547          * Gets drive root directory
       
   548          * @since 3.1
       
   549          * @param aDrive Drive number EDriveA...EDriveZ
       
   550          * @return Reference to root directory string
       
   551          */
       
   552         IMPORT_C TPtrC DriveRootDirectory( const TInt aDrive ) const;
       
   553 
       
   554         /**
       
   555          * Gets backup settings
       
   556          * @since 3.1
       
   557          * @return Reference to backup settings.
       
   558          */
       
   559         IMPORT_C CFileManagerBackupSettings& BackupSettingsL();
       
   560 
       
   561         /**
       
   562          * Gets restore settings
       
   563          * @since 3.1
       
   564          * @return Reference to restore settings.
       
   565          */
       
   566         IMPORT_C CFileManagerRestoreSettings& RestoreSettingsL();
       
   567 
       
   568         /**
       
   569          * Gets drive name
       
   570          * @since 3.1
       
   571          * @param aDrive Drive that name is required
       
   572          * @return Reference to drive name.
       
   573          */
       
   574         IMPORT_C TPtrC DriveName( const TInt aDrive );
       
   575 
       
   576         /**
       
   577          * Gets drive info
       
   578          * @since 3.1
       
   579          * @param aDrive Drive that info is required
       
   580          * @param aInfo For storing drive info
       
   581          */
       
   582         IMPORT_C void GetDriveInfoL(
       
   583             const TInt aDrive, TFileManagerDriveInfo& aInfo ) const;
       
   584 
       
   585         /**
       
   586          * Gets restore info array
       
   587          * @since 3.1
       
   588          * @param aArray For storing restore info
       
   589          * @param aDrive For getting info from specific drive
       
   590          */
       
   591         IMPORT_C void GetRestoreInfoArrayL(
       
   592             RArray< CFileManagerRestoreSettings::TInfo >& aArray,
       
   593             const TInt aDrive = KErrNotFound ) const;
       
   594 
       
   595         /**
       
   596          * Checks if any ejectable drive is present
       
   597          * @since 3.1
       
   598          * @return ETrue if present, otherwise EFalse
       
   599          */
       
   600         IMPORT_C TBool AnyEjectableDrivePresent() const;
       
   601 
       
   602         /**
       
   603          * Ensures that contents of a directory are up to date
       
   604          * including remote drives when current view is updated
       
   605          * @since 3.1
       
   606          */
       
   607         IMPORT_C void ForcedRefreshDirectory();
       
   608 
       
   609         /**
       
   610          * Calculates the total size of given items
       
   611          * @since 3.2
       
   612          * @param aIndexList List of indexes from current directory
       
   613          * @return Total size
       
   614          */
       
   615         IMPORT_C TInt64 GetFileSizesL(
       
   616             const CArrayFixFlat< TInt >& aIndexList );
       
   617 
       
   618         /**
       
   619          * Gets navigation level, the depth of backstep stack
       
   620          * @since 3.2
       
   621          * @return The navigation level
       
   622          */
       
   623         IMPORT_C TInt NavigationLevel() const;
       
   624 
       
   625         /**
       
   626         * Gets drive name and letter as combined formatted text.
       
   627         * @since 5.0
       
   628         * @param aDrive Drive number EDriveA...EDriveZ
       
   629         * @param aTextIdForDefaultName TextId of default name format string
       
   630         * @param aTextIdForName TextId of name format string
       
   631         * @return Text containing drive letter and name
       
   632         */
       
   633         IMPORT_C HBufC* GetFormattedDriveNameLC(
       
   634             const TInt aDrive,
       
   635             const TInt aTextIdForDefaultName,
       
   636             const TInt aTextIdForName = 0 ) const;
       
   637 
       
   638         /**
       
   639         * Returns info class of the item
       
   640         * @since 5.0
       
   641         * @param aIndex to current directory item
       
   642         * @return class which contains all necessary data for info box, receiver must delete it
       
   643         */
       
   644         IMPORT_C CFileManagerItemProperties* GetItemInfoLC( const TInt aIndex );
       
   645 
       
   646         /**
       
   647         * Sets search string.
       
   648         * @since 3.2
       
   649         * @param aSearchString Search string
       
   650         */
       
   651         IMPORT_C void SetSearchStringL( const TDesC& aSearchString );
       
   652 
       
   653         /**
       
   654         * Sets search folder.
       
   655         * @since 3.2
       
   656         * @param aSearchString Search folder
       
   657         */
       
   658         IMPORT_C void SetSearchFolderL( const TDesC& aSearchFolder );
       
   659 
       
   660         /**
       
   661         * Sets the directory with backsteps.
       
   662         * @since 3.2
       
   663         * @param aDirectory New current directory
       
   664         */
       
   665         IMPORT_C void SetDirectoryWithBackstepsL( const TDesC& aDirectory );
       
   666 
       
   667         /**
       
   668         * Stores current navigation index.
       
   669         * @since 3.2
       
   670         * @param aIndex The index to current view index.
       
   671         */
       
   672         IMPORT_C void SetCurrentIndex( const TInt aIndex );
       
   673 
       
   674         /**
       
   675         * Sets the sort method of the engine
       
   676         * @since 5.0
       
   677         * @param aSortMethod TSortMethod, the sort method type
       
   678         */
       
   679         IMPORT_C void SetSortMethod( TSortMethod aSortMethod );
       
   680 
       
   681         /**
       
   682         * Gets the sort method of the engine
       
   683         * @since 5.0
       
   684         * @return TSortMethod, the sort method type
       
   685         */
       
   686         IMPORT_C CFileManagerEngine::TSortMethod SortMethod() const;
       
   687 
       
   688         /**
       
   689         * Re-sorts the current view
       
   690         * @since 5.0
       
   691         */
       
   692         IMPORT_C void RefreshSort();
       
   693 
       
   694         /**
       
   695         * Gets the feature manager
       
   696         * @since 3.2
       
   697         */
       
   698         IMPORT_C CFileManagerFeatureManager& FeatureManager() const;
       
   699         
       
   700         /**
       
   701         * Set server application exit observer
       
   702         * @Param aObserver The ServerAppExit observer or NULL, ownership is not transferred
       
   703         */
       
   704         IMPORT_C void SetAppExitOb( MAknServerAppExitObserver* aObserver );
       
   705         
       
   706         /**
       
   707         * Deletes the backup archives selected using
       
   708         * CFileManagerRestoreSettings::SetSelection() method.
       
   709         * @since 5.0
       
   710         */
       
   711         IMPORT_C void DeleteBackupsL();
       
   712         
       
   713     public:
       
   714     	
       
   715         /**
       
   716         * Set whether the file is a sis file
       
   717         * @Param aSisFile file is or not a sis file
       
   718         */
       
   719         void SetSisFile( TBool aSisFile );
       
   720         
       
   721         /*
       
   722         * Notice the ServerAppExit event
       
   723         * @Param aReason the reason of the server application exit
       
   724         */
       
   725         void NoticeServerAppExit( TInt aReason );
       
   726         
       
   727         /**
       
   728         * Sets embedded app status
       
   729         * @param aStatus ETrue if embedded app on, EFalse if not
       
   730         */
       
   731         void EmbeddedAppStatus( TBool aStatus );
       
   732 
       
   733         /* MFileManagerWaitNote */
       
   734         void ShowWaitDialogL( MAknBackgroundProcess& aProcess );
       
   735 
       
   736         //CMGXFileManager& MGXFileManagerL();
       
   737 
       
   738         RFs& Fs() const;
       
   739 
       
   740         TBool HasAppRemoteDriveSupport( TUid aUid );
       
   741 
       
   742         TBool IsRemoteDriveConnected( const TInt aDrive  ) const;
       
   743 
       
   744         TBool BackupFileExistsL( const TInt aDrive  ) const;
       
   745 
       
   746         // Ensures that drive info is refreshed on next update
       
   747         void ClearDriveInfo();
       
   748 
       
   749         // Cancels ongoing transfer
       
   750         void CancelTransfer( const TDesC& aFullPath );
       
   751 
       
   752         /**
       
   753         * Gets the latest backup time
       
   754         * @since 5.0
       
   755         * @param aBackupTime Stores the latest backup time
       
   756         * @return System wide error code
       
   757         */
       
   758         TInt LatestBackupTime( TTime& aBackupTime );
       
   759 
       
   760     private:
       
   761         /**
       
   762         * C++ default constructor.
       
   763         */
       
   764         CFileManagerEngine( RFs& aFs );
       
   765 
       
   766         /**
       
   767         * By default Symbian 2nd phase constructor is private.
       
   768         */
       
   769         void ConstructL();
       
   770 
       
   771         // Adds current dir fullpath to given name, returns HBufC buffer which must be released
       
   772         HBufC* AddFullPathLC( const TDesC& aName, const TBool aIsFolder );
       
   773 
       
   774         // Sets file system event watcher for given path
       
   775         void SetFileSystemEventL( const TDesC& aFullPath = KNullDesC );
       
   776 
       
   777         // For checking mount state
       
   778         TInt CheckDriveMountL( TInt aDrive ) const;
       
   779 
       
   780         // For getting drive info
       
   781         void GetDriveInfoL(
       
   782             const TDesC& aPath, TFileManagerDriveInfo& aInfo ) const;
       
   783 
       
   784         // Opens file
       
   785         void OpenFileL( const TDesC& aFullPath );
       
   786 
       
   787         // Opens directory
       
   788         void OpenDirectoryL( const TDesC& aFullPath );
       
   789 
       
   790         // Checks is current drive available
       
   791         TBool CurrentDriveAvailable();
       
   792 
       
   793     private:
       
   794 
       
   795         // Own: General File List Model is used via this object.
       
   796         CGflmNavigatorModel*        iNavigator;
       
   797 
       
   798         // Ref: For file operations
       
   799         RFs&                        iFs;
       
   800 
       
   801         // Normal or search state 
       
   802         TState                      iState;
       
   803 
       
   804         // Own: String which was used in latest search
       
   805         HBufC*                      iSearchString;
       
   806 
       
   807         // Own: String which is used for search process
       
   808         HBufC*                      iSearchProcessString;
       
   809 
       
   810         // Own: AO for async GFLM refresh operation
       
   811         CFileManagerRefresher*      iRefresher;
       
   812 
       
   813         // Ref: Handle to current observer
       
   814         MFileManagerProcessObserver* iProcessObserver;
       
   815 
       
   816         // Own: Handles file system events
       
   817         CFileManagerFileSystemEvent* iFileSystemEvent;
       
   818 
       
   819         // item name of current index, used to search current index
       
   820         TFileName                   iCurrentItemName;
       
   821 
       
   822         // Own: Folder size calculation
       
   823         CFileManagerActiveSize*     iActiveSize;
       
   824 
       
   825         // Own: Checks drive notifications
       
   826         CFileManagerFileSystemEvent* iDiskEvent;
       
   827 
       
   828         // Own: Indicates if embedded application is on
       
   829         TBool iEmbeddedApplicationOn;
       
   830 
       
   831         // Own: MG2 update notification object
       
   832         //CMGXFileManager*            iMgxFileManager;
       
   833 
       
   834         // Own: Compines services of couple classes
       
   835         CFileManagerUtils*          iUtils;
       
   836 
       
   837         // Own: Used for item filtering
       
   838         CFileManagerItemFilter* iItemFilter;
       
   839 
       
   840         // Own: Used for handling memory card etc functinalities
       
   841         CFileManagerRemovableDriveHandler* iRemovableDrvHandler;
       
   842 
       
   843         // Own: Used for handling remote drive functinalities
       
   844         CFileManagerRemoteDriveHandler* iRemoteDrvHandler;
       
   845 
       
   846         // Own: Used for opening files
       
   847         CFileManagerDocHandler* iDocHandler;
       
   848 
       
   849         // Own: Used for backup settings
       
   850         CFileManagerBackupSettings* iBackupSettings;
       
   851 
       
   852         // Own: Used for restore settings
       
   853         CFileManagerRestoreSettings* iRestoreSettings;
       
   854 
       
   855         // Own: Indicates last drive available status
       
   856         TBool iLastDriveAvailable;
       
   857 
       
   858         // Own: Stores current drive info
       
   859         TFileManagerDriveInfo iCurrentDriveInfo;
       
   860 
       
   861         // Own: Indicates if current drive info is refreshed
       
   862         TBool iCurrentDriveInfoRefreshed;
       
   863 
       
   864         // Own: Indicates if wait dialog is on
       
   865         TBool iWaitDialogOn;
       
   866 
       
   867         // Own: Stores drive name
       
   868         HBufC* iDriveName;
       
   869 
       
   870         // Own: Navigation indices
       
   871         RArray< TInt > iNavigationIndices;
       
   872 
       
   873         // Own: Used for rename
       
   874         CFileManagerActiveRename* iActiveRename;
       
   875 
       
   876         // Own: Used for storing search folder
       
   877         HBufC* iSearchFolder;
       
   878 
       
   879         // Own: Indicates file system event status
       
   880         TBool iFileSystemEventEnabled;
       
   881 
       
   882         // Own: Indicates if drive added or changed update is postponed
       
   883         TBool iDriveAddedOrChangedPostponed;
       
   884 
       
   885         // Own: Manages runtime variated features
       
   886         CFileManagerFeatureManager* iFeatureManager;
       
   887         
       
   888         // Ref: Handle to current ServerAppExit observer
       
   889         MAknServerAppExitObserver* iObserver;
       
   890         
       
   891         //Own: Whether the file was a sis type
       
   892         TBool iSisFile;
       
   893     };
       
   894 
       
   895 #endif      // CFILEMANAGERENGINE_H
       
   896             
       
   897 // End of File