Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <Coemop.h>
Link against: cone.lib

Class MObjectProvider

class MObjectProvider;

Description

An interface that allows an object to be part of a network of object providers.

The object provider mechanism can be used to find and access objects of a given type, where the type is defined by a TTypeUid object. Object providers may be arranged in a hierarchy, i.e. an object provider may have a parent-child relationship with another object provider.

An object provider must provide an implementation for the MObjectProvider::MopSupplyObject(TTypeUid) function and can choose to provide an implementation for the MObjectProvider::MopNext() function. Typically, it will also have functionality to define who its parent is.

CCoeControl is an example of a class that implements this interface. Top level controls must have the view or app UI set as their object provider. This is done by calling CCoeControl::SetMopParent(MObjectProvider *) on the view or the app UI. The view or app UI does this by calling the top level control's CCoeControl::SetMopParent(MObjectProvider *) function.

Members

Defined in MObjectProvider:


Construction and destruction


MObjectProvider()

protected: IMPORT_C MObjectProvider();

Description

[Top]


Member functions


MopGetObject(T *&)

inline T* MopGetObject(T *&aPtr);

Description

Gets an object of the type defined by the template parameter.

The object may be supplied directly by this object provider, or by other object providers higher up the hierarchy.

Parameters

T *&aPtr

A reference to a pointer to an object of a type that is to be retrieved.

Return value

T *

A pointer to an object of the type required, or NULL if none can be found.


MopGetObjectNoChaining(T *&)

inline T* MopGetObjectNoChaining(T *&aPtr);

Description

Gets an object of the type defined by the template parameter.

The object will be supplied directly by this object provider, or NULL will be returned, this function does not recurse through the object chain.

Parameters

T *&aPtr

A reference to a pointer to an object of a type that is to be retrieved.

Return value

T *

A pointer to an object of the type required, or NULL if none can be found.


MopSupplyObject(TTypeUid)

private: virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId)=0;

Description

Gets an object whose type is encapsulated by the specified TTypeUid object.

Parameters

TTypeUid aId

Encapsulates the Uid that identifies the type of object required.

Return value

TTypeUid::Ptr

Encapsulates the pointer to the object provided. Note that the encapsulated pointer may be NULL.


MopNext()

private: IMPORT_C virtual MObjectProvider* MopNext();

Description

Return value

MObjectProvider *


MObjectProvider_Reserved1()

private: IMPORT_C virtual void MObjectProvider_Reserved1();

Description


MObjectProvider_Reserved2()

private: IMPORT_C virtual void MObjectProvider_Reserved2();

Description