CBaNamedPlugins Class Reference

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

Inherits from

Constructor & Destructor Documentation

CBaNamedPlugins(TInt)

CBaNamedPlugins ( TInt aGranularity ) [private]

Parameters

TInt aGranularity

~CBaNamedPlugins()

IMPORT_C ~CBaNamedPlugins ( ) [virtual]

Destructor. Deletes all resources owned by the object prior to its destruction.

Member Functions Documentation

CompareNamedPlugIns(const TNamedPlugIn &, const TNamedPlugIn &)

TInt CompareNamedPlugIns ( const TNamedPlugIn & aNamedPlugIn1,
const TNamedPlugIn & aNamedPlugIn2
) [private, static]

Parameters

const TNamedPlugIn & aNamedPlugIn1
const TNamedPlugIn & aNamedPlugIn2

ConstructL(const CParameters &)

void ConstructL ( const CParameters & aParameters ) [private]

Parameters

const CParameters & aParameters

DefaultAlgorithmToCompareNames(const TDesC &, const TDesC &)

TInt DefaultAlgorithmToCompareNames ( const TDesC & aName1,
const TDesC & aName2
) [private, static]

Parameters

const TDesC & aName1
const TDesC & aName2

IdentifierAtIndex(TInt)

IMPORT_C const TDesC * IdentifierAtIndex ( TInt aIndex ) const

Gets the identifier of the plug-in at the specified index into the MDesCArray.

Parameters

TInt aIndex The index into the MDesCArray. Must be within the bounds of the array, or a panic occurs.

IndexOfIdentifier(const TDesC &, TEquivalentIdentifiers)

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

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.

IndexOfUid(TUid)

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.

Parameters

TUid aUid A plug-in UID to search for. Its value must not be KNullUid or a panic occurs.

MdcaCount()

IMPORT_C TInt MdcaCount ( ) const [virtual]

Gets the number of plug-ins in the list.

MdcaPoint(TInt)

IMPORT_C TPtrC MdcaPoint ( TInt aIndex ) const [virtual]

Returns a TPtrC for the name of the plug-in at the given index.

Parameters

TInt aIndex The index into the list. Must be within the bounds of the array, or a panic occurs.

NewL(const CParameters &)

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

const CParameters & aParameters The parameters for the list of plug-in names.

NewLC(const CParameters &)

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

const CParameters & aParameters The parameters for the list of plug-in names.

UidAtIndex(TInt)

IMPORT_C TUid UidAtIndex ( TInt aIndex ) const

Gets the UID of the plug-in at the specified index into the MDesCArray.

Parameters

TInt aIndex The index into the MDesCArray. Must be within the bounds of the array, or a panic occurs.

Member Enumerations Documentation

Enum TArrayPosition

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().

Enumerators

EArrayPositionFirst

The string is inserted at the start of the list (array position zero).

EArrayPositionLast

The string is appended to the list.

Member Type Definitions Documentation

Typedef TCompareNames

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 TEquivalentIdentifiers

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.

TDesC16::CompareC() TDesC8::CompareC()

Member Data Documentation

RArray< TNamedPlugIn > iArrayOfNamedPlugIns

RArray < TNamedPlugIn > iArrayOfNamedPlugIns [private]