#include <babackup.h>
Link against: bafl.lib
class CBaBackupSessionWrapper : public CBase |
Public Member Functions | |
---|---|
~CBaBackupSessionWrapper() | |
IMPORT_C void | CloseAll(MBackupObserver::TFileLockFlags, TRequestStatus &) |
IMPORT_C void | CloseFileL(const TDesC &, MBackupObserver::TFileLockFlags) |
IMPORT_C void | DeRegisterBackupOperationObserver(MBackupOperationObserver &) |
IMPORT_C void | DeregisterFile(const TDesC &) |
IMPORT_C TBool | IsBackupOperationRunning() |
IMPORT_C CBaBackupSessionWrapper * | NewL() |
IMPORT_C void | NotifyBackupOperationL(const TBackupOperationAttributes &) |
IMPORT_C void | RegisterBackupOperationObserverL(MBackupOperationObserver &) |
IMPORT_C void | RegisterFileL(const TDesC &, MBackupObserver &) |
IMPORT_C void | RestartAll() |
IMPORT_C void | RestartFile(const TDesC &) |
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
IMPORT_C | ~CBaBackupSessionWrapper | ( | ) |
D'tor. Any files or apps that have been closed will be restarted
IMPORT_C void | CloseAll | ( | MBackupObserver::TFileLockFlags | aFlags, |
TRequestStatus & | aStatus | |||
) |
Closes 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 KErrServerBusy - Another client has some files closed - No-one else should attempt any backup operation KErrLocked - 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 | |
---|---|
aFlags | the file lock state to request the other clients with. |
aStatus | the request status to be completed when all files have been closed. |
Capability | |
---|---|
WriteDeviceData |
IMPORT_C void | CloseFileL | ( | const TDesC & | aFileName, |
MBackupObserver::TFileLockFlags | aFlags | |||
) |
Close or reduce use of aFileName depending on the state of aFlags.
Parameters | |
---|---|
aFileName | the name of the file to be closed / changed the file lock state. |
Leave Codes | |
---|---|
KErrNoMemory | if not enough memory to signal the files to close. KErrServerIsBusy if another client has some files being closed. |
Capability | |
---|---|
WriteDeviceData |
IMPORT_C void | DeRegisterBackupOperationObserver | ( | MBackupOperationObserver & | aBackupOperationObserver | ) |
De-registers the observer aBackupOperationObserver for getting notifications whether a backup or restore operation starts or ends.
IMPORT_C void | DeregisterFile | ( | const TDesC & | aFileName | ) |
Stop sending this client requests to alter the lock state of aFileName
IMPORT_C TBool | IsBackupOperationRunning | ( | ) | const |
Returns ETrue when either a backup or restore operation is running, otherwise it retunrs EFalse.
IMPORT_C CBaBackupSessionWrapper * | NewL | ( | ) | [static] |
Returns a newly created CBaBackupSessionWrapper, passing ownership immediately
IMPORT_C void | NotifyBackupOperationL | ( | const TBackupOperationAttributes & | aBackupOperationAttributes | ) |
Notifies the server that a backup operation is going to happen.
Capability | |
---|---|
WriteDeviceData |
IMPORT_C void | RegisterBackupOperationObserverL | ( | MBackupOperationObserver & | aBackupOperationObserver | ) |
Registers the observer aBackupOperationObserver for getting notifications whether a backup or restore operation starts or ends.
IMPORT_C void | RegisterFileL | ( | const TDesC & | aFileName, |
MBackupObserver & | aObserver | |||
) |
Register the specified file to the server. The given observer will be called back when the lock state of the file should be modified
Parameters | |
---|---|
aFileName | the name of the file to be observed. |
aObserver | the observer which will be called back when the lock state of the file should be modified. |
Leave Codes | |
---|---|
KErrServerBusy | if the server is busy with the other client or under CloseAll operation. KErrNoMemory if not enough memory to register this file. |
IMPORT_C void | RestartAll | ( | ) |
Opposite of CloseAll. Can safely be called nothing has been closed by this client
Capability | |
---|---|
WriteDeviceData |
IMPORT_C void | RestartFile | ( | const TDesC & | aFileName | ) |
Opposite of CloseFileL. Can be safely called if CloseFileL hasn't been called before
Capability | |
---|---|
WriteDeviceData |