Location:
mtudcbas.h
Link against:
mtur.lib
CBaseMtmUiData
Supported from 5.0
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:
supplying MTM-specific icons for Message Server entries
supplying user interface text, e.g. for menus, for MTM-specific operations
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.
|
Defined in CBaseMtmUiData
:
CBaseMtmUiData()
, CBitmapArray
, CanCancelL()
, CanCloseEntryL()
, CanCopyMoveFromEntryL()
, CanCopyMoveToEntryL()
, CanCreateEntryL()
, CanDeleteFromEntryL()
, CanDeleteServiceL()
, CanEditEntryL()
, CanForwardEntryL()
, CanOpenEntryL()
, CanReplyToEntryL()
, CanUnDeleteFromEntryL()
, CanViewEntryL()
, ConstructL()
, ContextIcon()
, CreateBitmapsL()
, FunctionRecognised()
, GetResourceFileName()
, MtmSpecificFunctions()
, OperationSupportedL()
, PopulateArraysL()
, QueryCapability()
, ReadFunctionsFromResourceFileL()
, StatusTextL()
, Type()
, iCoeEnv
, iIconArrays
, iMtmSpecificFunctions
, ~CBaseMtmUiData()
Inherited from CBase
:
operator new()
protected: CBaseMtmUiData(CRegisteredMtmDll& aRegisteredMtmDll);
Creates a CBaseMtmUiData
and initialises its private member variables. Client applications do not use this function. It is relevant only to implementers of derived classes.
Derived classes can implement a constructor to perform any additional MTM-specific setup that can be safely carried out in a constructor. Such constructors must call the base class constructor function.
|
protected: void ConstructL();
Implements two-phase construction functions (NewL()
, ConstructL()
) to create a new instance of the object. Client applications do not use this function. It is relevant only to implementers of derived classes.
The function should perform any necessary dynamic allocation. ConstructL()
should be called from the NewL()
function of the derived class.
The default implementation of this function initiates the loading of required resources:
instantiates objects for the iIconArrays
and iMtmSpecificFunctions
protected members
loads the UI Data MTM’s resource file, as specified by GetResourceFileName()
calls PopulateArraysL()
so that the derived class can load resources
Derived classes can implement this function to perform any additional MTM-specific second stage construction tasks that they require. Implementations must call the base class ConstructL()
function.
Concrete MTMs must also implement a factory function by which a MTM registry can request an instance of the class:
|
protected: virtual void PopulateArraysL() = 0;
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:
insert MTM-specific icon bitmap arrays into the iIconArrays
array data member
insert MTM-specific operation information into the iMtmSpecificFunctions
array data member
|
protected: virtual void GetResourceFileName(TFileName& aFileName) const = 0;
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.
|
virtual ~CBaseMtmUiData();
Cleans up the base class. CBaseMtmUiData
-derived objects must be deleted by client applications when they are no longer required. Clean up includes:
cleaning up the iIconArrays
and iMtmSpecificFunctions
unloading the UI Data MTM resource file
Derived classes can implement a destructor to do any additional clean up tasks that they require.
TUid Type() const;
Gets the Type UID of the message type associated with the UI Data MTM.
|
virtual const CBitmapArray& ContextIcon(const TMsvEntry& aContext) const = 0;
Withdrawn in 5.1
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.
Requirements:
Implementations should check the type of the context, using TMsvEntry::iType::iUid
, and on this basis return the appropriate bitmap array for that context type.
|
|
virtual const CBitmapArray& ContextIcon(const TMsvEntry& aContext, TInt aStateFlags) const = 0;
Supported from 5.1
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.
|
|
const CArrayFix<TMtmUiFunction>& MtmSpecificFunctions() const;
Gets an array of MTM-specific operations that can be carried out through the associated User Interface MTM’s CBaseMtmUi::InvokeSyncFunctionL()/InvokeAsyncFunctionL()
functions.
It is intended that message client applications will use this function to add dynamically user interface features, such as menu items, dependent on the MTM type of the entry currently selected within the application. Message client applications can also use OperationSupportedL()
to check dynamically if a particular operation is appropriate to a particular entry.
Implementers should note that this function returns a pointer to the iMtmSpecificFunctions
data member.
|
TBool FunctionRecognised(TInt aFunctionId) const;
Tests if an operation with the specified ID is recognised by the UI Data MTM.
Implementers should note that this function searches the iMtmSpecificFunctions
array for the aFunctionId
.
|
|
virtual TBool CanCancelL(const TMsvEntry& aContext, TInt& aReasonResourceId) const = 0;
Supported from 6.0
Tests if the current operation on the entry can be cancelled.
|
|
virtual TBool CanCloseEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const = 0;
Tests if a close operation is supported.
|
|
virtual TBool CanCopyMoveFromEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const = 0;
Tests whether a copy from or move from operation is supported.
|
|
virtual TBool CanCopyMoveToEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const = 0;
Tests if a copy from or move to operation is supported.
|
|
virtual TBool CanCreateEntryL(const TMsvEntry& aParent, const TMsvEntry& aNewEntry, TInt& aReasonResourceId) const = 0;
Tests if an entry can be created as a child.
|
|
virtual TBool CanDeleteFromEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const = 0;
Tests if a delete operation is supported.
|
|
virtual TBool CanDeleteServiceL(const TMsvEntry& aService, TInt& aReasonResourceId) const = 0;
Tests if the service entry can be deleted.
|
|
virtual TBool CanEditEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const = 0;
Tests if the entry can be edited.
|
|
virtual TBool CanForwardEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const = 0;
Tests if an entry can be forwarded.
|
|
virtual TBool CanOpenEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const = 0;
Tests if an entry can be opened.
|
|
virtual TBool CanReplyToEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const = 0;
Tests if an entry can be replied to.
|
|
virtual TBool CanViewEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const = 0;
Tests if an entry can be viewed.
|
|
virtual TBool CanUnDeleteFromEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const;
Supported from 6.0
Tests if the entry can be undeleted.
|
|
virtual TInt OperationSupportedL(TInt aOperationId, const TMsvEntry& aContext) const = 0;
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.
|
|
virtual TInt QueryCapability(TUid aFunctionId, TInt& aResponse) const = 0;
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
.
|
|
virtual HBufC* StatusTextL(const TMsvEntry& aContext) const = 0;
Supported from 6.0
Provides status text for the sending state of the entry.
|
|
protected: void ReadFunctionsFromResourceFileL(TInt aResourceId);
Implementers of derived classes can call this class to fill the iMtmSpecificFunctions
array with MTM-specific operation definitions from the UI Data MTM’s resource file. Client applications do not use this function. It is relevant only to implementers of derived classes.
For each MTM-specific operation definition in the resource file, it adds a corresponding TMtmUiFunction
object to iMtmSpecificFunctions
.
The function is typically called from PopulateArraysL()
.
|
|
protected: void CreateBitmapsL(TInt aNumZoomStates, const TDesC& aBitmapFile, TInt aStartBitmap, TInt aEndBitmap);
Fills the iIconArrays
array with icon bitmaps from an EPOC mbm file. Client applications do not use this function. It is relevant only to implementers of derived classes.
The bitmaps to load must be contiguous within the file between the positions indicated by aStartBitmap
and aEndBitmap
.
The function is typically called from PopulateArraysL()
.
|
|
CArrayPtr<CBitmapArray>* iIconArrays
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
The array that stores MTM-specific function information for the UI Data MTM. Items are added to the array by ReadFunctionsFromResourceFileL()
.
typedef CArrayPtr<CFbsBitmap> CBitmapArray;
Supported from 5.0
Defines an array of icon bitmaps for the UI Data MTM. It is used in the definition of CBaseMtmUiData::iIconArrays
.
CBaseMtmUiData::TMtmUiFunction
Supported from 5.0
Provides the interface for clients to access MTM-specific functions, and present these functions to the user. A message client application can use this information to customise the UI.
The class encapsulates information relating to an MTM-specific operation:
human-readable name: for display on the UI
ID: used to invoke the operation through the CBaseMtmUi::InvokeSyncFunctionL()/InvokeAsyncFunctionL()
functions on the associated User Interface MTM
a suggested hot-key that the UI should support for the operation
flags that describe further operation characteristics
Defined in CBaseMtmUiData::CBaseMtmUiData::TMtmUiFunction
:
Anonymous
, ECaptionMaxLen
, TMtmUiFunction()
, iCaption
, iFlags
, iFunctionId
, iFunctionType
, iPreferredHotKeyKeyCode
, iPreferredHotKeyModifiers
CBaseMtmUiData::iMtmSpecificFunctions
CBaseMtmUiData::MtmSpecificFunctions()
CBaseMtmUiData::ReadFunctionsFromResourceFileL()
CBaseMtmUiData::PopulateArraysL()
TMtmUiFunction()
TMtmUiFunction(const TDesC& aCaption, TInt aFunctionId, TInt aHotKey, TInt aModifiers, TInt aFlags=0);
Withdrawn in 5.1
Creates a TMtmUiFunction
with the specified values.
|
TMtmUiFunction()
TMtmUiFunction(const TMtmUiFunction& aFunc);
Supported from 5.1
Creates a TMtmUiFunction
by copying another TMtmUiFunction
. Its action is the same as the default copy constructor, except that it will panic in debug builds if multiple location flags are set in aFunc
.
|
TMtmUiFunction()
TMtmUiFunction(TResourceReader& aResourceReader);
Creates a TMtmUiFunction
with its values read from the resource file location specified by TResourceReader
. This position should be at a MTUD_FUNCTION
resource.
|
iCaption
TBuf<ECaptionMaxLen> iCaption
String, suitable for a menu, describing the operation
iPreferredHotKeyKeyCode
TInt iPreferredHotKeyKeyCode
Character code for a suggested hotkey for the operation
iPreferredHotKeyModifiers
TInt iPreferredHotKeyModifiers
Suggested key modifiers for the hotkey.
iFunctionId
TInt iFunctionId
The ID that can be used to invoke the operation
iFlags
TInt iFlags
Flags setting characteristics of the operation
iFunctionType
TUint8 iFunctionType
Supported from 5.1
Flags setting location characteristics of the operation
Anonymous
Enum to define UI Data base class constants.
|