CBaNamedPlugins::CParameters Class Reference

class CBaNamedPlugins::CParameters : public CBase

The parameters for a localised list of plug-in names.

An object of this class is passed to CBaNamedPlugins::NewL() and NewLC(). The parameters are as follows - minimally, the first two must be provided:

An array of TResourceFile objects. Each object contains information about a single plug-in, or multiple plug-ins, including the filename of the corresponding resource file. Versions of these resource files with the correct filename extensions for the required languages provide the name of one or more plug-in, translated appropriately.

A connected session with the file server. This is required to search the file sytem for the localised resource files, then to open them for reading.

An optional object that generates a fallback name for plug-ins, if no resource file could be found. If no such function is provided, then the fallback name used for plug-ins is simply the filename of the resource file without the drive, directory path or extension.

An optional function that compares two plug-in names for sorting. The list is sorted after it has been fully populated, using this algorithm. If not specified, sorting is done by using the system-wide (locale-dependent) collation rules.

An optional descriptor which, if provided, adds an additional item whose meaning is "none" (i.e. "no plug-in") to the MDesCArray, and the array position (either the start or the end of the array) at which to insert it.

Inherits from

  • CBaNamedPlugins::CParameters

Constructor & Destructor Documentation

CParameters(RFs &)

CParameters(RFs &aFileServerSession)[private]

Parameters

RFs & aFileServerSession

~CParameters()

IMPORT_C~CParameters()[virtual]

Destructor. Deletes all resources owned by the object.

Member Functions Documentation

ConstructL(const TArray< TResourceFile > &)

voidConstructL(const TArray< TResourceFile > &aArrayOfResourceFiles)[private]

Parameters

const TArray< TResourceFile > & aArrayOfResourceFiles

NewL(RFs &, const TArray< TResourceFile > &)

IMPORT_C CParameters *NewL(RFs &aFileServerSession,
const TArray< TResourceFile > &aArrayOfResourceFiles
)[static]

Allocates and constructs a new parameters object.

Parameters

RFs & aFileServerSessionA connected session with the file server. This is required to search the file sytem for the localised resource files, and to open them for reading.
const TArray< TResourceFile > & aArrayOfResourceFilesArray of TResourceFile objects. Each object contains information about a single plug-in, if its iFormat attribute is set to EFormatTbuf or potentially multiple plug-ins if its iFormat attribute is set to EFormatArrayOfUidNamePairs. This information includes the filename of its resource file. The CParameters object takes a copy of this array.

NewLC(RFs &, const TArray< TResourceFile > &)

IMPORT_C CParameters *NewLC(RFs &aFileServerSession,
const TArray< TResourceFile > &aArrayOfResourceFiles
)[static]

Allocates and constructs a new parameters object. The object is left on the cleanup stack.

Parameters

RFs & aFileServerSessionA connected session with the file server. This is required to search the file sytem for the localised resource files and to open them for reading.
const TArray< TResourceFile > & aArrayOfResourceFilesArray of TResourceFile objects. Each object contains information about a single plug-in, if its iFormat attribute is set to EFormatTbuf or potentially multiple plug-ins if its iFormat attribute is set to EFormatArrayOfUidNamePairs. This information includes the filename of its resource file. The CParameters object takes a copy of this array.

SetCompareNames(TCompareNames)

IMPORT_C voidSetCompareNames(TCompareNamesaCompareNames)

Sets a function that compares two plug-in names for sorting. The plug-in names list is sorted after it has been fully populated, using this algorithm. If SetCompareNames() is not called, collation takes place by default using TDesC::CompareC().

Parameters

TCompareNames aCompareNamesA function that compares two plug-in names for sorting.

SetFallBackName(const MFallBackName &)

IMPORT_C voidSetFallBackName(const MFallBackName &aFallBackName)

Sets a function that generates a fallback name for plug-ins for which no resource file could be found. If SetFallBackName() is not called, then by default the fallback name used for plug-ins is simply the filename of the resource file without the drive, directory path or extension.

Parameters

const MFallBackName & aFallBackNameAn instance of an MFallBackName-derived class. This should implement a function which creates a name for plug-ins for which there is no resource available (the "fallback" name).

SetTextForNone(HBufC *, TArrayPosition)

IMPORT_C voidSetTextForNone(HBufC *aTextForNone,
TArrayPositionaArrayPositionOfTextForNone
)

Sets a text string, representing the choice of no plug-in and the array position at which to insert it. This function increases the length of the plug-in names list by one because it creates and adds an item to the array which is empty except for the text string specified. The function cannot leave because nothing is allocated ownership of aTextForNone is passed to the CParameters object.

Parameters

HBufC * aTextForNoneThe string whose meaning is "none", i.e. no plug-in. It is assumed that this descriptor has already been localised.
TArrayPosition aArrayPositionOfTextForNoneWhether the string should be inserted at the start or appended to the end of the array.

SetTextForNoneL(const TDesC &, TArrayPosition)

IMPORT_C voidSetTextForNoneL(const TDesC &aTextForNone,
TArrayPositionaArrayPositionOfTextForNone
)

Sets a text string, representing the choice of no plug-in and the array position at which to insert it. This function increases the length of the plug-in names list by one because it creates and adds an item to the array which is empty except for the text string specified.

Parameters

const TDesC & aTextForNoneThe string whose meaning is "none", i.e. no plug-in. It is assumed that this descriptor has already been localised.
TArrayPosition aArrayPositionOfTextForNoneWhether the string should be inserted at the start or appended to the end of the array.

Member Data Documentation

TArray< TResourceFile > * iArrayOfResourceFiles

TArray< TResourceFile > *iArrayOfResourceFiles[private]

TArrayPosition iArrayPositionOfTextForNone

TArrayPosition iArrayPositionOfTextForNone[private]

TCompareNames iCompareNames

TCompareNames iCompareNames[private]

const MFallBackName * iFallBackName

const MFallBackName *iFallBackName[private]

RFs & iFileServerSession

RFs &iFileServerSession[private]

HBufC * iTextForNone

HBufC *iTextForNone[private]