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.
Public Member Functions | |
---|---|
~CParameters() | |
IMPORT_C CParameters * | NewL(RFs &, const TArray< TResourceFile > &) |
IMPORT_C CParameters * | NewLC(RFs &, const TArray< TResourceFile > &) |
IMPORT_C void | SetCompareNames(TCompareNames) |
IMPORT_C void | SetFallBackName(const MFallBackName &) |
IMPORT_C void | SetTextForNone(HBufC *, TArrayPosition) |
IMPORT_C void | SetTextForNoneL(const TDesC &, TArrayPosition) |
Private Member Functions | |
---|---|
CParameters(RFs &) | |
void | ConstructL(const TArray< TResourceFile > &) |
Private Attributes | |
---|---|
TArray< TResourceFile > * | iArrayOfResourceFiles |
TArrayPosition | iArrayPositionOfTextForNone |
TCompareNames | iCompareNames |
const MFallBackName * | iFallBackName |
RFs & | iFileServerSession |
HBufC * | iTextForNone |
IMPORT_C | ~CParameters | ( | ) | [virtual] |
Destructor. Deletes all resources owned by the object.
void | ConstructL | ( | const TArray< TResourceFile > & | aArrayOfResourceFiles | ) | [private] |
const TArray< TResourceFile > & aArrayOfResourceFiles |
IMPORT_C CParameters * | NewL | ( | RFs & | aFileServerSession, |
const TArray< TResourceFile > & | aArrayOfResourceFiles | |||
) | [static] |
Allocates and constructs a new parameters object.
RFs & aFileServerSession | A 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 > & aArrayOfResourceFiles | Array 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. |
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.
RFs & aFileServerSession | A 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 > & aArrayOfResourceFiles | Array 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. |
IMPORT_C void | SetCompareNames | ( | TCompareNames | aCompareNames | ) |
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().
TCompareNames aCompareNames | A function that compares two plug-in names for sorting. |
IMPORT_C void | SetFallBackName | ( | 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.
const MFallBackName & aFallBackName | An 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). |
IMPORT_C void | SetTextForNone | ( | HBufC * | aTextForNone, |
TArrayPosition | aArrayPositionOfTextForNone | |||
) |
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.
HBufC * aTextForNone | The string whose meaning is "none", i.e. no plug-in. It is assumed that this descriptor has already been localised. |
TArrayPosition aArrayPositionOfTextForNone | Whether the string should be inserted at the start or appended to the end of the array. |
IMPORT_C void | SetTextForNoneL | ( | const TDesC & | aTextForNone, |
TArrayPosition | aArrayPositionOfTextForNone | |||
) |
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.
const TDesC & aTextForNone | The string whose meaning is "none", i.e. no plug-in. It is assumed that this descriptor has already been localised. |
TArrayPosition aArrayPositionOfTextForNone | Whether the string should be inserted at the start or appended to the end of the array. |
TArray< TResourceFile > * | iArrayOfResourceFiles | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.