MAknsDataContext Class Reference

#include <mw/AknsDataContext.h>

Link against: AknSkins.lib

class MAknsDataContext
Public Member Enumerations
enumanonymous { ETypeId }
Public Member Functions
virtual ~MAknsDataContext()
pure virtual voidReleaseItem(const TAknsItemID &)
pure virtual voidReserveItemL(const TAknsItemID &)
IMPORT_C TTypeUid::PtrSupplyMopObject(TTypeUid, MAknsDataContext *)
Protected Member Functions
virtual TInt Reserved1()
virtual TInt Reserved2()

Detailed Description

Interface that provides context sensitive control over data allocation. MAknsDataContext can be used to indicate need for specific skin items and thus to ensure that they are allocated before first use.

This is a public class with exported functions. The class is not usually intended for user derivation - concrete classes implementing the interface are provided by the library. See AknsUtils::CreateDataContextForContainerL() for further details.

Since
2.0

Member Enumeration Documentation

Enum anonymous

Type ID declaration. Type ID is used to make it possible to retrieve data context through MObjectProvider::MopSupplyObject interface.

EnumeratorValueDescription
ETypeId0x10005a28

Constructor & Destructor Documentation

~MAknsDataContext ( )

~MAknsDataContext()[inline, virtual]

Destructor. Destructor is only provided to enable deletion using base class pointer. Caller should never delete context retrieved using MObjectProvider interface.

Member Function Documentation

ReleaseItem ( const TAknsItemID & )

voidReleaseItem(const TAknsItemID &aID)[pure virtual]

Indicates that specified item will no longer be used. Instructs the data context that the specified item will not be used by caller anymore. Exact behavior (e.g. whether cached instance is deallocated) depends on the cache policy of data context and skin instance. Controls should not usually call this method, but instead allow data context (in most cases implemented by a container) go out of scope.

Since
2.0
Parameters
aIDItem ID of the item to be released.

ReserveItemL ( const TAknsItemID & )

voidReserveItemL(const TAknsItemID &aID)[pure virtual]

Reserves and allocates specified item. Instructs the data context that the specified item will be used by caller and should be allocated and cached by skin instance. Any control using cached skin items should reserve them, preferably in ConstructL(), by calling this method. Note that reservation does not guarantee that the item will be available in cache - it's only a tentative request for allocation.

Since
2.0
Exceptions:
If item data allocation fails, function leaves with error code.
Parameters
aIDItem ID of the item to be reserved.

Reserved1 ( )

TInt Reserved1()[protected, virtual]

Reserved for future use.

Since
2.0

Reserved2 ( )

TInt Reserved2()[protected, virtual]

Reserved for future use.

Since
2.0

SupplyMopObject ( TTypeUid, MAknsDataContext * )

IMPORT_C TTypeUid::PtrSupplyMopObject(TTypeUidaId,
MAknsDataContext *aContext
)[static]

Returns type UID pointer that can be used in MopSupplyObject.

Since
2.0
Parameters
aIdType UID, should be the same that was given as aId parameter of MopSupplyObject.
aContextPointer to an MAknsDataContext instance.
Return Value
Type UID pointer containing aContext, or NULL type UID pointer if given type UID does not match MAknsDataContext or aContext is NULL.