class CBaNamedPlugins : public CBase |
A localised list of the names of the plug-ins available on the phone for a particular plug-in framework.
This class should be used by applications that display lists of plug-ins. It is provided so that the plug-in names displayed to users:
are not filenames
are localisable, i.e. for a multi-language ROM device, plug-in names must be translated into the correct language and sorted according to the locale's collation rules
can be filtered depending on the current locale, i.e. the user will not necessarily see the names of all plug-ins for a given framework for every language of a multi-language ROM.
Note that the class MDesC16Array is shown in the derivation tree. The class definition for CBaNamedPlugins, however, uses the typedef MDesCArray. In 6.1 builds, the symbol MDesCArray always resolves to MDesC16Array.
MDesCArray
Public Member Functions | |
---|---|
~CBaNamedPlugins() | |
IMPORT_C const TDesC * | IdentifierAtIndex(TInt) |
IMPORT_C TInt | IndexOfIdentifier(const TDesC &, TEquivalentIdentifiers) |
IMPORT_C TInt | IndexOfUid(TUid) |
IMPORT_C TInt | MdcaCount() |
IMPORT_C TPtrC | MdcaPoint(TInt) |
IMPORT_C CBaNamedPlugins * | NewL(const CParameters &) |
IMPORT_C CBaNamedPlugins * | NewLC(const CParameters &) |
IMPORT_C TUid | UidAtIndex(TInt) |
Private Member Functions | |
---|---|
CBaNamedPlugins(TInt) | |
TInt | CompareNamedPlugIns(const TNamedPlugIn &, const TNamedPlugIn &) |
void | ConstructL(const CParameters &) |
TInt | DefaultAlgorithmToCompareNames(const TDesC &, const TDesC &) |
Public Member Enumerations | |
---|---|
enum | TArrayPosition { EArrayPositionFirst, EArrayPositionLast } |
Public Member Type Definitions | |
---|---|
typedef | TInt(* TCompareNames |
typedef | TBool(* TEquivalentIdentifiers |
Private Attributes | |
---|---|
RArray< TNamedPlugIn > | iArrayOfNamedPlugIns |
IMPORT_C | ~CBaNamedPlugins | ( | ) | [virtual] |
Destructor. Deletes all resources owned by the object prior to its destruction.
TInt | CompareNamedPlugIns | ( | const TNamedPlugIn & | aNamedPlugIn1, |
const TNamedPlugIn & | aNamedPlugIn2 | |||
) | [private, static] |
const TNamedPlugIn & aNamedPlugIn1 | |
const TNamedPlugIn & aNamedPlugIn2 |
void | ConstructL | ( | const CParameters & | aParameters | ) | [private] |
const CParameters & aParameters |
TInt | DefaultAlgorithmToCompareNames | ( | const TDesC & | aName1, |
const TDesC & | aName2 | |||
) | [private, static] |
IMPORT_C const TDesC * | IdentifierAtIndex | ( | TInt | aIndex | ) | const |
Gets the identifier of the plug-in at the specified index into the MDesCArray.
The identifier of the plug-in at the specified index.
TInt aIndex | The index into the MDesCArray. Must be within the bounds of the array, or a panic occurs. |
IMPORT_C TInt | IndexOfIdentifier | ( | const TDesC & | aIdentifier, |
TEquivalentIdentifiers | aEquivalentIdentifiers | |||
) | const |
Gets the index into the sorted list (i.e. the index into the MDesCArray) of the plug-in associated with the identifier specified.
The index into the list of the plug-in with the identifier specified, or KErrNotFound if no plug-in has the specified identifier.
const TDesC & aIdentifier | The plug-in identifier to search for. |
TEquivalentIdentifiers aEquivalentIdentifiers | A function which tests whether two plug-in identifiers are the same, returning true or false. |
IMPORT_C TInt | IndexOfUid | ( | TUid | aUid | ) | const |
Gets the index into the sorted list (i.e. the index into the MDesCArray) of the plug-in associated with the UID specified.
The index into the list of the plug-in with the UID specified, or KErrNotFound if no plug-in has the specified UID.
TUid aUid | A plug-in UID to search for. Its value must not be KNullUid or a panic occurs. |
IMPORT_C TInt | MdcaCount | ( | ) | const [virtual] |
Gets the number of plug-ins in the list.
The number of plug-ins in the list.
IMPORT_C TPtrC | MdcaPoint | ( | TInt | aIndex | ) | const [virtual] |
Returns a TPtrC for the name of the plug-in at the given index.
The name of the plug-in at the given index.
TInt aIndex | The index into the list. Must be within the bounds of the array, or a panic occurs. |
IMPORT_C CBaNamedPlugins * | NewL | ( | const CParameters & | aParameters | ) | [static] |
Allocates and constructs a new list of plug-in names. The list is populated using the CParameters object passed into the function. The CParameters object can be destroyed once the CBaNamedPlugins object has been created.
The new list of plug-in names.
const CParameters & aParameters | The parameters for the list of plug-in names. |
IMPORT_C CBaNamedPlugins * | NewLC | ( | const CParameters & | aParameters | ) | [static] |
Allocates and constructs a new list of plug-in names. The list is populated using the CParameters object passed into the function. The list is left on the cleanup stack. The CParameters object can be destroyed once the CBaNamedPlugins object has been created.
The new list of plug-in names.
const CParameters & aParameters | The parameters for the list of plug-in names. |
IMPORT_C TUid | UidAtIndex | ( | TInt | aIndex | ) | const |
Gets the UID of the plug-in at the specified index into the MDesCArray.
The UID of the plug-in at the specified index.
TInt aIndex | The index into the MDesCArray. Must be within the bounds of the array, or a panic occurs. |
The position in the list of plug-in names for the text string which represents the choice of no plug-in.
Passed as an argument to SetTextForNoneL() and SetTextForNone().
EArrayPositionFirst |
The string is inserted at the start of the list (array position zero). |
EArrayPositionLast |
The string is appended to the list. |
typedef TInt(* | TCompareNames |
The prototype for a function that compares two plug-in names, aName1 and aName2 for sorting.
The plug-in names list is sorted using this algorithm after it has been populated. Implementing this function is optional. If implemented, it is passed as a parameter to CParameters::SetCompareNames(). If not implemented, a default algorithm is used.
The function should return a positive value if aName1 is to occur after aName2 or negative if aName1 is to occur before aName2. Zero should be returned if both descriptors are equivalent.
typedef TBool(* | TEquivalentIdentifiers |
The prototype for a function that compares two plug-in identifiers, aIdentifier1 and aIdentifier2 to find out if they are the same.
Implementing this function is optional. If implemented, it is passed to CBaNamedPlugins::IndexOfIdentifier(), which uses the function to compare a specified plug-in identifier with each identifier in turn in the list of named plug-ins. The function should return ETrue if they are the same, EFalse if not. TDesC::CompareC() could be used to do the comparison.