epoc32/include/smldmadapter.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/smldmadapter.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,815 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: Definition of dm constants/exported methods
    1.18 +* 	This is part of remotemgmt_plat. 
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef __SMLDMADAPTER_H__
    1.23 +#define __SMLDMADAPTER_H__
    1.24 +
    1.25 +#include <e32base.h>
    1.26 +#include <ecom/ecom.h>
    1.27 +
    1.28 +class MSmlDmDDFObject;
    1.29 +class MSmlDmCallback;
    1.30 +class RWriteStream;
    1.31 +
    1.32 +/** ECOM interface uid for DM plugin adapters */
    1.33 +#define KSmlDMInterfaceUid 0x102018B4
    1.34 +
    1.35 +/** Maximum length of a URI segment supported by the DM framework */
    1.36 +#define KSmlMaxURISegLen 32
    1.37 +
    1.38 +struct TSmlDmMappingInfo
    1.39 +/**
    1.40 +The struct combines an URI segment to a LUID in a device.
    1.41 +@publishedPartner
    1.42 +@prototype
    1.43 +*/
    1.44 +	{
    1.45 +	/** The URI segment. When using this structure, a path of the URI segment must be known */
    1.46 +	TBufC8<KSmlMaxURISegLen> iURISeg;
    1.47 +
    1.48 +	/** Local UID in the device */
    1.49 +	TPtrC8 iURISegLUID;	
    1.50 +	};
    1.51 +
    1.52 +class MSmlDmAdapter
    1.53 +/**
    1.54 +Abstract Device Management adapter.  Implementations of this interface are able to map settings
    1.55 +in device stores to portions of the Device Management Tree.
    1.56 +@publishedPartner
    1.57 +@prototype
    1.58 +*/
    1.59 +	{
    1.60 +public: //enums
    1.61 +
    1.62 +	/** An enumeration of the error codes which may be returned by DM adapters.
    1.63 +	@publishedPartner
    1.64 +	@prototype
    1.65 +	*/
    1.66 +	enum TError 
    1.67 +		{
    1.68 +		/** The command was successful */
    1.69 +		EOk = 0,
    1.70 +		/** The command failed because no setting exists in the store which corresponds to the
    1.71 +			URI or LUID passed to the adapter */
    1.72 +		ENotFound,
    1.73 +		/** The command failed because the setting can't take the value being passed to the adapter */
    1.74 +		EInvalidObject,
    1.75 +		/** The command failed because the setting already exists in the store */
    1.76 +		EAlreadyExists,
    1.77 +		/** The command failed because the setting value is too large to be accommodated in the store */
    1.78 +		ETooLargeObject,
    1.79 +		/** The command failed because the disk on which the device store resides is full */
    1.80 +		EDiskFull,
    1.81 +		/** The command failed for an unspecified reason */
    1.82 +		EError,
    1.83 +		/** The command could not be rolled back successfully */
    1.84 +		ERollbackFailed,
    1.85 +		/** The command failed because the setting is being used by another client */
    1.86 +		EObjectInUse,
    1.87 +		/** The command failed because no memory could be allocated */
    1.88 +		ENoMemory,
    1.89 +		/** The command succesfully committed */
    1.90 +		ECommitOK,
    1.91 +		/** The command rolled back succesfully */
    1.92 +		ERollbackOK,
    1.93 +		/** The commit of command failed */
    1.94 +		ECommitFailed,
    1.95 +		ENotAllowed,
    1.96 +		EAcceptedForProcessing,
    1.97 +		
    1.98 +		EExecSuccess,
    1.99 +		EExecClientError,
   1.100 +		EExecUserCancelled,
   1.101 +		EExecDownloadFailed,
   1.102 +		EExecAltDwnldAuthFail,
   1.103 +		EExecDownFailOOM,
   1.104 +		EExecInstallFailed,
   1.105 +		EExecInstallOOM,
   1.106 +		EExecPkgValidationFail,
   1.107 +		EExecRemoveFailed,
   1.108 +		EExecActivateFailed,
   1.109 +		EExecDeactivateFailed,
   1.110 +		EExecNotImplemented,
   1.111 +		EExecUndefError,
   1.112 +		EExecOperationReject,
   1.113 +		EExecAltDwnldSrvError,
   1.114 +		EExecAltDwnldSrvUnavailable
   1.115 +		
   1.116 +		};
   1.117 +
   1.118 +public:
   1.119 +	/**
   1.120 +	The function returns current version of the DDF.
   1.121 +	By asking current DDF versions from adapters DM Module can control
   1.122 +	possible changes in the data structure and send the changed DDF
   1.123 +	description to a management server.
   1.124 +	This function is always called after DDFStructureL.
   1.125 +    @param aVersion DDF version of the adapter. (filled by the adapter)
   1.126 +	@publishedPartner
   1.127 +	@prototype
   1.128 +	*/
   1.129 +	virtual void DDFVersionL( CBufBase& aVersion ) = 0;
   1.130 +	
   1.131 +	/**
   1.132 +	The function for filling the DDF structure of the adapter
   1.133 +	This function is only called once, immediately after the adapter is created.
   1.134 +	@param aDDFObject	Reference to root object. A DM adapter starts filling
   1.135 +						the data structure by calling AddChildObjectL to the root object and
   1.136 +						so describes the DDF of the adapter. 
   1.137 +	@publishedPartner
   1.138 +	@prototype
   1.139 +	*/
   1.140 +	virtual void DDFStructureL( MSmlDmDDFObject& aDDF ) = 0;
   1.141 +	
   1.142 +	/**
   1.143 +	The function creates new leaf objects, or replaces data in existing leaf
   1.144 +	objects. The information about the success of the command should be
   1.145 +	returned by calling SetStatusL function of MSmlDmCallback callback
   1.146 +	interface. This makes it possible to buffer the commands.  However, all
   1.147 +	the status codes for buffered commands must be returned at the latest when
   1.148 +	the adapter's CompleteOutstandingCmdsL() is called.
   1.149 +	@param aURI			URI of the object
   1.150 +	@param aLUID		LUID of the object (if the adapter has earlier returned a
   1.151 +						LUID to the DM Module). For new objects, this is the LUID
   1.152 +						inherited through the parent node.
   1.153 +	@param aObject		Data of the object.
   1.154 +	@param aType		MIME type of the object
   1.155 +	@param aStatusRef	Reference to correct command, i.e. this reference
   1.156 +						must be used when calling the SetStatusL of this command
   1.157 +	@publishedPartner
   1.158 +	@prototype
   1.159 +	*/
   1.160 +	virtual void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID,
   1.161 +									const TDesC8& aObject, const TDesC8& aType,
   1.162 +									TInt aStatusRef ) = 0;
   1.163 +		
   1.164 +	/**
   1.165 +	The function creates new leaf objects, or replaces data in existing leaf
   1.166 +	objects, in the case where data is large enough to be streamed. The
   1.167 +	information about the success of the command should be returned by calling
   1.168 +	SetStatusL function of MSmlDmCallback callback interface. This makes it
   1.169 +	possible to buffer the commands.  However, all the status codes for buffered
   1.170 +	commands must be returned at the latest when the CompleteOutstandingCmdsL()
   1.171 +	of adapter is called.
   1.172 +	@param aURI		URI of the object
   1.173 +	@param aLUID		LUID of the object (if the adapter has earlier returned a
   1.174 +						LUID to the DM Module). For new objects, this is the LUID
   1.175 +						inherited through the parent node.
   1.176 +	@param aStream	Data of the object. Adapter should create write stream
   1.177 +						and return, when data is written to stream by DM agent,
   1.178 +						StreamCommittedL() is called by DM engine
   1.179 +	@param aType		MIME type of the object
   1.180 +	@param aStatusRef	Reference to correct command, i.e. this reference
   1.181 +						must be used when calling the SetStatusL of this
   1.182 +						command.
   1.183 +	@publishedPartner
   1.184 +	@prototype
   1.185 +	*/
   1.186 +	virtual void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID,
   1.187 +									RWriteStream*& aStream, const TDesC8& aType,
   1.188 +		 							TInt aStatusRef ) = 0;
   1.189 +	
   1.190 +	/**
   1.191 +	The function deletes an object and its child objects. The SetStatusL
   1.192 +	should be used as described in UpdateLeafObjectL()
   1.193 +	@param aURI		URI of the object
   1.194 +	@param aLUID		LUID of the object (if the adapter have earlier returned
   1.195 +						LUID to the DM Module).
   1.196 +	@param aStatusRef	Reference to correct command, i.e. this reference must
   1.197 +						be used when calling the SetStatusL of this command.
   1.198 +	@publishedPartner
   1.199 +	@prototype
   1.200 +	*/
   1.201 +	virtual void DeleteObjectL( const TDesC8& aURI, const TDesC8& aLUID,
   1.202 +								TInt aStatusRef ) = 0;
   1.203 +	
   1.204 +	/**
   1.205 +	The function fetches data of a leaf object. The SetStatusL should be used
   1.206 +	as described in UpdateLeafObjectL(). The data is returned by using the
   1.207 +	SetResultsL function of MSmlCallback callback interface, and may be streamed.
   1.208 +	@param aURI			URI of the object
   1.209 +	@param aLUID			LUID of the object (if the adapter have earlier
   1.210 +							returned LUID to the DM Module).   
   1.211 +	@param aType 			MIME type of the object
   1.212 +	@param aResultsRef	Reference to correct results, i.e. this reference
   1.213 +							must be used when returning the result by calling
   1.214 +							the SetResultsL.
   1.215 +	@param aStatusRef		Reference to correct command, i.e. this reference
   1.216 +							must be used when calling the SetStatusL of this
   1.217 +							command.
   1.218 +	@publishedPartner
   1.219 +	@prototype
   1.220 +	*/
   1.221 +	virtual void FetchLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID,
   1.222 +								   const TDesC8& aType, TInt aResultsRef,
   1.223 +								   TInt aStatusRef ) = 0;
   1.224 +	
   1.225 +	/**
   1.226 +	The function fetches the size of the data of a leaf object. The size is
   1.227 +	in bytes, and must reflect the number of bytes that will be transferred
   1.228 +	when the framework calls FetchLeafObjectL. The SetStatusL should be used
   1.229 +	as described in FetchLeafObjectL(). The size value is returned by using
   1.230 +	the SetResultsL function of MSmlCallback callback interface, and must be
   1.231 +	a decimal integer expressed as a string, eg. "1234".
   1.232 +	Results from this call MUST NOT be streamed.
   1.233 +	@param aURI			URI of the object
   1.234 +	@param aLUID			LUID of the object (if the adapter have earlier
   1.235 +							returned LUID to the DM Module).   
   1.236 +	@param aType 			MIME type of the object
   1.237 +	@param aResultsRef	Reference to correct results, i.e. this reference
   1.238 +							must be used when returning the result by calling
   1.239 +							the SetResultsL.
   1.240 +	@param aStatusRef		Reference to correct command, i.e. this reference
   1.241 +							must be used when calling the SetStatusL of this
   1.242 +							command.
   1.243 +	@publishedPartner
   1.244 +	@prototype
   1.245 +	*/
   1.246 +	virtual void FetchLeafObjectSizeL( const TDesC8& aURI, const TDesC8& aLUID,
   1.247 +									   const TDesC8& aType, TInt aResultsRef,
   1.248 +									   TInt aStatusRef ) = 0;
   1.249 +	/**
   1.250 +	The function fetches URI list. An adapter returns the list of URI segments
   1.251 +	under the given URI be separated by slash ("/"). The URI segment names for
   1.252 +	new objects must be given by the adapter.
   1.253 +	The list is returned by calling the SetResultsL function of MSmlCallback
   1.254 +	callback interface.	Results from this call MUST NOT be streamed.
   1.255 +	@param aParentURI					URI of the parent object
   1.256 +	@param aParentLUID				LUID of the parent object (if the
   1.257 +										adapter have earlier returned LUID to
   1.258 +										the DM Module).   
   1.259 +	@param aPreviousURISegmentList	URI list with mapping LUID information,
   1.260 +										which is known by DM engine. An adapter
   1.261 +										can use this information when verifying
   1.262 +										if old objects still exists. An adapter
   1.263 +										also knows what objects are new to DM
   1.264 +										engine and can provide LUID mapping for
   1.265 +										them. aPreviousURISegmentList parameter
   1.266 +										(see above) helps to recognise new
   1.267 +										objects.
   1.268 +	@param aResultsRef				Reference to correct results, i.e. this
   1.269 +										reference must be used when returning
   1.270 +										the result by calling the SetResultsL.
   1.271 +	@param aStatusRef					Reference to correct command, i.e. this
   1.272 +										reference must be used when calling the
   1.273 +										SetStatusL of this command.
   1.274 +	@publishedPartner
   1.275 +	@prototype
   1.276 +	*/
   1.277 +	virtual void ChildURIListL( const TDesC8& aURI, const TDesC8& aLUID,
   1.278 +					const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList,
   1.279 +					TInt aResultsRef, TInt aStatusRef ) = 0;
   1.280 +	
   1.281 +	/**
   1.282 +	The function adds node object. In some cases an implementation of the
   1.283 +	function may be empty function, if the node object does not need concrete
   1.284 +	database update. Still this function may be helpful to an adapter, i.e. in
   1.285 +	passing mapping LUID of the node to DM Module. The SetStatusL should be
   1.286 +	used as described in UpdateLeafObjectL()
   1.287 +	@param aURI			URI of the object
   1.288 +	@param aParentLUID	LUID of the parent object (if the adapter have
   1.289 +							earlier returned LUID to the DM Module).   
   1.290 +	@param aStatusRef		Reference to correct command, i.e. this reference
   1.291 +							must be used when calling the SetStatusL of this
   1.292 +							command.
   1.293 +	@publishedPartner
   1.294 +	@prototype
   1.295 +	*/
   1.296 +	virtual void AddNodeObjectL( const TDesC8& aURI, const TDesC8& aParentLUID,
   1.297 +								 TInt aStatusRef )=0;
   1.298 +
   1.299 +	/**
   1.300 +	The function implements execute command. The information about the success
   1.301 +	of the command should be returned by calling SetStatusL function of
   1.302 +	MSmlDmCallback callback interface. This makes it possible to buffer the
   1.303 +	commands.
   1.304 +	However, all the status codes for buffered commands must be returned at
   1.305 +	the latest when the CompleteOutstandingCmdsL() of adapter is called.
   1.306 +	@param aURI			URI of the command
   1.307 +	@param aLUID			LUID of the object (if the adapter have earlier
   1.308 +							returned LUID to the DM Module).   
   1.309 +	@param aArgument		Argument for the command
   1.310 +	@param aType			MIME type of the object 
   1.311 +	@param aStatusRef		Reference to correct command, i.e. this reference
   1.312 +							must be used when calling the SetStatusL of this
   1.313 +							command.
   1.314 +	@publishedPartner
   1.315 +	@prototype
   1.316 +	*/
   1.317 +	virtual void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID,
   1.318 +							      const TDesC8& aArgument, const TDesC8& aType,
   1.319 +								  TInt aStatusRef ) = 0;
   1.320 +
   1.321 +	/**
   1.322 +	The function implements execute command. The information about the
   1.323 +	success of the command should be returned by calling SetStatusL function
   1.324 +	of MSmlDmCallback callback interface. This makes it possible to buffer the
   1.325 +	commands.
   1.326 +	However, all the status codes for buffered commands must be returned at
   1.327 +	the latest when the CompleteOutstandingCmdsL() of adapter is called.
   1.328 +	@param aURI			URI of the command
   1.329 +	@param aLUID			LUID of the object (if the adapter have earlier
   1.330 +							returned LUID to the DM Module).   
   1.331 +	@param aStream		Argument for the command. Adapter should create
   1.332 +							write stream and return, when data is written to
   1.333 +							stream by DM agent, StreamCommittedL() is called by
   1.334 +							DM engine
   1.335 +	@param aType			MIME type of the object 
   1.336 +	@param aStatusRef		Reference to correct command, i.e. this reference
   1.337 +							must be used when calling the SetStatusL of this
   1.338 +							command.
   1.339 +	@publishedPartner
   1.340 +	@prototype
   1.341 +	*/
   1.342 +	virtual void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID,
   1.343 +								  RWriteStream*& aStream, const TDesC8& aType,
   1.344 +								  TInt aStatusRef ) = 0;
   1.345 +
   1.346 +	/**
   1.347 +	The function implements copy command. The information about the success of
   1.348 +	the command should be returned by calling SetStatusL function of
   1.349 +	MSmlDmCallback callback interface. This makes it possible to buffer the
   1.350 +	commands.
   1.351 +	However, all the status codes for buffered commands must be returned at
   1.352 +	the latest when the CompleteOutstandingCmdsL() of adapter is called.
   1.353 +	@param aTargetURI		Target URI for the command
   1.354 +	@param aSourceLUID	LUID of the target object (if one exists, and if the adapter
   1.355 +							has	earlier returned a LUID to the DM Module).   
   1.356 +	@param aSourceURI		Source URI for the command
   1.357 +	@param aSourceLUID	LUID of the source object (if the adapter has
   1.358 +							earlier returned a LUID to the DM Module).   
   1.359 +	@param aType			MIME type of the objects
   1.360 +	@param aStatusRef		Reference to correct command, i.e. this reference
   1.361 +							must be used when calling the SetStatusL of this
   1.362 +							command.
   1.363 +	@publishedPartner
   1.364 +	@prototype
   1.365 +	*/
   1.366 +	virtual void CopyCommandL( const TDesC8& aTargetURI, const TDesC8& aTargetLUID,
   1.367 +							   const TDesC8& aSourceURI, const TDesC8& aSourceLUID,
   1.368 +							   const TDesC8& aType, TInt aStatusRef ) = 0;
   1.369 +
   1.370 +	/**
   1.371 +	The function indicates start of Atomic command.
   1.372 +	@publishedPartner
   1.373 +	@prototype
   1.374 +	*/
   1.375 +	virtual void StartAtomicL() = 0;
   1.376 +	
   1.377 +	/**
   1.378 +	The function indicates successful end of Atomic command. The adapter
   1.379 +	should commit all changes issued between StartAtomicL() and
   1.380 +	CommitAtomicL()
   1.381 +	@publishedPartner
   1.382 +	@prototype
   1.383 +	*/
   1.384 +	virtual void CommitAtomicL() = 0;
   1.385 +	
   1.386 +	/**
   1.387 +	The function indicates unsuccessful end of Atomic command. The adapter
   1.388 +	should rollback all changes issued between StartAtomicL() and
   1.389 +	RollbackAtomicL(). If rollback fails for a command, adapter should use
   1.390 +	SetStatusL() to indicate it.
   1.391 +	@publishedPartner
   1.392 +	@prototype
   1.393 +	*/
   1.394 +	virtual void RollbackAtomicL() = 0;
   1.395 +	
   1.396 +	/**
   1.397 +    Returns ETrue if adapter supports streaming otherwise EFalse.
   1.398 +	@param aItemSize size limit for stream usage
   1.399 +    @return TBool ETrue for streaming support
   1.400 +	@publishedPartner
   1.401 +	@prototype
   1.402 +    */
   1.403 +	virtual TBool StreamingSupport( TInt& aItemSize ) = 0;
   1.404 +	
   1.405 +	/**
   1.406 +    Called when stream returned from UpdateLeafObjectL or ExecuteCommandL has
   1.407 +	been written to and committed. Not called when fetching item.
   1.408 +	@publishedPartner
   1.409 +	@prototype
   1.410 +    */	
   1.411 +	virtual void StreamCommittedL() = 0;
   1.412 +	
   1.413 +	/**
   1.414 +	The function tells the adapter that all the commands of the message that
   1.415 +	can be passed to the adapter have now been passed.  This indciates that
   1.416 +	the adapter must supply status codes and results to any buffered commands.
   1.417 +	This must be done at latest by the time this function returns.
   1.418 +	This function is used at the end of SyncML messages, and during processing
   1.419 +	of Atomic.   In the case of Atomic processing, the function will be
   1.420 +	followed by a call to CommitAtomicL or RollbackAtomicL.
   1.421 +	@publishedPartner
   1.422 +	@prototype
   1.423 +	*/
   1.424 +	virtual void CompleteOutstandingCmdsL() = 0;
   1.425 +	};
   1.426 +
   1.427 +
   1.428 +class TSmlDmAccessTypes
   1.429 +/**
   1.430 +This class sets the access types which are allowed for a DM object.
   1.431 +@publishedPartner
   1.432 +@prototype
   1.433 +*/
   1.434 +	{
   1.435 +public:
   1.436 +	enum 
   1.437 +	/**
   1.438 +	This enumeration describes the possible access types for a DM object
   1.439 +	@publishedPartner
   1.440 +	@prototype
   1.441 +	*/
   1.442 +		{
   1.443 +		/** The DM Command Add is permitted on this DM object */
   1.444 +		EAccessType_Add		= 0x01,
   1.445 +		/** The DM Command Copy is permitted on this DM object */
   1.446 +		EAccessType_Copy	= 0x02,
   1.447 +		/** The DM Command Delete is permitted on this DM object */
   1.448 +		EAccessType_Delete	= 0x04,
   1.449 +		/** The DM Command Exec is permitted on this DM object */
   1.450 +		EAccessType_Exec	= 0x08,
   1.451 +		/** The DM Command Get is permitted on this DM object */
   1.452 +		EAccessType_Get		= 0x10,
   1.453 +		/** The DM Command Replace is permitted on this DM object */
   1.454 +		EAccessType_Replace = 0x20
   1.455 +		};
   1.456 +public:
   1.457 +	inline TSmlDmAccessTypes();
   1.458 +	inline void SetAdd();
   1.459 +	inline void SetCopy();
   1.460 +	inline void SetDelete();
   1.461 +	inline void SetExec();
   1.462 +	inline void SetGet();
   1.463 +	inline void SetReplace();
   1.464 +	inline TUint8 GetACL();
   1.465 +	inline void Reset();
   1.466 +	
   1.467 +private:
   1.468 +	TUint8 iACL;
   1.469 +	};
   1.470 +
   1.471 +
   1.472 +
   1.473 +class CSmlDmAdapter : public CBase, public MSmlDmAdapter
   1.474 +/**
   1.475 +The class CSmlDmAdapter is an ECOM interface for Device Management adapter plugins.
   1.476 +This interface which must be implemented by every DM plugin adapter
   1.477 +@publishedPartner
   1.478 +@prototype
   1.479 +*/
   1.480 +
   1.481 +	{
   1.482 +public:
   1.483 +	inline static CSmlDmAdapter* NewL( const TUid& aImplementationUid,
   1.484 +									   MSmlDmCallback& aDmCallback ); 
   1.485 +	inline virtual ~CSmlDmAdapter();
   1.486 +
   1.487 +protected:
   1.488 +	inline CSmlDmAdapter(TAny* aEcomArguments);
   1.489 +	inline MSmlDmCallback& Callback();
   1.490 +	
   1.491 +private:
   1.492 +	/** ECOM framework requires this ID in object destructor
   1.493 +	@internalTechnology
   1.494 +	@prototype
   1.495 +	*/
   1.496 +	TUid iDtor_ID_Key;
   1.497 +	
   1.498 +	/** The DM Framework's callback for returning command results and data
   1.499 +	@internalTechnology
   1.500 +	@prototype
   1.501 +	*/
   1.502 +	MSmlDmCallback& iCallback;
   1.503 +	};
   1.504 +
   1.505 +class MSmlDmCallback
   1.506 +/**
   1.507 +This class is callback interface which is implemented in DM Module. An
   1.508 +instance is passed by reference as an argument to the CSmlDmAdapter::NewL()
   1.509 +function. This interface is mostly used for returning results and status
   1.510 +codes for completed commands to the DM framework. The interface also has
   1.511 +functionality for mapping LUIDs and fetching from other parts of the DM Tree.
   1.512 +The adapter does not necessarily need to use any other functions but the
   1.513 +SetStatusL and SetResultsL, if it handles the LUID mapping itself.
   1.514 +@publishedPartner
   1.515 +@prototype
   1.516 +*/
   1.517 +	{
   1.518 +	public:
   1.519 +	/**
   1.520 +	The function is used to return the data in case of FetchLeafObjectL(),
   1.521 +	FetchLeafObjectSizeL() and ChildURIListL() functions. It should not be
   1.522 +	called where the DM command has failed, i.e. the error code returned in
   1.523 +	SetStatusL is something other than EOk.
   1.524 +	@param aResultsRef	Reference to correct command
   1.525 +	@param aObject		The data which should be returned
   1.526 +	@param aType			MIME type of the object
   1.527 +	@publishedPartner
   1.528 +	@prototype
   1.529 +	*/
   1.530 +	virtual void SetResultsL( TInt aResultsRef, CBufBase& aObject,
   1.531 +							  const TDesC8& aType ) = 0;
   1.532 +	
   1.533 +	/**
   1.534 +	The function is used to return the data in case of FetchLeafObjectL() and
   1.535 +	ChildURIListL() functions, where the size of the data being returned is
   1.536 +	large enough for the Adapter to stream it. This function should not be
   1.537 +	called when command was failed, i.e. the error code returned in SetStatusL
   1.538 +	is something other than EOk.
   1.539 +	@param aResultsRef	Reference to correct command
   1.540 +	@param aStream		Large data which should be returned, DM engine
   1.541 +							closes stream when it has read all the data
   1.542 +	@param aType			MIME type of the object
   1.543 +	@publishedPartner
   1.544 +	@prototype
   1.545 +	*/
   1.546 +	virtual void SetResultsL( TInt aResultsRef, RReadStream*& aStream,
   1.547 +							  const TDesC8& aType ) = 0;
   1.548 +
   1.549 +	/**
   1.550 +	The function returns information about the Add,Update,Delete and Fetch
   1.551 +	commands success to DM engine. The reference to correct command must be
   1.552 +	used when calling the SetStatusL function, the reference is got from the
   1.553 +	argument of the command functions. The SetStatusL function must be called
   1.554 +	separately for every single command.
   1.555 +	@param aStatusRef	Reference to correct command
   1.556 +	@param aErrorCode	Information about the command success
   1.557 +	@publishedPartner
   1.558 +	@prototype
   1.559 +	*/
   1.560 +	virtual void SetStatusL( TInt aStatusRef,
   1.561 +							 MSmlDmAdapter::TError aErrorCode ) = 0;
   1.562 +
   1.563 +	/**
   1.564 +	The function passes map information to DM Module. This function is called
   1.565 +	for a new management object, both for node objects and for leaf objects.
   1.566 +	In addition if ChildURIListL() function has returned new objects a mapping
   1.567 +	information of the new objects must be passed. A mapping is treated as
   1.568 +	inheritable. If the mapping is not set with this function, the mapping
   1.569 +	LUID of the parent object is passed in following commands to the object.
   1.570 +	@param aURI	URI of the object. 
   1.571 +	@param aLUID	LUID of the object. LUID must contain the all information,
   1.572 +					which is needed for retrieve the invidual object from the
   1.573 +					database. Typically it is ID for the database table. In
   1.574 +					more complicated structures it can be combination of IDs,
   1.575 +					which represent path to the object.
   1.576 +	@publishedPartner
   1.577 +	@prototype
   1.578 +	*/
   1.579 +	virtual void SetMappingL( const TDesC8& aURI, const TDesC8& aLUID ) = 0;
   1.580 +
   1.581 +	/**
   1.582 +	The function is used to make a fetch to other adapters. The most common
   1.583 +	use is to make a fetch to the AP adapter, because when managing the access
   1.584 +	points, the data comes as URI. For example, there are ToNAPId field in
   1.585 +	some adapters, and data to it can be something like AP/IAPidx, and then
   1.586 +	the link to AP adapter is needed.
   1.587 +	Using FetchLinkL causes the DM Framework to make a Get request to the
   1.588 +	appropriate DM adapter.  The receiving adapter MUST complete the Get
   1.589 +	request synchronously.
   1.590 +	@param aURI		URI of the object. 
   1.591 +	@param aData		Reference to data, i.e. data is returned here
   1.592 +	@param aStatus	The status of fetch command is returned here
   1.593 +	@publishedPartner
   1.594 +	@prototype
   1.595 +	*/
   1.596 +	virtual void FetchLinkL( const TDesC8& aURI, CBufBase& aData,
   1.597 +							 MSmlDmAdapter::TError& aStatus ) = 0;
   1.598 +
   1.599 +	/**
   1.600 +	The function returns the LUID which is mapped to aURI. If LUID is not
   1.601 +	found, the function allocates a null length string, i.e. the function
   1.602 +	allocates memory in every case.
   1.603 +	@param aURI	URI of the object. 
   1.604 +	@publishedPartner
   1.605 +	@prototype
   1.606 +	*/
   1.607 +	virtual HBufC8* GetLuidAllocL( const TDesC8& aURI ) = 0;
   1.608 +	
   1.609 +	/**
   1.610 +	The function is used to remove a mapped URI. Returns the error code about mapping removal.
   1.611 +	@param aAdapterId	Settings Adapter id
   1.612 +	@param aURI                 Mapped Uri
   1.613 +	@param aChildAlso          Indicates the child nodes removal
   1.614 +	@publishedPartner
   1.615 +	@prototype
   1.616 +	*/
   1.617 +	virtual TInt RemoveMappingL( TUint32 aAdapterId, const TDesC8& aURI, TBool aChildAlso ) = 0;
   1.618 +	};
   1.619 +
   1.620 +
   1.621 +class MSmlDmDDFObject 
   1.622 +/**
   1.623 +This class structure includes DDF description. When used as an argument in DM
   1.624 +Adapters Interface each adapter fills its own branch of DDF Tree to the data
   1.625 +structure. 
   1.626 +@publishedPartner
   1.627 +@prototype
   1.628 +*/
   1.629 +	{
   1.630 +	public:
   1.631 +
   1.632 +	enum TDFFormat
   1.633 +	/**
   1.634 +	The possible formats of a node.
   1.635 +	@publishedPartner
   1.636 +	@prototype
   1.637 +	*/
   1.638 +		{
   1.639 +		/** Base64 encoded */
   1.640 +		EB64,
   1.641 +		/** Boolean */
   1.642 +		EBool,
   1.643 +		/** Character data */
   1.644 +		EChr,
   1.645 +		/** Integer */
   1.646 +		EInt,
   1.647 +		/** A DM Tree interior node */
   1.648 +		ENode,
   1.649 +		/** No data */
   1.650 +		ENull,
   1.651 +		/** XML character data*/
   1.652 +		EXml,
   1.653 +		/** Binary data */
   1.654 +		EBin,
   1.655 +        /** Date data */     
   1.656 +		EDate,
   1.657 +		/** Time data */
   1.658 +		ETime,
   1.659 +		/** Float */ 
   1.660 +		EFloat
   1.661 +		};
   1.662 +
   1.663 +	enum TOccurence
   1.664 +	/**
   1.665 +	The possible occurrences of a node.
   1.666 +	@publishedPartner
   1.667 +	@prototype
   1.668 +	*/
   1.669 +		{
   1.670 +		/** The node appears exactly once */
   1.671 +		EOne,
   1.672 +		/** The node is optional and may appear zero or once */
   1.673 +		EZeroOrOne,
   1.674 +		/** The node is optional and may appear zero or more times */
   1.675 +		EZeroOrMore,
   1.676 +		/** The node is mandatory and may appear once or more times */
   1.677 +		EOneOrMore,
   1.678 +		/** The node is optional and may appear between once and 'N' times */
   1.679 +		EZeroOrN,
   1.680 +		/** The node is mandatory and may appear between once and 'N' times */
   1.681 +		EOneOrN
   1.682 +		};
   1.683 +
   1.684 +	enum TScope
   1.685 +	/**
   1.686 +	The possible scopes of a node.
   1.687 +	@publishedPartner
   1.688 +	@prototype
   1.689 +	*/
   1.690 +		{
   1.691 +		/** The node is permanent in the DM Tree */
   1.692 +		EPermanent,
   1.693 +		/** The node is created at run-time in the DM Tree */
   1.694 +		EDynamic
   1.695 +		};
   1.696 +
   1.697 +	/**
   1.698 +	The function sets permitted access types property to the object. Access
   1.699 +	types property is a mandatory element. If this function is not called all
   1.700 +	accesses are denied.
   1.701 +	@param aAccessTypes	Access types property.
   1.702 +	@publishedPartner
   1.703 +	@prototype
   1.704 +	*/
   1.705 +	virtual void SetAccessTypesL( TSmlDmAccessTypes aAccessTypes )=0;
   1.706 +
   1.707 +	/**
   1.708 +	The function sets a default value property to the object. Default value
   1.709 +	is not a mandatory element. If this function is not called, it means that
   1.710 +	the default value property is not set at all.
   1.711 +	@param aDefaultValue	Default value property.
   1.712 +	@publishedPartner
   1.713 +	@prototype
   1.714 +	*/
   1.715 +	virtual void SetDefaultValueL( const TDesC8& aDefaultValue )=0; 
   1.716 +
   1.717 +	/**
   1.718 +	The function sets a description property to the object. Description is
   1.719 +	not a mandatory element. If this function is not called, it means that the
   1.720 +	description property value is not set at all. 
   1.721 +	@param aDescription	Description property.
   1.722 +	@publishedPartner
   1.723 +	@prototype
   1.724 +	*/
   1.725 +	virtual void SetDescriptionL( const TDesC8& aDescription )=0;
   1.726 +
   1.727 +	/**
   1.728 +	The function sets a format property to the object. Format is a mandatory
   1.729 +	element. If this function is not called for node element, Format is set as
   1.730 +	'node'. For leaf elements this function must be called.
   1.731 +	@param aFormat	Format property.
   1.732 +	@publishedPartner
   1.733 +	@prototype
   1.734 +	*/
   1.735 +	virtual void SetDFFormatL( TDFFormat aFormat )= 0;
   1.736 +
   1.737 +	/**
   1.738 +	The function sets an occurence property to the object.  If this function
   1.739 +	is not called, an occurence is set as TOccurence::EOne. 
   1.740 +	@param aOccurence	Occurence property.
   1.741 +	@publishedPartner
   1.742 +	@prototype
   1.743 +	*/
   1.744 +	virtual void SetOccurenceL( TOccurence aOccurence ) =0;
   1.745 +
   1.746 +	/**
   1.747 +	The function sets a scope property to the object.  If this function is not
   1.748 +	called, the scope is set as TScope::EDynamic. 
   1.749 +	@param aScope	Scope property.
   1.750 +	@publishedPartner
   1.751 +	@prototype
   1.752 +	*/
   1.753 +	virtual void SetScopeL( TScope aScope ) = 0;
   1.754 +
   1.755 +	/**
   1.756 +	The function sets a title property to the object. Title is not a mandatory
   1.757 +	element. If this function is not called, it means that a Title property
   1.758 +	value is not set at all. 
   1.759 +	@param aTitle	DFTitle property.
   1.760 +	@publishedPartner
   1.761 +	@prototype
   1.762 +	*/
   1.763 +	virtual void SetDFTitleL( const TDesC8& aTitle ) = 0;
   1.764 +
   1.765 +	/**
   1.766 +	The function sets a MIME type property to the object. MIME Type is a
   1.767 +	mandatory element for leaf objects. If this function is not called (for
   1.768 +	node elements), it means that the MIME type property value is not set at
   1.769 +	all.
   1.770 +	@param aMimeType	MIME type property.
   1.771 +	@publishedPartner
   1.772 +	@prototype
   1.773 +	*/
   1.774 +	virtual void AddDFTypeMimeTypeL( const TDesC8& aMimeType ) = 0;
   1.775 +
   1.776 +	/**
   1.777 +	The function sets an object as an object group. If this function is not
   1.778 +	called, it means that the object is not an object group. Object group is a
   1.779 +	term used with for the node in the management tree that is used as a
   1.780 +	container for other object groups, container for management objects or a
   1.781 +	container for both object groups and management objects. The term 'object
   1.782 +	group' is not used when talked about the nodes which are part of
   1.783 +	the management object itself.
   1.784 +	@publishedPartner
   1.785 +	@withdrawn - This is not supported.  MSmlDmDDFObject::AddChildObjectGroupL
   1.786 +	*			   must be used instead of AddChildObjectL,SetAsObjectGroup.
   1.787 +	*/
   1.788 +	virtual void SetAsObjectGroup() = 0;
   1.789 +
   1.790 +	/**
   1.791 +	The function adds a child object and sets name of the URI segment, which
   1.792 +	is used by the DM server. The highest object must be directly under root.
   1.793 +	An adapter is not able to set properties of the root object. The aNodeName
   1.794 +	argument should be an empty string, when the name is not fixed in DDF,
   1.795 +	i.e. in case of dynamic nodes.
   1.796 +	@param aNodeName	The name of the node
   1.797 +	@publishedPartner
   1.798 +	@prototype
   1.799 +	*/
   1.800 +	virtual MSmlDmDDFObject& AddChildObjectL(const TDesC8& aNodeName) = 0;
   1.801 +
   1.802 +	/**
   1.803 +	The function adds a child object, to be used as an object group. As an
   1.804 +	object group, there is no node name (these nodes are 'unnamed' in the DDF).
   1.805 +	Object group is a term used with for nodes in the management tree that are
   1.806 +	used as a container for other object groups, container for management
   1.807 +	objects or a container for both object groups and management objects. The
   1.808 +	term 'object group' is not used when referring to nodes which are part
   1.809 +	of the management object itself.
   1.810 +	@publishedPartner
   1.811 +	@prototype
   1.812 +	*/
   1.813 +	virtual MSmlDmDDFObject& AddChildObjectGroupL() = 0;
   1.814 +	};
   1.815 +
   1.816 +#include "smldmadapter.inl"
   1.817 +
   1.818 +#endif // __SMLDMADAPTER_H__
   1.819 \ No newline at end of file