Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <smldmadapter.h>
Link against: devmancmdmgr.lib
This item is not part of the S60 5th Edition SDK

Class MSmlDmCallback

class MSmlDmCallback;

Description

This class is callback interface which is implemented in DM Module. An instance is passed by reference as an argument to the CSmlDmAdapter::NewL(const TUid &,MSmlDmCallback &) function. This interface is mostly used for returning results and status codes for completed commands to the DM framework. The interface also has functionality for mapping LUIDs and fetching from other parts of the DM Tree. The adapter does not necessarily need to use any other functions but the SetStatusL and SetResultsL, if it handles the LUID mapping itself.

Members

Defined in MSmlDmCallback:


Member functions


SetResultsL(TInt,CBufBase &,const TDesC8 &)

virtual void SetResultsL(TInt aResultsRef, CBufBase &aObject, const TDesC8 &aType)=0;

Description

The function is used to return the data in case of FetchLeafObjectL(), FetchLeafObjectSizeL() and ChildURIListL() functions. It should not be called where the DM command has failed, i.e. the error code returned in SetStatusL is something other than EOk.

Parameters

TInt aResultsRef

Reference to correct command

CBufBase &aObject

The data which should be returned

const TDesC8 &aType

MIME type of the object


SetResultsL(TInt,RReadStream *&,const TDesC8 &)

virtual void SetResultsL(TInt aResultsRef, RReadStream *&aStream, const TDesC8 &aType)=0;

Description

The function is used to return the data in case of FetchLeafObjectL() and ChildURIListL() functions, where the size of the data being returned is large enough for the Adapter to stream it. This function should not be called when command was failed, i.e. the error code returned in SetStatusL is something other than EOk.

Parameters

TInt aResultsRef

Reference to correct command

RReadStream *&aStream

Large data which should be returned, DM engine closes stream when it has read all the data

const TDesC8 &aType

MIME type of the object


SetStatusL(TInt,MSmlDmAdapter::TError)

virtual void SetStatusL(TInt aStatusRef, MSmlDmAdapter::TError aErrorCode)=0;

Description

The function returns information about the Add,Update,Delete and Fetch commands success to DM engine. The reference to correct command must be used when calling the SetStatusL function, the reference is got from the argument of the command functions. The SetStatusL function must be called separately for every single command.

Parameters

TInt aStatusRef

Reference to correct command

MSmlDmAdapter::TError aErrorCode

Information about the command success


SetMappingL(const TDesC8 &,const TDesC8 &)

virtual void SetMappingL(const TDesC8 &aURI, const TDesC8 &aLUID)=0;

Description

The function passes map information to DM Module. This function is called for a new management object, both for node objects and for leaf objects. In addition if ChildURIListL() function has returned new objects a mapping information of the new objects must be passed. A mapping is treated as inheritable. If the mapping is not set with this function, the mapping LUID of the parent object is passed in following commands to the object.

Parameters

const TDesC8 &aURI

URI of the object.

const TDesC8 &aLUID

LUID of the object. LUID must contain the all information, which is needed for retrieve the invidual object from the database. Typically it is ID for the database table. In more complicated structures it can be combination of IDs, which represent path to the object.


FetchLinkL(const TDesC8 &,CBufBase &,MSmlDmAdapter::TError &)

virtual void FetchLinkL(const TDesC8 &aURI, CBufBase &aData, MSmlDmAdapter::TError &aStatus)=0;

Description

The function is used to make a fetch to other adapters. The most common use is to make a fetch to the AP adapter, because when managing the access points, the data comes as URI. For example, there are ToNAPId field in some adapters, and data to it can be something like AP/IAPidx, and then the link to AP adapter is needed. Using FetchLinkL causes the DM Framework to make a Get request to the appropriate DM adapter. The receiving adapter MUST complete the Get request synchronously.

Parameters

const TDesC8 &aURI

URI of the object.

CBufBase &aData

Reference to data, i.e. data is returned here

MSmlDmAdapter::TError &aStatus

The status of fetch command is returned here


GetLuidAllocL(const TDesC8 &)

virtual HBufC8* GetLuidAllocL(const TDesC8 &aURI)=0;

Description

The function returns the LUID which is mapped to aURI. If LUID is not found, the function allocates a null length string, i.e. the function allocates memory in every case.

Parameters

const TDesC8 &aURI

URI of the object.

Return value

HBufC8 *


GetMappingInfoListL(const TDesC8 &,CArrayFix< TSmlDmMappingInfo > &)

virtual void GetMappingInfoListL(const TDesC8 &aURI, CArrayFix< TSmlDmMappingInfo > &aSegmentList)=0;

Description

This function returns a URI Segment List, complete with LUIDs, for all the children of a named node.

Parameters

const TDesC8 &aURI

URI of the node for which the segment list is required.

CArrayFix< TSmlDmMappingInfo > &aSegmentList

Array of node names and corresponding LUIDs. This array is appended to as a result of the call.