MFileManObserver Class Reference

#include <f32file.h>

Link against: efsrv.lib

class MFileManObserver
Public Member Enumerations
enumTControl { EContinue, ERetry, EAbort, ECancel }
Public Member Functions
virtual IMPORT_C TControlNotifyFileManEnded()
virtual IMPORT_C TControlNotifyFileManOperation()
virtual IMPORT_C TControlNotifyFileManStarted()

Detailed Description

Provides notification of the progress of synchronous or asynchronous file management operations.

It should be inherited by classes which implement this protocol.

The enquiry functions provided by CFileBase and CFileMan may be used by the observer to display information about the progress of the operation such as error messages, the names of the target and destination files, and the number of bytes transferred during a copy operation. Notification may take place before or after an entry has been processed, or during a file copy or move. Each notification function returns a value which can be used to enable the user to control the progress of the operation, for example to cancel a long-running multiple file copy. To use this class, pass a pointer to an instance of the class to the CFileMan constructor, or use SetObserver(), defined in CFileBase.

Member Enumeration Documentation

Enum TControl

Control for the current CFileMan operation.

EnumeratorValueDescription
EContinue

Proceed with the current or the next entry.

ERetry

Retry processing the previous entry.

EAbort

Abort operation, causes function to return KErrCancel.

ECancel

Cancel processing the current entry.

Member Function Documentation

NotifyFileManEnded ( )

IMPORT_C TControlNotifyFileManEnded()[virtual]

Informs the observer that an operation is complete.

This is done immediately after a directory entry has been processed.

It may be useful to call CFileBase::GetLastError() and CFileBase::GetMoreInfoAboutError() from this function to retrieve information about how the operation ended.

See also: CFileBase

Returns: The implementation of this function should return: MFileManObserver::EContinue or MFileManObserver::ECancel, to proceed with processing the next entry. MFileManObserver::ECancel will not cancel processing the current entry; MFileManObserver::ERetry, to re-attempt processing the previous file; MFileManObserver::EAbort, to abort the entire operation. The default return value is MFileManObserver::EContinue.

NotifyFileManOperation ( )

IMPORT_C TControlNotifyFileManOperation()[virtual]

Informs the observer that an operation, i.e. a copy or a move, is proceeding.

Large files are copied and moved in stages. After each portion of the source file has been copied to the target, this function is called.

It may be useful to call CFileMan::BytesTransferredByCopyStep() from this function to retrieve the current status of the operation.

MFileManObserver::EContinue, to continue with the operation. The default return value is MFileManObserver::EContinue.

See also: CFileMan

Returns: The implementation of this function should return: MFileManObserver::ECancel, to cancel the current operation, closing the current source and target files, the current target file is deleted. If the operation is performed on several files, cancelling one will not abort whole batch.

NotifyFileManStarted ( )

IMPORT_C TControlNotifyFileManStarted()[virtual]

Inform the observer that an operation is about to start.

This is done immediately before each entry is processed.

Returns: The implementation of this function should return: MFileManObserver::EContinue, to allow processing of the current file to proceed; MFileManObserver::ECancel, to skip processing the current file and move to the next file; MFileManObserver::EAbort to abort the entire operation. The default return value is MFileManObserver::EContinue.