#include <banamedplugins.h>
class CBaNamedPlugins : public CBase, public MDesC16Array |
Public Member Type Definitions | |
---|---|
typedef | TInt(* TCompareNames |
typedef | TBool(* TEquivalentIdentifiers |
Public Member Enumerations | |
---|---|
enum | TArrayPosition { EArrayPositionFirst, EArrayPositionLast } |
Public Member Functions | |
---|---|
virtual | ~CBaNamedPlugins() |
IMPORT_C const TDesC * | IdentifierAtIndex(TInt) |
IMPORT_C TInt | IndexOfIdentifier(const TDesC &, TEquivalentIdentifiers) |
IMPORT_C TInt | IndexOfUid(TUid) |
virtual IMPORT_C TInt | MdcaCount() |
virtual IMPORT_C TPtrC | MdcaPoint(TInt) |
IMPORT_C CBaNamedPlugins * | NewL(const CParameters &) |
IMPORT_C CBaNamedPlugins * | NewLC(const CParameters &) |
IMPORT_C TUid | UidAtIndex(TInt) |
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.
See also: MDesCArray
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.
See also: TDesC16::CompareC() TDesC8::CompareC()
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().
Enumerator | Value | Description |
---|---|---|
EArrayPositionFirst |
The string is inserted at the start of the list (array position zero). | |
EArrayPositionLast |
The string is appended to the list. |
IMPORT_C | ~CBaNamedPlugins | ( | ) | [virtual] |
Destructor. Deletes all resources owned by the object prior to its destruction.
Gets the identifier of the plug-in at the specified index into the MDesCArray.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aIdentifier | The plug-in identifier to search for. |
aEquivalentIdentifiers | A function which tests whether two plug-in identifiers are the same, returning true or false. |
Gets the index into the sorted list (i.e. the index into the MDesCArray) of the plug-in associated with the UID specified.
Parameters | |
---|---|
aUid | A plug-in UID to search for. Its value must not be KNullUid or a panic occurs. |
IMPORT_C TInt | MdcaCount | ( | ) | const [virtual] |
Reimplemented from MDesC16Array::MdcaCount()const
Gets the number of plug-ins in the list.
Reimplemented from MDesC16Array::MdcaPoint(TInt)const
Returns a TPtrC for the name of the plug-in at the given index.
Parameters | |
---|---|
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aParameters | The parameters for the list of plug-in names. |