CWidgetInstaller Class Reference

class CWidgetInstaller : public CBase

This class handles the install.

WidgetBackupRestore.exe
Since
3.1

Inherits from

Public Member Functions
~CWidgetInstaller ()
IMPORT_C void DeregisterWidgetL (const TUid &)
IMPORT_C void FinishInstallL ( TInt )
IMPORT_C void InstallL ( TDesC16 &)
IMPORT_C CWidgetInstaller * NewL ()
void NotifyCompletionL ( TInt )
IMPORT_C void RegisterWidgetL (const TDesC &, const TDesC &, const TDesC &, const TDesC &, const TUid &)
IMPORT_C TInt RenameIconFile ( RFs &, RPointerArray < CWidgetPropertyValue > *)
IMPORT_C TInt RunError ( TInt )
IMPORT_C RPointerArray < CWidgetPropertyValue > * WidgetPropertiesFromInstalledWidgetL ( RFs &, const TDesC &, const TDesC &, TUid )
Private Member Functions
CWidgetInstaller ()
void BackupL ()
void ConstructL ()
void ConvertIconL ( TUid &, const TDesC &)
TInt DriveInfo ( TInt , TInt64 &)
void FixWidgetPropsL ()
TInt GetDirSizeL (const TDesC &)
TInt PreprocessWidgetBundleL ( TDesC &)
void ProcessRestoreDirL ( TDesC &)
void RestoreL ()
TInt SearchByExtL (const TDesC &, TUint , const TDesC &, TFileName &)
TInt SearchWidgetRootL (const TDesC &, TFileName &)
TBool SetDriveAndCheckSpaceL ()
void UpdateWidgetBasePathL ( TDriveUnit &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
CWidgetRegistrationManager * iAppManager
TFileName iBackupDir
TFileName iBundleRootName
CFileMan * iFileMgr
TFileName iOriginalDir
TBool iOverwriting
RPointerArray < CWidgetPropertyValue > iPropertyValues
RWidgetRegistryClientSession iRegistry
RFs iRfs
TBool iServerConnected
CWidgetConfigHandler * iWidgetConfigHandler

Constructor & Destructor Documentation

CWidgetInstaller()

CWidgetInstaller ( ) [private]

C++ default constructor.

~CWidgetInstaller()

~CWidgetInstaller ( ) [virtual]

Destructor.

Member Functions Documentation

BackupL()

void BackupL ( ) [private]
When overwriting an installed widget, backup so can restore on error
Since
3.2

ConstructL()

void ConstructL ( ) [private]

2nd phase constructor.

ConvertIconL(TUid &, const TDesC &)

void ConvertIconL ( TUid & aUid,
const TDesC & aIconPath
) [private]

ConvertIconL Specific to WidgetPreInstaller converts Icon.png to mbm 5.0

Parameters

TUid & aUid
const TDesC & aIconPath

DeregisterWidgetL(const TUid &)

IMPORT_C void DeregisterWidgetL ( const TUid & aUid )
Since
5.0

Parameters

const TUid & aUid

DriveInfo(TInt, TInt64 &)

TInt DriveInfo ( TInt aDrive,
TInt64 & aDiskSpace
) [private]

Parameters

TInt aDrive
TInt64 & aDiskSpace

FinishInstallL(TInt)

IMPORT_C void FinishInstallL ( TInt aErr )

Called when installation or update is finished, do the final steps of registration, file clean up (remove temporary files, display complete message. Or handle error.

Parameters

TInt aErr

FixWidgetPropsL()

void FixWidgetPropsL ( ) [private]
Fix the widget properties need to restore from the backup
Since
5.0

GetDirSizeL(const TDesC &)

TInt GetDirSizeL ( const TDesC & aDir ) [private]

Parameters

const TDesC & aDir

InstallL(TDesC16 &)

IMPORT_C void InstallL ( TDesC16 & aRestoreDir )
Handle install request.
Since
3.1

Parameters

TDesC16 & aRestoreDir

NewL()

IMPORT_C CWidgetInstaller * NewL ( ) [static]

Two-phased constructor.

NotifyCompletionL(TInt)

void NotifyCompletionL ( TInt aErr )
Used for notify icon convertion complete
Since
5.0

Parameters

TInt aErr

PreprocessWidgetBundleL(TDesC &)

TInt PreprocessWidgetBundleL ( TDesC & aRestoreDir ) [private]
Create widget entry by parsing the info.plist, insert the entry into the entry list if the entry is not already existing.
Since
3.1

Parameters

TDesC & aRestoreDir

ProcessRestoreDirL(TDesC &)

void ProcessRestoreDirL ( TDesC & aRestoreDir ) [private]

Parameters

TDesC & aRestoreDir

RegisterWidgetL(const TDesC &, const TDesC &, const TDesC &, const TDesC &, const TUid &)

IMPORT_C void RegisterWidgetL ( const TDesC & aMainHTML,
const TDesC & aBundleDisplayName,
const TDesC & aIconPath,
const TDesC & aDriveName,
const TUid & aUid
)
Since
5.0

Parameters

const TDesC & aMainHTML
const TDesC & aBundleDisplayName
const TDesC & aIconPath
const TDesC & aDriveName
const TUid & aUid

RenameIconFile(RFs &, RPointerArray< CWidgetPropertyValue > *)

IMPORT_C TInt RenameIconFile ( RFs & aFs,
RPointerArray < CWidgetPropertyValue > * aEntry
)

If widget registry entry is assigned a new UID, then the processed icon file (mbm file), if any, needs to be renamed with the new UID.

Since
5.0

Parameters

RFs & aFs
RPointerArray < CWidgetPropertyValue > * aEntry

RestoreL()

void RestoreL ( ) [private]
When overwriting an installed widget, restore on error
Since
3.2

RunError(TInt)

IMPORT_C TInt RunError ( TInt aError )
Since
3.2

Parameters

TInt aError

SearchByExtL(const TDesC &, TUint, const TDesC &, TFileName &)

TInt SearchByExtL ( const TDesC & aDir,
TUint aSortKey,
const TDesC & aExt,
TFileName & aFoundName
) [private]

Return the name of file/dir found given path of dir to search in and search critiria. 3.2

Parameters

const TDesC & aDir
TUint aSortKey
const TDesC & aExt
TFileName & aFoundName

SearchWidgetRootL(const TDesC &, TFileName &)

TInt SearchWidgetRootL ( const TDesC & aDir,
TFileName & aFoundName
) [private]

Return the name of dir which contains info.plist file.

Parameters

const TDesC & aDir
TFileName & aFoundName

SetDriveAndCheckSpaceL()

TBool SetDriveAndCheckSpaceL ( ) [private]
Set drive to C: to install/update the widget
Since
3.2

UpdateWidgetBasePathL(TDriveUnit &)

void UpdateWidgetBasePathL ( TDriveUnit & aDrive ) [private]
update basepath of widget
Since
3.2

Parameters

TDriveUnit & aDrive

WidgetPropertiesFromInstalledWidgetL(RFs &, const TDesC &, const TDesC &, TUid)

IMPORT_C RPointerArray < CWidgetPropertyValue > * WidgetPropertiesFromInstalledWidgetL ( RFs & aFs,
const TDesC & aWidgetPath,
const TDesC & aLproj,
TUid aUid
)

Rebuild registry properties (except UID) from installed widget dir.

Since
5.0

Parameters

RFs & aFs
const TDesC & aWidgetPath
const TDesC & aLproj
TUid aUid

Member Data Documentation

CWidgetRegistrationManager * iAppManager

CWidgetRegistrationManager * iAppManager [private]

TFileName iBackupDir

TFileName iBackupDir [private]

TFileName iBundleRootName

TFileName iBundleRootName [private]

CFileMan * iFileMgr

CFileMan * iFileMgr [private]

TFileName iOriginalDir

TFileName iOriginalDir [private]

TBool iOverwriting

TBool iOverwriting [private]

RPointerArray< CWidgetPropertyValue > iPropertyValues

RPointerArray < CWidgetPropertyValue > iPropertyValues [private]

RWidgetRegistryClientSession iRegistry

RWidgetRegistryClientSession iRegistry [private]

RFs iRfs

RFs iRfs [private]

TBool iServerConnected

TBool iServerConnected [private]

CWidgetConfigHandler * iWidgetConfigHandler

CWidgetConfigHandler * iWidgetConfigHandler [private]