CBaseMtmUiData Class Reference

class CBaseMtmUiData : public CBase

Base class for UI Data MTM components.

CBaseMtmUiData-derived classes allow message client applications to customise dynamically their user interfaces for a particular message type. For example, if a message client application currently had a fax entry selected, then it could use the fax MTM's concrete class to get information on the menus and icons that it should display.

Specifically, functionality falls into the following three areas:

1. supplying MTM-specific icons for Message Server entries

2. supplying user interface text, e.g. for menus, for MTM-specific operations

3. providing checks that MTM functions are suitable for use on an entry. It is intended that client applications will use these functions to select dynamically the user interface features available dependent on the entry currently selected within the application. For example, menu items that do not apply to particular entries could be greyed out. Note that OperationSupportedL() performs a similar function for MTM-specific functions. Implementations should determine if the operation is supported by checking the properties of the entry, such as its type. If the operation is not appropriate on the entry, then the aReasonResourceId argument is set to the ID of a string in the UI Data MTM's resource file that explains why not. Otherwise, aReasonResourceId is 0.

Message client applications use the class to access such functionality polymorphically. MTM implementers implement this class to provide such functionality for their message protocol.

Inherits from

Nested Classes and Structures

Public Member Functions
~CBaseMtmUiData()
TBool CanCancelL(const TMsvEntry &, TInt &)
TBool CanCloseEntryL(const TMsvEntry &, TInt &)
TBool CanCopyMoveFromEntryL(const TMsvEntry &, TInt &)
TBool CanCopyMoveToEntryL(const TMsvEntry &, TInt &)
TBool CanCreateEntryL(const TMsvEntry &, TMsvEntry &, TInt &)
TBool CanDeleteFromEntryL(const TMsvEntry &, TInt &)
TBool CanDeleteServiceL(const TMsvEntry &, TInt &)
TBool CanEditEntryL(const TMsvEntry &, TInt &)
TBool CanForwardEntryL(const TMsvEntry &, TInt &)
TBool CanOpenEntryL(const TMsvEntry &, TInt &)
TBool CanReplyToEntryL(const TMsvEntry &, TInt &)
IMPORT_C TBoolCanUnDeleteFromEntryL(const TMsvEntry &, TInt &)
TBool CanViewEntryL(const TMsvEntry &, TInt &)
const CBitmapArray &ContextIcon(const TMsvEntry &, TInt)
IMPORT_C TBoolFunctionRecognised(TInt)
IMPORT_C const CArrayFix< TMtmUiFunction > &MtmSpecificFunctions()
TInt OperationSupportedL(TInt, const TMsvEntry &)
TInt QueryCapability(TUid, TInt &)
HBufC *StatusTextL(const TMsvEntry &)
IMPORT_C TUidType()
Protected Member Functions
CBaseMtmUiData(CRegisteredMtmDll &)
IMPORT_C voidConstructL()
CFbsBitmap *CreateBitmapL(const TDesC &, TInt)
IMPORT_C voidCreateBitmapsL(TInt, const TDesC &, TInt, TInt)
IMPORT_C TAny *GetInterface(TUid)
voidGetResourceFileName(TFileName &)
voidPopulateArraysL()
IMPORT_C voidReadFunctionsFromResourceFileL(TInt)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Type Definitions
typedef CArrayPtr< CFbsBitmap > CBitmapArray
Protected Attributes
CCoeEnv *iCoeEnv
CArrayPtr< CBitmapArray > *iIconArrays
CArrayFix< TMtmUiFunction > *iMtmSpecificFunctions
Private Attributes
TAny *iExtensionData
CRegisteredMtmDll &iRegisteredMtmDll
TInt iResourceFileOffset

Constructor & Destructor Documentation

CBaseMtmUiData(CRegisteredMtmDll &)

IMPORT_CCBaseMtmUiData(CRegisteredMtmDll &aRegisteredMtmDll)[protected]

Parameters

CRegisteredMtmDll & aRegisteredMtmDll

~CBaseMtmUiData()

IMPORT_C~CBaseMtmUiData()[virtual]

Member Functions Documentation

CanCancelL(const TMsvEntry &, TInt &)

TBool CanCancelL(const TMsvEntry &aContext,
TInt &aReasonResourceId
)const [pure virtual]

Tests if the current operation on the entry can be cancelled.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aContextThe entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID, or 0 if operation is supported.

CanCloseEntryL(const TMsvEntry &, TInt &)

TBool CanCloseEntryL(const TMsvEntry &aContext,
TInt &aReasonResourceId
)const [pure virtual]

Tests if a close operation is supported.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aContextThe entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID, or 0 if operation is supported.

CanCopyMoveFromEntryL(const TMsvEntry &, TInt &)

TBool CanCopyMoveFromEntryL(const TMsvEntry &aContext,
TInt &aReasonResourceId
)const [pure virtual]

Tests whether a copy from or move from operation is supported.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aContextThe entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID or 0.

CanCopyMoveToEntryL(const TMsvEntry &, TInt &)

TBool CanCopyMoveToEntryL(const TMsvEntry &aContext,
TInt &aReasonResourceId
)const [pure virtual]

Tests if a copy from or move to operation is supported.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aContextThe entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID or 0.

CanCreateEntryL(const TMsvEntry &, TMsvEntry &, TInt &)

TBool CanCreateEntryL(const TMsvEntry &aParent,
TMsvEntry &aNewEntry,
TInt &aReasonResourceId
)const [pure virtual]

Tests if an entry can be created as a child.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aParentThe entry under which aNewEntry should be created.
TMsvEntry & aNewEntryThe entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID or 0.

CanDeleteFromEntryL(const TMsvEntry &, TInt &)

TBool CanDeleteFromEntryL(const TMsvEntry &aContext,
TInt &aReasonResourceId
)const [pure virtual]

Tests if a delete operation is supported.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aContextThe entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID or 0.

CanDeleteServiceL(const TMsvEntry &, TInt &)

TBool CanDeleteServiceL(const TMsvEntry &aService,
TInt &aReasonResourceId
)const [pure virtual]

Tests if the service entry can be deleted.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aServiceThe service entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID or 0.

CanEditEntryL(const TMsvEntry &, TInt &)

TBool CanEditEntryL(const TMsvEntry &aContext,
TInt &aReasonResourceId
)const [pure virtual]

Tests if the entry can be edited.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aContextThe entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID or 0.

CanForwardEntryL(const TMsvEntry &, TInt &)

TBool CanForwardEntryL(const TMsvEntry &aContext,
TInt &aReasonResourceId
)const [pure virtual]

Tests if an entry can be forwarded.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aContextThe entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID or 0.

CanOpenEntryL(const TMsvEntry &, TInt &)

TBool CanOpenEntryL(const TMsvEntry &aContext,
TInt &aReasonResourceId
)const [pure virtual]

Tests if an entry can be opened.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aContextThe entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID or 0.

CanReplyToEntryL(const TMsvEntry &, TInt &)

TBool CanReplyToEntryL(const TMsvEntry &aContext,
TInt &aReasonResourceId
)const [pure virtual]

Tests if an entry can be replied to.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aContextThe entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID or 0.

CanUnDeleteFromEntryL(const TMsvEntry &, TInt &)

IMPORT_C TBoolCanUnDeleteFromEntryL(const TMsvEntry &aContext,
TInt &aReasonResourceId
)const [virtual]

Tests if the entry can be undeleted.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aContextThe entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID or 0.

CanViewEntryL(const TMsvEntry &, TInt &)

TBool CanViewEntryL(const TMsvEntry &aContext,
TInt &aReasonResourceId
)const [pure virtual]

Tests if an entry can be viewed.

ETrue, if the operation is appropriate on the entry; EFalse, if the operation is NOT appropriate on the entry.

Parameters

const TMsvEntry & aContextThe entry to which the operation applies.
TInt & aReasonResourceIdOn return, a resource string ID or 0.

ConstructL()

IMPORT_C voidConstructL()[protected]

ContextIcon(const TMsvEntry &, TInt)

const CBitmapArray &ContextIcon(const TMsvEntry &aContext,
TIntaStateFlags
)const [pure virtual]

Gets an array of bitmaps relevant to the passed context entry.

The bitmaps within the array should be representations of the same bitmap at various sizes.

The aStateFlags argument indicates the user interface state, for example, "open", of the entry.

Requirements:

Implementations should check the type of the context, using TMsvEntry::iType::iUid, and the passed state, and return an appropriate bitmap array.

Bitmap array for the given context..

Parameters

const TMsvEntry & aContextContext entry to return the icons for.
TInt aStateFlagsFlasgs indicating the user interface state of the entry.

CreateBitmapL(const TDesC &, TInt)

CFbsBitmap *CreateBitmapL(const TDesC &aFileName,
TIntaId
)const [protected]

Parameters

const TDesC & aFileName
TInt aId

CreateBitmapsL(TInt, const TDesC &, TInt, TInt)

IMPORT_C voidCreateBitmapsL(TIntaNumZoomStates,
const TDesC &aBitmapFile,
TIntaStartBitmap,
TIntaEndBitmap
)[protected]

Parameters

TInt aNumZoomStates
const TDesC & aBitmapFile
TInt aStartBitmap
TInt aEndBitmap

FunctionRecognised(TInt)

IMPORT_C TBoolFunctionRecognised(TIntaFunctionId)const

Parameters

TInt aFunctionId

GetInterface(TUid)

IMPORT_C TAny *GetInterface(TUidaUid)[protected, virtual]

Parameters

TUid aUid

GetResourceFileName(TFileName &)

voidGetResourceFileName(TFileName &aFileName)const [protected, pure virtual]

Gets the resource file name.

Client applications do not use this function. It is relevant only to implementers of derived classes.

Requirements:

Each UI Data MTM can have a resource file associated with it. Implementations should set aFilename to the full path and name of this resource file. The function is called by CBaseMtmUiData::ConstructL(), which then loads the resource file.

Parameters

TFileName & aFileNameFilename buffer to be filled with the resource file path and name

MtmSpecificFunctions()

IMPORT_C const CArrayFix< TMtmUiFunction > &MtmSpecificFunctions()const

OperationSupportedL(TInt, const TMsvEntry &)

TInt OperationSupportedL(TIntaOperationId,
const TMsvEntry &aContext
)const [pure virtual]

Tests if an MTM-specific operation is appropriate to the specified entry. The operation specified must have been obtained from a call to MtmSpecificFunctions().

It is intended that client applications will use this function to select dynamically the MTM-specific user interface features available dependent on the entry currently selected within the application.

Requirements:

Implementations should check the type of the context, using TMsvEntry::iType::iUid, and use any other information required available from the context, to determine if the operation is supported.

KErrNone: operation is appropriate to User Interface MTM and entry. Other: if the operation is not appropriate on the entry, then this is the ID of a string in the UI Data MTM's resource file that explains why not.

Parameters

TInt aOperationIdID of operation to query.
const TMsvEntry & aContextThe entry to which the operation applies.

PopulateArraysL()

voidPopulateArraysL()[protected, pure virtual]

Initialises bitmaps and function information.

Client applications do not use this function. It is relevant only to implementers of derived classes.

Requirements:

This function is called by the base class ConstructL() function. Implementations should provide this function to:

1. insert MTM-specific icon bitmap arrays into the iIconArrays array data member

2. insert MTM-specific operation information into the iMtmSpecificFunctions array data member

QueryCapability(TUid, TInt &)

TInt QueryCapability(TUidaFunctionId,
TInt &aResponse
)const [pure virtual]

Queries if the MTM supports a particular capability, specified by a UID.

Requirements:

Implementations should check aCapability for the standard capability values and return a suitable response in aResponse. If aFunctionId is unknown, return KErrNotSupported.

KErrNone: aFunctionId is a recognised value and a response is returned KErrNotSupported: aFunctionId is not a recognised value

Parameters

TUid aFunctionIdUID of capability to be queried
TInt & aResponseResponse value. The format of the response varies according to the capability.

ReadFunctionsFromResourceFileL(TInt)

IMPORT_C voidReadFunctionsFromResourceFileL(TIntaResourceId)[protected]

Parameters

TInt aResourceId

StatusTextL(const TMsvEntry &)

HBufC *StatusTextL(const TMsvEntry &aContext)const [pure virtual]

Provides status text for the sending state of the entry.

Descriptor containing status text.

Parameters

const TMsvEntry & aContextEntry to query

Type()

IMPORT_C TUidType()const

Member Type Definitions Documentation

Typedef CBitmapArray

typedef CArrayPtr< CFbsBitmap >CBitmapArray

Defines an array of icon bitmaps for the UI Data MTM.

It is used in the definition of CBaseMtmUiData::iIconArrays.

Member Data Documentation

CCoeEnv * iCoeEnv

CCoeEnv *iCoeEnv[protected]

Control environment object. It is set by the constructor.

TAny * iExtensionData

TAny *iExtensionData[private]

CArrayPtr< CBitmapArray > * iIconArrays

CArrayPtr< CBitmapArray > *iIconArrays[protected]

The array that stores the arrays of icon bitmaps for the UI Data MTM. Items are added to the array by PopulateArraysL().

CArrayFix< TMtmUiFunction > * iMtmSpecificFunctions

CArrayFix< TMtmUiFunction > *iMtmSpecificFunctions[protected]

The array that stores MTM-specific function information for the UI Data MTM. Items are added to the array by ReadFunctionsFromResourceFileL().

CRegisteredMtmDll & iRegisteredMtmDll

CRegisteredMtmDll &iRegisteredMtmDll[private]

TInt iResourceFileOffset

TInt iResourceFileOffset[private]