Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: babackup.h
Link against: bafl.lib

Class CBaBackupSessionWrapper

class CBaBackupSessionWrapper : public CBase;

Description

CBaBackupSessionWrapper provides the APIs necessary to enable a backup or restore/install by allowing broadcast requests for some or all files to either remain untouched or have their locks released for an arbitrary period.

The class should be used by both code driving a backup/install and any engines that will hold files locks or may access files regardless of the presence of (non-system) client apps

Derivation

Members

Defined in CBaBackupSessionWrapper:
CloseAll(), CloseFileL(), DeRegisterBackupOperationObserver(), DeregisterFile(), IsBackupOperationRunning(), NewL(), NotifyBackupOperationL(), RegisterBackupOperationObserverL(), RegisterFileL(), RestartAll(), RestartFile(), ~CBaBackupSessionWrapper()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

static IMPORT_C CBaBackupSessionWrapper *NewL();

Description

Returns a newly created CBaBackupSessionWrapper, passing ownership immediately

Return value

CBaBackupSessionWrapper *


~CBaBackupSessionWrapper()

IMPORT_C ~CBaBackupSessionWrapper();

Description

D'tor. Any files or apps that have been closed will be restarted

[Top]


Member functions


RegisterFileL()

IMPORT_C void RegisterFileL(const TDesC &aFileName, MBackupObserver &aObserver);

Description

aObserver will be called back when the lock state of aFileName should be modified

Parameters

const TDesC &aFileName

MBackupObserver &aObserver


DeregisterFile()

IMPORT_C void DeregisterFile(const TDesC &aFileName);

Description

Stop sending this client requests to alter the lock state of aFileName

Parameters

const TDesC &aFileName


CloseAll()

IMPORT_C void CloseAll(MBackupObserver::TFileLockFlags aFlags, TRequestStatus &aStatus);

Description

Close all non-system apps and signal all registered files to have their locks altered according to aFlags. Returns immediately before having finished all processing. aStatus will be completed when everything is closed or closing has completed. Possible error codes are KErrNoMemory - Not enough memory to signal all apps/files to close KErrServerIsBusy - Another client has some files closed - No-one else should attempt any backup operation KErrInUse - Not all apps were successfully closed In all cases, an undefined number of apps/files may have been closed and backup may still be possible although install/restore operations should not be attempted.

Parameters

MBackupObserver::TFileLockFlags aFlags

TRequestStatus &aStatus


RestartAll()

IMPORT_C void RestartAll();

Description

Opposite of CloseAll. Can safely be called nothing has been closed by this client


CloseFileL()

IMPORT_C void CloseFileL(const TDesC &aFileName, MBackupObserver::TFileLockFlags aFlags);

Description

Close or reduce use of aFileName depending on the state of aFlags. May leave with the following errors KErrNoMemory - Not enough memory to signal the files to close KErrServerIsBusy - Another client has some files closed - No-one else should attempt any backup operation

Parameters

const TDesC &aFileName

MBackupObserver::TFileLockFlags aFlags


RestartFile()

IMPORT_C void RestartFile(const TDesC &aFileName);

Description

Opposite of CloseFileL. Can be safely called if CloseFileL hasn't been called before

Parameters

const TDesC &aFileName


RegisterBackupOperationObserverL()

IMPORT_C void RegisterBackupOperationObserverL(MBackupOperationObserver &aBackupOperationObserver);

Description

Registers the observer aBackupOperationObserver for getting notifications whether a backup or restore operation starts or ends.

Parameters

MBackupOperationObserver &aBackupOperationObserver


DeRegisterBackupOperationObserver()

IMPORT_C void DeRegisterBackupOperationObserver(MBackupOperationObserver &aBackupOperationObserver);

Description

De-registers the observer aBackupOperationObserver for getting notifications whether a backup or restore operation starts or ends.

Parameters

MBackupOperationObserver &aBackupOperationObserver


IsBackupOperationRunning()

IMPORT_C TBool IsBackupOperationRunning() const;

Description

Returns ETrue when either a backup or restore operation is running, otherwise it retunrs EFalse.

Return value

TBool


NotifyBackupOperationL()

IMPORT_C void NotifyBackupOperationL(const TBackupOperationAttributes &aBackupOperationAttributes);

Description

Notifies the server that a backup operation is going to happen.

Parameters

const TBackupOperationAttributes &aBackupOperationAttributes