CBaNamedPlugins Class Reference

#include <banamedplugins.h>

class CBaNamedPlugins : public CBase

Inherits from

  • CBaNamedPlugins

    Detailed Description

    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

    Member Type Definition 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.

    See also: TDesC16::CompareC() TDesC8::CompareC()

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

    EnumeratorValueDescription
    EArrayPositionFirst

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

    EArrayPositionLast

    The string is appended to the list.

    Constructor & Destructor Documentation

    ~CBaNamedPlugins ( )

    IMPORT_C~CBaNamedPlugins()[virtual]

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

    Member Function Documentation

    IdentifierAtIndex ( TInt )

    IMPORT_C const TDesC *IdentifierAtIndex(TIntaIndex)const

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

    ParameterDescription
    aIndexThe index into the MDesCArray. Must be within the bounds of the array, or a panic occurs.

    Returns: The identifier of the plug-in at the specified index.

    IndexOfIdentifier ( const TDesC &, TEquivalentIdentifiers )

    IMPORT_C TIntIndexOfIdentifier(const TDesC &aIdentifier,
    TEquivalentIdentifiersaEquivalentIdentifiers
    )const

    Gets the index into the sorted list (i.e. the index into the MDesCArray) of the plug-in associated with the identifier specified.

    ParameterDescription
    aIdentifierThe plug-in identifier to search for.
    aEquivalentIdentifiersA function which tests whether two plug-in identifiers are the same, returning true or false.

    Returns: The index into the list of the plug-in with the identifier specified, or KErrNotFound if no plug-in has the specified identifier.

    IndexOfUid ( TUid )

    IMPORT_C TIntIndexOfUid(TUidaUid)const

    Gets the index into the sorted list (i.e. the index into the MDesCArray) of the plug-in associated with the UID specified.

    ParameterDescription
    aUidA plug-in UID to search for. Its value must not be KNullUid or a panic occurs.

    Returns: The index into the list of the plug-in with the UID specified, or KErrNotFound if no plug-in has the specified UID.

    MdcaCount ( )

    IMPORT_C TIntMdcaCount()const [virtual]

    Gets the number of plug-ins in the list.

    Returns: The number of plug-ins in the list.

    MdcaPoint ( TInt )

    IMPORT_C TPtrCMdcaPoint(TIntaIndex)const [virtual]

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

    ParameterDescription
    aIndexThe index into the list. Must be within the bounds of the array, or a panic occurs.

    Returns: The name of the plug-in at the given index.

    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.

    ParameterDescription
    aParametersThe parameters for the list of plug-in names.

    Returns: The new 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.

    ParameterDescription
    aParametersThe parameters for the list of plug-in names.

    Returns: The new list of plug-in names.

    UidAtIndex ( TInt )

    IMPORT_C TUidUidAtIndex(TIntaIndex)const

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

    ParameterDescription
    aIndexThe index into the MDesCArray. Must be within the bounds of the array, or a panic occurs.

    Returns: The UID of the plug-in at the specified index.