epoc32/include/smldmadapter.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
/*
williamr@4
     2
* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
williamr@4
     3
* All rights reserved.
williamr@4
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@4
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     8
*
williamr@4
     9
* Initial Contributors:
williamr@4
    10
* Nokia Corporation - initial contribution.
williamr@4
    11
*
williamr@4
    12
* Contributors:
williamr@4
    13
*
williamr@4
    14
* Description: Definition of dm constants/exported methods
williamr@4
    15
* 	This is part of remotemgmt_plat. 
williamr@4
    16
*/
williamr@4
    17
williamr@4
    18
williamr@4
    19
#ifndef __SMLDMADAPTER_H__
williamr@4
    20
#define __SMLDMADAPTER_H__
williamr@4
    21
williamr@4
    22
#include <e32base.h>
williamr@4
    23
#include <ecom/ecom.h>
williamr@4
    24
williamr@4
    25
class MSmlDmDDFObject;
williamr@4
    26
class MSmlDmCallback;
williamr@4
    27
class RWriteStream;
williamr@4
    28
williamr@4
    29
/** ECOM interface uid for DM plugin adapters */
williamr@4
    30
#define KSmlDMInterfaceUid 0x102018B4
williamr@4
    31
williamr@4
    32
/** Maximum length of a URI segment supported by the DM framework */
williamr@4
    33
#define KSmlMaxURISegLen 32
williamr@4
    34
williamr@4
    35
struct TSmlDmMappingInfo
williamr@4
    36
/**
williamr@4
    37
The struct combines an URI segment to a LUID in a device.
williamr@4
    38
@publishedPartner
williamr@4
    39
@prototype
williamr@4
    40
*/
williamr@4
    41
	{
williamr@4
    42
	/** The URI segment. When using this structure, a path of the URI segment must be known */
williamr@4
    43
	TBufC8<KSmlMaxURISegLen> iURISeg;
williamr@4
    44
williamr@4
    45
	/** Local UID in the device */
williamr@4
    46
	TPtrC8 iURISegLUID;	
williamr@4
    47
	};
williamr@4
    48
williamr@4
    49
class MSmlDmAdapter
williamr@4
    50
/**
williamr@4
    51
Abstract Device Management adapter.  Implementations of this interface are able to map settings
williamr@4
    52
in device stores to portions of the Device Management Tree.
williamr@4
    53
@publishedPartner
williamr@4
    54
@prototype
williamr@4
    55
*/
williamr@4
    56
	{
williamr@4
    57
public: //enums
williamr@4
    58
williamr@4
    59
	/** An enumeration of the error codes which may be returned by DM adapters.
williamr@4
    60
	@publishedPartner
williamr@4
    61
	@prototype
williamr@4
    62
	*/
williamr@4
    63
	enum TError 
williamr@4
    64
		{
williamr@4
    65
		/** The command was successful */
williamr@4
    66
		EOk = 0,
williamr@4
    67
		/** The command failed because no setting exists in the store which corresponds to the
williamr@4
    68
			URI or LUID passed to the adapter */
williamr@4
    69
		ENotFound,
williamr@4
    70
		/** The command failed because the setting can't take the value being passed to the adapter */
williamr@4
    71
		EInvalidObject,
williamr@4
    72
		/** The command failed because the setting already exists in the store */
williamr@4
    73
		EAlreadyExists,
williamr@4
    74
		/** The command failed because the setting value is too large to be accommodated in the store */
williamr@4
    75
		ETooLargeObject,
williamr@4
    76
		/** The command failed because the disk on which the device store resides is full */
williamr@4
    77
		EDiskFull,
williamr@4
    78
		/** The command failed for an unspecified reason */
williamr@4
    79
		EError,
williamr@4
    80
		/** The command could not be rolled back successfully */
williamr@4
    81
		ERollbackFailed,
williamr@4
    82
		/** The command failed because the setting is being used by another client */
williamr@4
    83
		EObjectInUse,
williamr@4
    84
		/** The command failed because no memory could be allocated */
williamr@4
    85
		ENoMemory,
williamr@4
    86
		/** The command succesfully committed */
williamr@4
    87
		ECommitOK,
williamr@4
    88
		/** The command rolled back succesfully */
williamr@4
    89
		ERollbackOK,
williamr@4
    90
		/** The commit of command failed */
williamr@4
    91
		ECommitFailed,
williamr@4
    92
		ENotAllowed,
williamr@4
    93
		EAcceptedForProcessing,
williamr@4
    94
		
williamr@4
    95
		EExecSuccess,
williamr@4
    96
		EExecClientError,
williamr@4
    97
		EExecUserCancelled,
williamr@4
    98
		EExecDownloadFailed,
williamr@4
    99
		EExecAltDwnldAuthFail,
williamr@4
   100
		EExecDownFailOOM,
williamr@4
   101
		EExecInstallFailed,
williamr@4
   102
		EExecInstallOOM,
williamr@4
   103
		EExecPkgValidationFail,
williamr@4
   104
		EExecRemoveFailed,
williamr@4
   105
		EExecActivateFailed,
williamr@4
   106
		EExecDeactivateFailed,
williamr@4
   107
		EExecNotImplemented,
williamr@4
   108
		EExecUndefError,
williamr@4
   109
		EExecOperationReject,
williamr@4
   110
		EExecAltDwnldSrvError,
williamr@4
   111
		EExecAltDwnldSrvUnavailable
williamr@4
   112
		
williamr@4
   113
		};
williamr@4
   114
williamr@4
   115
public:
williamr@4
   116
	/**
williamr@4
   117
	The function returns current version of the DDF.
williamr@4
   118
	By asking current DDF versions from adapters DM Module can control
williamr@4
   119
	possible changes in the data structure and send the changed DDF
williamr@4
   120
	description to a management server.
williamr@4
   121
	This function is always called after DDFStructureL.
williamr@4
   122
    @param aVersion DDF version of the adapter. (filled by the adapter)
williamr@4
   123
	@publishedPartner
williamr@4
   124
	@prototype
williamr@4
   125
	*/
williamr@4
   126
	virtual void DDFVersionL( CBufBase& aVersion ) = 0;
williamr@4
   127
	
williamr@4
   128
	/**
williamr@4
   129
	The function for filling the DDF structure of the adapter
williamr@4
   130
	This function is only called once, immediately after the adapter is created.
williamr@4
   131
	@param aDDFObject	Reference to root object. A DM adapter starts filling
williamr@4
   132
						the data structure by calling AddChildObjectL to the root object and
williamr@4
   133
						so describes the DDF of the adapter. 
williamr@4
   134
	@publishedPartner
williamr@4
   135
	@prototype
williamr@4
   136
	*/
williamr@4
   137
	virtual void DDFStructureL( MSmlDmDDFObject& aDDF ) = 0;
williamr@4
   138
	
williamr@4
   139
	/**
williamr@4
   140
	The function creates new leaf objects, or replaces data in existing leaf
williamr@4
   141
	objects. The information about the success of the command should be
williamr@4
   142
	returned by calling SetStatusL function of MSmlDmCallback callback
williamr@4
   143
	interface. This makes it possible to buffer the commands.  However, all
williamr@4
   144
	the status codes for buffered commands must be returned at the latest when
williamr@4
   145
	the adapter's CompleteOutstandingCmdsL() is called.
williamr@4
   146
	@param aURI			URI of the object
williamr@4
   147
	@param aLUID		LUID of the object (if the adapter has earlier returned a
williamr@4
   148
						LUID to the DM Module). For new objects, this is the LUID
williamr@4
   149
						inherited through the parent node.
williamr@4
   150
	@param aObject		Data of the object.
williamr@4
   151
	@param aType		MIME type of the object
williamr@4
   152
	@param aStatusRef	Reference to correct command, i.e. this reference
williamr@4
   153
						must be used when calling the SetStatusL of this command
williamr@4
   154
	@publishedPartner
williamr@4
   155
	@prototype
williamr@4
   156
	*/
williamr@4
   157
	virtual void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID,
williamr@4
   158
									const TDesC8& aObject, const TDesC8& aType,
williamr@4
   159
									TInt aStatusRef ) = 0;
williamr@4
   160
		
williamr@4
   161
	/**
williamr@4
   162
	The function creates new leaf objects, or replaces data in existing leaf
williamr@4
   163
	objects, in the case where data is large enough to be streamed. The
williamr@4
   164
	information about the success of the command should be returned by calling
williamr@4
   165
	SetStatusL function of MSmlDmCallback callback interface. This makes it
williamr@4
   166
	possible to buffer the commands.  However, all the status codes for buffered
williamr@4
   167
	commands must be returned at the latest when the CompleteOutstandingCmdsL()
williamr@4
   168
	of adapter is called.
williamr@4
   169
	@param aURI		URI of the object
williamr@4
   170
	@param aLUID		LUID of the object (if the adapter has earlier returned a
williamr@4
   171
						LUID to the DM Module). For new objects, this is the LUID
williamr@4
   172
						inherited through the parent node.
williamr@4
   173
	@param aStream	Data of the object. Adapter should create write stream
williamr@4
   174
						and return, when data is written to stream by DM agent,
williamr@4
   175
						StreamCommittedL() is called by DM engine
williamr@4
   176
	@param aType		MIME type of the object
williamr@4
   177
	@param aStatusRef	Reference to correct command, i.e. this reference
williamr@4
   178
						must be used when calling the SetStatusL of this
williamr@4
   179
						command.
williamr@4
   180
	@publishedPartner
williamr@4
   181
	@prototype
williamr@4
   182
	*/
williamr@4
   183
	virtual void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID,
williamr@4
   184
									RWriteStream*& aStream, const TDesC8& aType,
williamr@4
   185
		 							TInt aStatusRef ) = 0;
williamr@4
   186
	
williamr@4
   187
	/**
williamr@4
   188
	The function deletes an object and its child objects. The SetStatusL
williamr@4
   189
	should be used as described in UpdateLeafObjectL()
williamr@4
   190
	@param aURI		URI of the object
williamr@4
   191
	@param aLUID		LUID of the object (if the adapter have earlier returned
williamr@4
   192
						LUID to the DM Module).
williamr@4
   193
	@param aStatusRef	Reference to correct command, i.e. this reference must
williamr@4
   194
						be used when calling the SetStatusL of this command.
williamr@4
   195
	@publishedPartner
williamr@4
   196
	@prototype
williamr@4
   197
	*/
williamr@4
   198
	virtual void DeleteObjectL( const TDesC8& aURI, const TDesC8& aLUID,
williamr@4
   199
								TInt aStatusRef ) = 0;
williamr@4
   200
	
williamr@4
   201
	/**
williamr@4
   202
	The function fetches data of a leaf object. The SetStatusL should be used
williamr@4
   203
	as described in UpdateLeafObjectL(). The data is returned by using the
williamr@4
   204
	SetResultsL function of MSmlCallback callback interface, and may be streamed.
williamr@4
   205
	@param aURI			URI of the object
williamr@4
   206
	@param aLUID			LUID of the object (if the adapter have earlier
williamr@4
   207
							returned LUID to the DM Module).   
williamr@4
   208
	@param aType 			MIME type of the object
williamr@4
   209
	@param aResultsRef	Reference to correct results, i.e. this reference
williamr@4
   210
							must be used when returning the result by calling
williamr@4
   211
							the SetResultsL.
williamr@4
   212
	@param aStatusRef		Reference to correct command, i.e. this reference
williamr@4
   213
							must be used when calling the SetStatusL of this
williamr@4
   214
							command.
williamr@4
   215
	@publishedPartner
williamr@4
   216
	@prototype
williamr@4
   217
	*/
williamr@4
   218
	virtual void FetchLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID,
williamr@4
   219
								   const TDesC8& aType, TInt aResultsRef,
williamr@4
   220
								   TInt aStatusRef ) = 0;
williamr@4
   221
	
williamr@4
   222
	/**
williamr@4
   223
	The function fetches the size of the data of a leaf object. The size is
williamr@4
   224
	in bytes, and must reflect the number of bytes that will be transferred
williamr@4
   225
	when the framework calls FetchLeafObjectL. The SetStatusL should be used
williamr@4
   226
	as described in FetchLeafObjectL(). The size value is returned by using
williamr@4
   227
	the SetResultsL function of MSmlCallback callback interface, and must be
williamr@4
   228
	a decimal integer expressed as a string, eg. "1234".
williamr@4
   229
	Results from this call MUST NOT be streamed.
williamr@4
   230
	@param aURI			URI of the object
williamr@4
   231
	@param aLUID			LUID of the object (if the adapter have earlier
williamr@4
   232
							returned LUID to the DM Module).   
williamr@4
   233
	@param aType 			MIME type of the object
williamr@4
   234
	@param aResultsRef	Reference to correct results, i.e. this reference
williamr@4
   235
							must be used when returning the result by calling
williamr@4
   236
							the SetResultsL.
williamr@4
   237
	@param aStatusRef		Reference to correct command, i.e. this reference
williamr@4
   238
							must be used when calling the SetStatusL of this
williamr@4
   239
							command.
williamr@4
   240
	@publishedPartner
williamr@4
   241
	@prototype
williamr@4
   242
	*/
williamr@4
   243
	virtual void FetchLeafObjectSizeL( const TDesC8& aURI, const TDesC8& aLUID,
williamr@4
   244
									   const TDesC8& aType, TInt aResultsRef,
williamr@4
   245
									   TInt aStatusRef ) = 0;
williamr@4
   246
	/**
williamr@4
   247
	The function fetches URI list. An adapter returns the list of URI segments
williamr@4
   248
	under the given URI be separated by slash ("/"). The URI segment names for
williamr@4
   249
	new objects must be given by the adapter.
williamr@4
   250
	The list is returned by calling the SetResultsL function of MSmlCallback
williamr@4
   251
	callback interface.	Results from this call MUST NOT be streamed.
williamr@4
   252
	@param aParentURI					URI of the parent object
williamr@4
   253
	@param aParentLUID				LUID of the parent object (if the
williamr@4
   254
										adapter have earlier returned LUID to
williamr@4
   255
										the DM Module).   
williamr@4
   256
	@param aPreviousURISegmentList	URI list with mapping LUID information,
williamr@4
   257
										which is known by DM engine. An adapter
williamr@4
   258
										can use this information when verifying
williamr@4
   259
										if old objects still exists. An adapter
williamr@4
   260
										also knows what objects are new to DM
williamr@4
   261
										engine and can provide LUID mapping for
williamr@4
   262
										them. aPreviousURISegmentList parameter
williamr@4
   263
										(see above) helps to recognise new
williamr@4
   264
										objects.
williamr@4
   265
	@param aResultsRef				Reference to correct results, i.e. this
williamr@4
   266
										reference must be used when returning
williamr@4
   267
										the result by calling the SetResultsL.
williamr@4
   268
	@param aStatusRef					Reference to correct command, i.e. this
williamr@4
   269
										reference must be used when calling the
williamr@4
   270
										SetStatusL of this command.
williamr@4
   271
	@publishedPartner
williamr@4
   272
	@prototype
williamr@4
   273
	*/
williamr@4
   274
	virtual void ChildURIListL( const TDesC8& aURI, const TDesC8& aLUID,
williamr@4
   275
					const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList,
williamr@4
   276
					TInt aResultsRef, TInt aStatusRef ) = 0;
williamr@4
   277
	
williamr@4
   278
	/**
williamr@4
   279
	The function adds node object. In some cases an implementation of the
williamr@4
   280
	function may be empty function, if the node object does not need concrete
williamr@4
   281
	database update. Still this function may be helpful to an adapter, i.e. in
williamr@4
   282
	passing mapping LUID of the node to DM Module. The SetStatusL should be
williamr@4
   283
	used as described in UpdateLeafObjectL()
williamr@4
   284
	@param aURI			URI of the object
williamr@4
   285
	@param aParentLUID	LUID of the parent object (if the adapter have
williamr@4
   286
							earlier returned LUID to the DM Module).   
williamr@4
   287
	@param aStatusRef		Reference to correct command, i.e. this reference
williamr@4
   288
							must be used when calling the SetStatusL of this
williamr@4
   289
							command.
williamr@4
   290
	@publishedPartner
williamr@4
   291
	@prototype
williamr@4
   292
	*/
williamr@4
   293
	virtual void AddNodeObjectL( const TDesC8& aURI, const TDesC8& aParentLUID,
williamr@4
   294
								 TInt aStatusRef )=0;
williamr@4
   295
williamr@4
   296
	/**
williamr@4
   297
	The function implements execute command. The information about the success
williamr@4
   298
	of the command should be returned by calling SetStatusL function of
williamr@4
   299
	MSmlDmCallback callback interface. This makes it possible to buffer the
williamr@4
   300
	commands.
williamr@4
   301
	However, all the status codes for buffered commands must be returned at
williamr@4
   302
	the latest when the CompleteOutstandingCmdsL() of adapter is called.
williamr@4
   303
	@param aURI			URI of the command
williamr@4
   304
	@param aLUID			LUID of the object (if the adapter have earlier
williamr@4
   305
							returned LUID to the DM Module).   
williamr@4
   306
	@param aArgument		Argument for the command
williamr@4
   307
	@param aType			MIME type of the object 
williamr@4
   308
	@param aStatusRef		Reference to correct command, i.e. this reference
williamr@4
   309
							must be used when calling the SetStatusL of this
williamr@4
   310
							command.
williamr@4
   311
	@publishedPartner
williamr@4
   312
	@prototype
williamr@4
   313
	*/
williamr@4
   314
	virtual void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID,
williamr@4
   315
							      const TDesC8& aArgument, const TDesC8& aType,
williamr@4
   316
								  TInt aStatusRef ) = 0;
williamr@4
   317
williamr@4
   318
	/**
williamr@4
   319
	The function implements execute command. The information about the
williamr@4
   320
	success of the command should be returned by calling SetStatusL function
williamr@4
   321
	of MSmlDmCallback callback interface. This makes it possible to buffer the
williamr@4
   322
	commands.
williamr@4
   323
	However, all the status codes for buffered commands must be returned at
williamr@4
   324
	the latest when the CompleteOutstandingCmdsL() of adapter is called.
williamr@4
   325
	@param aURI			URI of the command
williamr@4
   326
	@param aLUID			LUID of the object (if the adapter have earlier
williamr@4
   327
							returned LUID to the DM Module).   
williamr@4
   328
	@param aStream		Argument for the command. Adapter should create
williamr@4
   329
							write stream and return, when data is written to
williamr@4
   330
							stream by DM agent, StreamCommittedL() is called by
williamr@4
   331
							DM engine
williamr@4
   332
	@param aType			MIME type of the object 
williamr@4
   333
	@param aStatusRef		Reference to correct command, i.e. this reference
williamr@4
   334
							must be used when calling the SetStatusL of this
williamr@4
   335
							command.
williamr@4
   336
	@publishedPartner
williamr@4
   337
	@prototype
williamr@4
   338
	*/
williamr@4
   339
	virtual void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID,
williamr@4
   340
								  RWriteStream*& aStream, const TDesC8& aType,
williamr@4
   341
								  TInt aStatusRef ) = 0;
williamr@4
   342
williamr@4
   343
	/**
williamr@4
   344
	The function implements copy command. The information about the success of
williamr@4
   345
	the command should be returned by calling SetStatusL function of
williamr@4
   346
	MSmlDmCallback callback interface. This makes it possible to buffer the
williamr@4
   347
	commands.
williamr@4
   348
	However, all the status codes for buffered commands must be returned at
williamr@4
   349
	the latest when the CompleteOutstandingCmdsL() of adapter is called.
williamr@4
   350
	@param aTargetURI		Target URI for the command
williamr@4
   351
	@param aSourceLUID	LUID of the target object (if one exists, and if the adapter
williamr@4
   352
							has	earlier returned a LUID to the DM Module).   
williamr@4
   353
	@param aSourceURI		Source URI for the command
williamr@4
   354
	@param aSourceLUID	LUID of the source object (if the adapter has
williamr@4
   355
							earlier returned a LUID to the DM Module).   
williamr@4
   356
	@param aType			MIME type of the objects
williamr@4
   357
	@param aStatusRef		Reference to correct command, i.e. this reference
williamr@4
   358
							must be used when calling the SetStatusL of this
williamr@4
   359
							command.
williamr@4
   360
	@publishedPartner
williamr@4
   361
	@prototype
williamr@4
   362
	*/
williamr@4
   363
	virtual void CopyCommandL( const TDesC8& aTargetURI, const TDesC8& aTargetLUID,
williamr@4
   364
							   const TDesC8& aSourceURI, const TDesC8& aSourceLUID,
williamr@4
   365
							   const TDesC8& aType, TInt aStatusRef ) = 0;
williamr@4
   366
williamr@4
   367
	/**
williamr@4
   368
	The function indicates start of Atomic command.
williamr@4
   369
	@publishedPartner
williamr@4
   370
	@prototype
williamr@4
   371
	*/
williamr@4
   372
	virtual void StartAtomicL() = 0;
williamr@4
   373
	
williamr@4
   374
	/**
williamr@4
   375
	The function indicates successful end of Atomic command. The adapter
williamr@4
   376
	should commit all changes issued between StartAtomicL() and
williamr@4
   377
	CommitAtomicL()
williamr@4
   378
	@publishedPartner
williamr@4
   379
	@prototype
williamr@4
   380
	*/
williamr@4
   381
	virtual void CommitAtomicL() = 0;
williamr@4
   382
	
williamr@4
   383
	/**
williamr@4
   384
	The function indicates unsuccessful end of Atomic command. The adapter
williamr@4
   385
	should rollback all changes issued between StartAtomicL() and
williamr@4
   386
	RollbackAtomicL(). If rollback fails for a command, adapter should use
williamr@4
   387
	SetStatusL() to indicate it.
williamr@4
   388
	@publishedPartner
williamr@4
   389
	@prototype
williamr@4
   390
	*/
williamr@4
   391
	virtual void RollbackAtomicL() = 0;
williamr@4
   392
	
williamr@4
   393
	/**
williamr@4
   394
    Returns ETrue if adapter supports streaming otherwise EFalse.
williamr@4
   395
	@param aItemSize size limit for stream usage
williamr@4
   396
    @return TBool ETrue for streaming support
williamr@4
   397
	@publishedPartner
williamr@4
   398
	@prototype
williamr@4
   399
    */
williamr@4
   400
	virtual TBool StreamingSupport( TInt& aItemSize ) = 0;
williamr@4
   401
	
williamr@4
   402
	/**
williamr@4
   403
    Called when stream returned from UpdateLeafObjectL or ExecuteCommandL has
williamr@4
   404
	been written to and committed. Not called when fetching item.
williamr@4
   405
	@publishedPartner
williamr@4
   406
	@prototype
williamr@4
   407
    */	
williamr@4
   408
	virtual void StreamCommittedL() = 0;
williamr@4
   409
	
williamr@4
   410
	/**
williamr@4
   411
	The function tells the adapter that all the commands of the message that
williamr@4
   412
	can be passed to the adapter have now been passed.  This indciates that
williamr@4
   413
	the adapter must supply status codes and results to any buffered commands.
williamr@4
   414
	This must be done at latest by the time this function returns.
williamr@4
   415
	This function is used at the end of SyncML messages, and during processing
williamr@4
   416
	of Atomic.   In the case of Atomic processing, the function will be
williamr@4
   417
	followed by a call to CommitAtomicL or RollbackAtomicL.
williamr@4
   418
	@publishedPartner
williamr@4
   419
	@prototype
williamr@4
   420
	*/
williamr@4
   421
	virtual void CompleteOutstandingCmdsL() = 0;
williamr@4
   422
	};
williamr@4
   423
williamr@4
   424
williamr@4
   425
class TSmlDmAccessTypes
williamr@4
   426
/**
williamr@4
   427
This class sets the access types which are allowed for a DM object.
williamr@4
   428
@publishedPartner
williamr@4
   429
@prototype
williamr@4
   430
*/
williamr@4
   431
	{
williamr@4
   432
public:
williamr@4
   433
	enum 
williamr@4
   434
	/**
williamr@4
   435
	This enumeration describes the possible access types for a DM object
williamr@4
   436
	@publishedPartner
williamr@4
   437
	@prototype
williamr@4
   438
	*/
williamr@4
   439
		{
williamr@4
   440
		/** The DM Command Add is permitted on this DM object */
williamr@4
   441
		EAccessType_Add		= 0x01,
williamr@4
   442
		/** The DM Command Copy is permitted on this DM object */
williamr@4
   443
		EAccessType_Copy	= 0x02,
williamr@4
   444
		/** The DM Command Delete is permitted on this DM object */
williamr@4
   445
		EAccessType_Delete	= 0x04,
williamr@4
   446
		/** The DM Command Exec is permitted on this DM object */
williamr@4
   447
		EAccessType_Exec	= 0x08,
williamr@4
   448
		/** The DM Command Get is permitted on this DM object */
williamr@4
   449
		EAccessType_Get		= 0x10,
williamr@4
   450
		/** The DM Command Replace is permitted on this DM object */
williamr@4
   451
		EAccessType_Replace = 0x20
williamr@4
   452
		};
williamr@4
   453
public:
williamr@4
   454
	inline TSmlDmAccessTypes();
williamr@4
   455
	inline void SetAdd();
williamr@4
   456
	inline void SetCopy();
williamr@4
   457
	inline void SetDelete();
williamr@4
   458
	inline void SetExec();
williamr@4
   459
	inline void SetGet();
williamr@4
   460
	inline void SetReplace();
williamr@4
   461
	inline TUint8 GetACL();
williamr@4
   462
	inline void Reset();
williamr@4
   463
	
williamr@4
   464
private:
williamr@4
   465
	TUint8 iACL;
williamr@4
   466
	};
williamr@4
   467
williamr@4
   468
williamr@4
   469
williamr@4
   470
class CSmlDmAdapter : public CBase, public MSmlDmAdapter
williamr@4
   471
/**
williamr@4
   472
The class CSmlDmAdapter is an ECOM interface for Device Management adapter plugins.
williamr@4
   473
This interface which must be implemented by every DM plugin adapter
williamr@4
   474
@publishedPartner
williamr@4
   475
@prototype
williamr@4
   476
*/
williamr@4
   477
williamr@4
   478
	{
williamr@4
   479
public:
williamr@4
   480
	inline static CSmlDmAdapter* NewL( const TUid& aImplementationUid,
williamr@4
   481
									   MSmlDmCallback& aDmCallback ); 
williamr@4
   482
	inline virtual ~CSmlDmAdapter();
williamr@4
   483
williamr@4
   484
protected:
williamr@4
   485
	inline CSmlDmAdapter(TAny* aEcomArguments);
williamr@4
   486
	inline MSmlDmCallback& Callback();
williamr@4
   487
	
williamr@4
   488
private:
williamr@4
   489
	/** ECOM framework requires this ID in object destructor
williamr@4
   490
	@internalTechnology
williamr@4
   491
	@prototype
williamr@4
   492
	*/
williamr@4
   493
	TUid iDtor_ID_Key;
williamr@4
   494
	
williamr@4
   495
	/** The DM Framework's callback for returning command results and data
williamr@4
   496
	@internalTechnology
williamr@4
   497
	@prototype
williamr@4
   498
	*/
williamr@4
   499
	MSmlDmCallback& iCallback;
williamr@4
   500
	};
williamr@4
   501
williamr@4
   502
class MSmlDmCallback
williamr@4
   503
/**
williamr@4
   504
This class is callback interface which is implemented in DM Module. An
williamr@4
   505
instance is passed by reference as an argument to the CSmlDmAdapter::NewL()
williamr@4
   506
function. This interface is mostly used for returning results and status
williamr@4
   507
codes for completed commands to the DM framework. The interface also has
williamr@4
   508
functionality for mapping LUIDs and fetching from other parts of the DM Tree.
williamr@4
   509
The adapter does not necessarily need to use any other functions but the
williamr@4
   510
SetStatusL and SetResultsL, if it handles the LUID mapping itself.
williamr@4
   511
@publishedPartner
williamr@4
   512
@prototype
williamr@4
   513
*/
williamr@4
   514
	{
williamr@4
   515
	public:
williamr@4
   516
	/**
williamr@4
   517
	The function is used to return the data in case of FetchLeafObjectL(),
williamr@4
   518
	FetchLeafObjectSizeL() and ChildURIListL() functions. It should not be
williamr@4
   519
	called where the DM command has failed, i.e. the error code returned in
williamr@4
   520
	SetStatusL is something other than EOk.
williamr@4
   521
	@param aResultsRef	Reference to correct command
williamr@4
   522
	@param aObject		The data which should be returned
williamr@4
   523
	@param aType			MIME type of the object
williamr@4
   524
	@publishedPartner
williamr@4
   525
	@prototype
williamr@4
   526
	*/
williamr@4
   527
	virtual void SetResultsL( TInt aResultsRef, CBufBase& aObject,
williamr@4
   528
							  const TDesC8& aType ) = 0;
williamr@4
   529
	
williamr@4
   530
	/**
williamr@4
   531
	The function is used to return the data in case of FetchLeafObjectL() and
williamr@4
   532
	ChildURIListL() functions, where the size of the data being returned is
williamr@4
   533
	large enough for the Adapter to stream it. This function should not be
williamr@4
   534
	called when command was failed, i.e. the error code returned in SetStatusL
williamr@4
   535
	is something other than EOk.
williamr@4
   536
	@param aResultsRef	Reference to correct command
williamr@4
   537
	@param aStream		Large data which should be returned, DM engine
williamr@4
   538
							closes stream when it has read all the data
williamr@4
   539
	@param aType			MIME type of the object
williamr@4
   540
	@publishedPartner
williamr@4
   541
	@prototype
williamr@4
   542
	*/
williamr@4
   543
	virtual void SetResultsL( TInt aResultsRef, RReadStream*& aStream,
williamr@4
   544
							  const TDesC8& aType ) = 0;
williamr@4
   545
williamr@4
   546
	/**
williamr@4
   547
	The function returns information about the Add,Update,Delete and Fetch
williamr@4
   548
	commands success to DM engine. The reference to correct command must be
williamr@4
   549
	used when calling the SetStatusL function, the reference is got from the
williamr@4
   550
	argument of the command functions. The SetStatusL function must be called
williamr@4
   551
	separately for every single command.
williamr@4
   552
	@param aStatusRef	Reference to correct command
williamr@4
   553
	@param aErrorCode	Information about the command success
williamr@4
   554
	@publishedPartner
williamr@4
   555
	@prototype
williamr@4
   556
	*/
williamr@4
   557
	virtual void SetStatusL( TInt aStatusRef,
williamr@4
   558
							 MSmlDmAdapter::TError aErrorCode ) = 0;
williamr@4
   559
williamr@4
   560
	/**
williamr@4
   561
	The function passes map information to DM Module. This function is called
williamr@4
   562
	for a new management object, both for node objects and for leaf objects.
williamr@4
   563
	In addition if ChildURIListL() function has returned new objects a mapping
williamr@4
   564
	information of the new objects must be passed. A mapping is treated as
williamr@4
   565
	inheritable. If the mapping is not set with this function, the mapping
williamr@4
   566
	LUID of the parent object is passed in following commands to the object.
williamr@4
   567
	@param aURI	URI of the object. 
williamr@4
   568
	@param aLUID	LUID of the object. LUID must contain the all information,
williamr@4
   569
					which is needed for retrieve the invidual object from the
williamr@4
   570
					database. Typically it is ID for the database table. In
williamr@4
   571
					more complicated structures it can be combination of IDs,
williamr@4
   572
					which represent path to the object.
williamr@4
   573
	@publishedPartner
williamr@4
   574
	@prototype
williamr@4
   575
	*/
williamr@4
   576
	virtual void SetMappingL( const TDesC8& aURI, const TDesC8& aLUID ) = 0;
williamr@4
   577
williamr@4
   578
	/**
williamr@4
   579
	The function is used to make a fetch to other adapters. The most common
williamr@4
   580
	use is to make a fetch to the AP adapter, because when managing the access
williamr@4
   581
	points, the data comes as URI. For example, there are ToNAPId field in
williamr@4
   582
	some adapters, and data to it can be something like AP/IAPidx, and then
williamr@4
   583
	the link to AP adapter is needed.
williamr@4
   584
	Using FetchLinkL causes the DM Framework to make a Get request to the
williamr@4
   585
	appropriate DM adapter.  The receiving adapter MUST complete the Get
williamr@4
   586
	request synchronously.
williamr@4
   587
	@param aURI		URI of the object. 
williamr@4
   588
	@param aData		Reference to data, i.e. data is returned here
williamr@4
   589
	@param aStatus	The status of fetch command is returned here
williamr@4
   590
	@publishedPartner
williamr@4
   591
	@prototype
williamr@4
   592
	*/
williamr@4
   593
	virtual void FetchLinkL( const TDesC8& aURI, CBufBase& aData,
williamr@4
   594
							 MSmlDmAdapter::TError& aStatus ) = 0;
williamr@4
   595
williamr@4
   596
	/**
williamr@4
   597
	The function returns the LUID which is mapped to aURI. If LUID is not
williamr@4
   598
	found, the function allocates a null length string, i.e. the function
williamr@4
   599
	allocates memory in every case.
williamr@4
   600
	@param aURI	URI of the object. 
williamr@4
   601
	@publishedPartner
williamr@4
   602
	@prototype
williamr@4
   603
	*/
williamr@4
   604
	virtual HBufC8* GetLuidAllocL( const TDesC8& aURI ) = 0;
williamr@4
   605
	
williamr@4
   606
	/**
williamr@4
   607
	The function is used to remove a mapped URI. Returns the error code about mapping removal.
williamr@4
   608
	@param aAdapterId	Settings Adapter id
williamr@4
   609
	@param aURI                 Mapped Uri
williamr@4
   610
	@param aChildAlso          Indicates the child nodes removal
williamr@4
   611
	@publishedPartner
williamr@4
   612
	@prototype
williamr@4
   613
	*/
williamr@4
   614
	virtual TInt RemoveMappingL( TUint32 aAdapterId, const TDesC8& aURI, TBool aChildAlso ) = 0;
williamr@4
   615
	};
williamr@4
   616
williamr@4
   617
williamr@4
   618
class MSmlDmDDFObject 
williamr@4
   619
/**
williamr@4
   620
This class structure includes DDF description. When used as an argument in DM
williamr@4
   621
Adapters Interface each adapter fills its own branch of DDF Tree to the data
williamr@4
   622
structure. 
williamr@4
   623
@publishedPartner
williamr@4
   624
@prototype
williamr@4
   625
*/
williamr@4
   626
	{
williamr@4
   627
	public:
williamr@4
   628
williamr@4
   629
	enum TDFFormat
williamr@4
   630
	/**
williamr@4
   631
	The possible formats of a node.
williamr@4
   632
	@publishedPartner
williamr@4
   633
	@prototype
williamr@4
   634
	*/
williamr@4
   635
		{
williamr@4
   636
		/** Base64 encoded */
williamr@4
   637
		EB64,
williamr@4
   638
		/** Boolean */
williamr@4
   639
		EBool,
williamr@4
   640
		/** Character data */
williamr@4
   641
		EChr,
williamr@4
   642
		/** Integer */
williamr@4
   643
		EInt,
williamr@4
   644
		/** A DM Tree interior node */
williamr@4
   645
		ENode,
williamr@4
   646
		/** No data */
williamr@4
   647
		ENull,
williamr@4
   648
		/** XML character data*/
williamr@4
   649
		EXml,
williamr@4
   650
		/** Binary data */
williamr@4
   651
		EBin,
williamr@4
   652
        /** Date data */     
williamr@4
   653
		EDate,
williamr@4
   654
		/** Time data */
williamr@4
   655
		ETime,
williamr@4
   656
		/** Float */ 
williamr@4
   657
		EFloat
williamr@4
   658
		};
williamr@4
   659
williamr@4
   660
	enum TOccurence
williamr@4
   661
	/**
williamr@4
   662
	The possible occurrences of a node.
williamr@4
   663
	@publishedPartner
williamr@4
   664
	@prototype
williamr@4
   665
	*/
williamr@4
   666
		{
williamr@4
   667
		/** The node appears exactly once */
williamr@4
   668
		EOne,
williamr@4
   669
		/** The node is optional and may appear zero or once */
williamr@4
   670
		EZeroOrOne,
williamr@4
   671
		/** The node is optional and may appear zero or more times */
williamr@4
   672
		EZeroOrMore,
williamr@4
   673
		/** The node is mandatory and may appear once or more times */
williamr@4
   674
		EOneOrMore,
williamr@4
   675
		/** The node is optional and may appear between once and 'N' times */
williamr@4
   676
		EZeroOrN,
williamr@4
   677
		/** The node is mandatory and may appear between once and 'N' times */
williamr@4
   678
		EOneOrN
williamr@4
   679
		};
williamr@4
   680
williamr@4
   681
	enum TScope
williamr@4
   682
	/**
williamr@4
   683
	The possible scopes of a node.
williamr@4
   684
	@publishedPartner
williamr@4
   685
	@prototype
williamr@4
   686
	*/
williamr@4
   687
		{
williamr@4
   688
		/** The node is permanent in the DM Tree */
williamr@4
   689
		EPermanent,
williamr@4
   690
		/** The node is created at run-time in the DM Tree */
williamr@4
   691
		EDynamic
williamr@4
   692
		};
williamr@4
   693
williamr@4
   694
	/**
williamr@4
   695
	The function sets permitted access types property to the object. Access
williamr@4
   696
	types property is a mandatory element. If this function is not called all
williamr@4
   697
	accesses are denied.
williamr@4
   698
	@param aAccessTypes	Access types property.
williamr@4
   699
	@publishedPartner
williamr@4
   700
	@prototype
williamr@4
   701
	*/
williamr@4
   702
	virtual void SetAccessTypesL( TSmlDmAccessTypes aAccessTypes )=0;
williamr@4
   703
williamr@4
   704
	/**
williamr@4
   705
	The function sets a default value property to the object. Default value
williamr@4
   706
	is not a mandatory element. If this function is not called, it means that
williamr@4
   707
	the default value property is not set at all.
williamr@4
   708
	@param aDefaultValue	Default value property.
williamr@4
   709
	@publishedPartner
williamr@4
   710
	@prototype
williamr@4
   711
	*/
williamr@4
   712
	virtual void SetDefaultValueL( const TDesC8& aDefaultValue )=0; 
williamr@4
   713
williamr@4
   714
	/**
williamr@4
   715
	The function sets a description property to the object. Description is
williamr@4
   716
	not a mandatory element. If this function is not called, it means that the
williamr@4
   717
	description property value is not set at all. 
williamr@4
   718
	@param aDescription	Description property.
williamr@4
   719
	@publishedPartner
williamr@4
   720
	@prototype
williamr@4
   721
	*/
williamr@4
   722
	virtual void SetDescriptionL( const TDesC8& aDescription )=0;
williamr@4
   723
williamr@4
   724
	/**
williamr@4
   725
	The function sets a format property to the object. Format is a mandatory
williamr@4
   726
	element. If this function is not called for node element, Format is set as
williamr@4
   727
	'node'. For leaf elements this function must be called.
williamr@4
   728
	@param aFormat	Format property.
williamr@4
   729
	@publishedPartner
williamr@4
   730
	@prototype
williamr@4
   731
	*/
williamr@4
   732
	virtual void SetDFFormatL( TDFFormat aFormat )= 0;
williamr@4
   733
williamr@4
   734
	/**
williamr@4
   735
	The function sets an occurence property to the object.  If this function
williamr@4
   736
	is not called, an occurence is set as TOccurence::EOne. 
williamr@4
   737
	@param aOccurence	Occurence property.
williamr@4
   738
	@publishedPartner
williamr@4
   739
	@prototype
williamr@4
   740
	*/
williamr@4
   741
	virtual void SetOccurenceL( TOccurence aOccurence ) =0;
williamr@4
   742
williamr@4
   743
	/**
williamr@4
   744
	The function sets a scope property to the object.  If this function is not
williamr@4
   745
	called, the scope is set as TScope::EDynamic. 
williamr@4
   746
	@param aScope	Scope property.
williamr@4
   747
	@publishedPartner
williamr@4
   748
	@prototype
williamr@4
   749
	*/
williamr@4
   750
	virtual void SetScopeL( TScope aScope ) = 0;
williamr@4
   751
williamr@4
   752
	/**
williamr@4
   753
	The function sets a title property to the object. Title is not a mandatory
williamr@4
   754
	element. If this function is not called, it means that a Title property
williamr@4
   755
	value is not set at all. 
williamr@4
   756
	@param aTitle	DFTitle property.
williamr@4
   757
	@publishedPartner
williamr@4
   758
	@prototype
williamr@4
   759
	*/
williamr@4
   760
	virtual void SetDFTitleL( const TDesC8& aTitle ) = 0;
williamr@4
   761
williamr@4
   762
	/**
williamr@4
   763
	The function sets a MIME type property to the object. MIME Type is a
williamr@4
   764
	mandatory element for leaf objects. If this function is not called (for
williamr@4
   765
	node elements), it means that the MIME type property value is not set at
williamr@4
   766
	all.
williamr@4
   767
	@param aMimeType	MIME type property.
williamr@4
   768
	@publishedPartner
williamr@4
   769
	@prototype
williamr@4
   770
	*/
williamr@4
   771
	virtual void AddDFTypeMimeTypeL( const TDesC8& aMimeType ) = 0;
williamr@4
   772
williamr@4
   773
	/**
williamr@4
   774
	The function sets an object as an object group. If this function is not
williamr@4
   775
	called, it means that the object is not an object group. Object group is a
williamr@4
   776
	term used with for the node in the management tree that is used as a
williamr@4
   777
	container for other object groups, container for management objects or a
williamr@4
   778
	container for both object groups and management objects. The term 'object
williamr@4
   779
	group' is not used when talked about the nodes which are part of
williamr@4
   780
	the management object itself.
williamr@4
   781
	@publishedPartner
williamr@4
   782
	@withdrawn - This is not supported.  MSmlDmDDFObject::AddChildObjectGroupL
williamr@4
   783
	*			   must be used instead of AddChildObjectL,SetAsObjectGroup.
williamr@4
   784
	*/
williamr@4
   785
	virtual void SetAsObjectGroup() = 0;
williamr@4
   786
williamr@4
   787
	/**
williamr@4
   788
	The function adds a child object and sets name of the URI segment, which
williamr@4
   789
	is used by the DM server. The highest object must be directly under root.
williamr@4
   790
	An adapter is not able to set properties of the root object. The aNodeName
williamr@4
   791
	argument should be an empty string, when the name is not fixed in DDF,
williamr@4
   792
	i.e. in case of dynamic nodes.
williamr@4
   793
	@param aNodeName	The name of the node
williamr@4
   794
	@publishedPartner
williamr@4
   795
	@prototype
williamr@4
   796
	*/
williamr@4
   797
	virtual MSmlDmDDFObject& AddChildObjectL(const TDesC8& aNodeName) = 0;
williamr@4
   798
williamr@4
   799
	/**
williamr@4
   800
	The function adds a child object, to be used as an object group. As an
williamr@4
   801
	object group, there is no node name (these nodes are 'unnamed' in the DDF).
williamr@4
   802
	Object group is a term used with for nodes in the management tree that are
williamr@4
   803
	used as a container for other object groups, container for management
williamr@4
   804
	objects or a container for both object groups and management objects. The
williamr@4
   805
	term 'object group' is not used when referring to nodes which are part
williamr@4
   806
	of the management object itself.
williamr@4
   807
	@publishedPartner
williamr@4
   808
	@prototype
williamr@4
   809
	*/
williamr@4
   810
	virtual MSmlDmDDFObject& AddChildObjectGroupL() = 0;
williamr@4
   811
	};
williamr@4
   812
williamr@4
   813
#include "smldmadapter.inl"
williamr@4
   814
williamr@4
   815
#endif // __SMLDMADAPTER_H__