#include <banamedplugins.h>
class CBaNamedPlugins::CParameters : public CBase |
Public Member Functions | |
---|---|
virtual | ~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) |
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.
IMPORT_C | ~CParameters | ( | ) | [virtual] |
Destructor. Deletes all resources owned by the object.
IMPORT_C CParameters * | NewL | ( | RFs & | aFileServerSession, |
const TArray< TResourceFile > & | aArrayOfResourceFiles | |||
) | [static] |
Allocates and constructs a new parameters object.
Parameters | |
---|---|
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. |
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.
Parameters | |
---|---|
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. |
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().
Parameters | |
---|---|
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aTextForNone | The string whose meaning is "none", i.e. no plug-in. It is assumed that this descriptor has already been localised. |
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.
Parameters | |
---|---|
aTextForNone | The string whose meaning is "none", i.e. no plug-in. It is assumed that this descriptor has already been localised. |
aArrayPositionOfTextForNone | Whether the string should be inserted at the start or appended to the end of the array. |