omadm/omadmextensions/adapters/lawmodmadapter/inc/lawmodmadapter.h
branchRCL_3
changeset 70 5d5344402085
parent 65 450d1facd418
child 73 5042b6604f6f
equal deleted inserted replaced
65:450d1facd418 70:5d5344402085
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  LAWMO DM Adapter
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __LAWMODMADAPTER_H
       
    19 #define __LAWMOMADAPTER_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <smldmadapter.h>
       
    24 #include <centralrepository.h>
       
    25 #include <lawmoclient.h>
       
    26 #include <dcmoconst.h>
       
    27 
       
    28 const TInt KMaxBufferLength = 256;
       
    29 
       
    30 _LIT8( KMimeType, "text/plain" );
       
    31 _LIT8( KNSmlLAWMOAdapterTitle,      "LAWMO DM Adapter" );
       
    32 _LIT8( KNSmlTrue,					"true" );
       
    33 _LIT8( KNSmlFalse,					"false" );
       
    34 _LIT8( KLAWMODMAdapterVersion, "1.0" ); // Adapter version
       
    35 
       
    36 //DDF accepted DM-fieldnames
       
    37 _LIT8( KNSmlDdfState,				"State" );
       
    38 _LIT8( KNSmlDdfAvailWipeList,		"AvailableWipeList" );
       
    39 _LIT8( KNSmlDdfListItemName,		"ListItemName" );
       
    40 _LIT8( KNSmlDdfToBeWiped,           "ToBeWiped" );
       
    41 _LIT8( KNSmlDdfOperations,			"Operations" );
       
    42 _LIT8( KNSmlDdfFullyLock,		    "FullyLock" );
       
    43 _LIT8( KNSmlDdfPartLock,			"PartiallyLock" );
       
    44 _LIT8( KNSmlDdfUnlock,	            "UnLock" );
       
    45 _LIT8( KNSmlDdfFactoryReset,		"FactoryReset" );
       
    46 _LIT8( KNSmlDdfWipe,			    "Wipe" );
       
    47 _LIT8( KNSmlDdfEnable,				"Enable" );
       
    48 _LIT8( KNSmlDdfDisable,				"Disable" );
       
    49 _LIT8( KNSmlDdfOpExt,				"Ext" ); 
       
    50 _LIT8( KNSmlDdfOpExtWipeAll,	    "WipeAll" );
       
    51 _LIT8( KNSmlDdfLawMoConfig,         "LAWMOConfig" );
       
    52 
       
    53 //DDF DM-field descriptions
       
    54 _LIT8( KNSmlDdfStateDescription,             "State of LAWMO" );
       
    55 _LIT8( KNSmlDdfAWLDescription,               "Available WipeList node" );
       
    56 _LIT8( KNSmlDdfDynNodeDescription,           "Dynamic node" );
       
    57 _LIT8( KNSmlDdfListDescription,              "Name of List Item" );
       
    58 _LIT8( KNSmlDdfToWipeDescription,            "Item to be wiped or not" );
       
    59 _LIT8( KNSmlDdfOperationsDescription,        "Operations node" );
       
    60 _LIT8( KNSmlDdfFullLockDescription,          "Fully lock operation" );
       
    61 _LIT8( KNSmlDdfPartLockDescription,          "Partially lock operation" );
       
    62 _LIT8( KNSmlDdfUnlockDescription,            "Unlock operation" );
       
    63 _LIT8( KNSmlDdfFactResetDescription,         "Factory Reset operation" );
       
    64 _LIT8( KNSmlDdfWipeDescription,              "Wipe operation" );
       
    65 _LIT8( KNSmlDdfExtDescription ,              "Extra Operations " );
       
    66 _LIT8( KNSmlDdfOpExtDescription,             "Wipe All Operation" );
       
    67 _LIT8( KNSmlDdfLawConfigDescription,         "Configuration node" );
       
    68 
       
    69 
       
    70 _LIT8( KLawmoMatch2,                                          "/" );
       
    71 _LIT8( KSegmLawmo,                                            "AvailableWipeList/Ext/LAWMOConfig/Operations/State");
       
    72 _LIT8( KLawmoAvWipe,                                          "AvailableWipeList" );
       
    73 _LIT8( KLawmoAvWipe2,                                         "AvailableWipeList/*" );
       
    74 _LIT8( KSegmLawmo2,                                            "Messages");
       
    75 _LIT8( KSegmLawmo3,                                            "ListItemName/ToBeWiped");
       
    76 _LIT8( KLawmoOperationsMatch,                                   "Operations");
       
    77 _LIT8( KSegmLawmoOperations,                                    "FactoryReset/FullyLock/PartiallyLock/UnLock/Wipe");
       
    78 _LIT8( KLawmoOperationsExtMatch,                                "Ext");
       
    79 
       
    80 _LIT8( KLawmoMetatype,          "urn:oma:at:lawmo:1.0:OperationComplete" );
       
    81 _LIT8( KLawmoMetaformat,        "text/plain" );
       
    82 _LIT8( KLawmoMetamark,          "warning" );
       
    83 
       
    84 // CLASS DECLARATION
       
    85 
       
    86 /**
       
    87 * Adapter class
       
    88 * Provides DM adapter interface
       
    89 */
       
    90 class CLawmoDMAdapter : public CSmlDmAdapter
       
    91     {
       
    92     
       
    93     public: // Constructors, destructor
       
    94         /**
       
    95         * Create instance of CLawmoDMAdapter
       
    96         * @param aDmCallBack
       
    97         * @return Instance of CLawmoDMAdapter
       
    98         */    
       
    99         static CLawmoDMAdapter* NewL( MSmlDmCallback* aDmCallback );
       
   100 
       
   101         /**
       
   102         * Create instance of CLawmoDMAdapter
       
   103         * @param aDmCallBack
       
   104         * @return Instance of CLawmoDMAdapter
       
   105         */   
       
   106         static CLawmoDMAdapter* NewLC( MSmlDmCallback* aDmCallback );
       
   107 
       
   108         /**
       
   109         * C++ Destructor
       
   110         */
       
   111         virtual ~CLawmoDMAdapter();
       
   112 
       
   113     public:
       
   114 	    /**
       
   115 	    * The function returns current version of the DDF.
       
   116 	    * By asking current DDF versions from adapters DM Module can control
       
   117 	    * possible changes in the data structure and send the changed DDF
       
   118 	    * description to a management server.
       
   119 	    * This function is always called after DDFStructureL.
       
   120         * @param aVersion DDF version of the adapter. (filled by the adapter)
       
   121 	    * @publishedPartner
       
   122 	    * @prototype
       
   123 	    */
       
   124 	    void DDFVersionL( CBufBase& aVersion );
       
   125 	
       
   126 	    /**
       
   127 	    * The function for filling the DDF structure of the adapter
       
   128 	    * This function is only called once, immediately after the adapter is created.
       
   129 	    * @param aDDFObject	Reference to root object. A DM adapter starts filling
       
   130 		         the data structure by calling AddChildObjectL to the root object and
       
   131 				 so describes the DDF of the adapter. 
       
   132 	    * @publishedPartner
       
   133 	    * @prototype
       
   134 	    */
       
   135         void DDFStructureL( MSmlDmDDFObject& aDDF );
       
   136 	
       
   137 	    /**
       
   138 	    * The function creates new leaf objects, or replaces data in existing leaf
       
   139 	    * objects. The information about the success of the command should be
       
   140 	    * returned by calling SetStatusL function of MSmlDmCallback callback
       
   141 	    * interface. This makes it possible to buffer the commands. However, all
       
   142 	    * the status codes for buffered commands must be returned at the latest when
       
   143 	    * the adapter's CompleteOutstandingCmdsL() is called.
       
   144 	    * @param aURI			URI of the object
       
   145 	    * @param aLUID		LUID of the object (if the adapter has earlier returned a
       
   146 	 	     				LUID to the DM Module). For new objects, this is the LUID
       
   147  			    			inherited through the parent node.
       
   148  	    * @param aObject		Data of the object. 
       
   149 	    * @param aType		MIME type of the object
       
   150 	    * @param aStatusRef	Reference to correct command, i.e. this reference
       
   151 	 					must be used when calling the SetStatusL of this command
       
   152 	    * @publishedPartner
       
   153 	    * @prototype
       
   154 	    */
       
   155 	    void UpdateLeafObjectL( const TDesC8& aURI, 
       
   156 	                            const TDesC8& aLUID,
       
   157 			                    const TDesC8& aObject, 
       
   158 			 				    const TDesC8& aType,
       
   159 							    TInt aStatusRef 
       
   160 							  );
       
   161 		
       
   162         /**
       
   163 	    * The function creates new leaf objects, or replaces data in existing leaf
       
   164 	    * objects, in the case where data is large enough to be streamed. The
       
   165 	    * information about the success of the command should be returned by calling
       
   166 	    * SetStatusL function of MSmlDmCallback callback interface. This makes it
       
   167 	    * possible to buffer the commands.  However, all the status codes for buffered
       
   168 	    * commands must be returned at the latest when the CompleteOutstandingCmdsL()
       
   169 	    * of adapter is called.
       
   170 	    * @param aURI		URI of the object
       
   171 	    * @param aLUID		LUID of the object (if the adapter has earlier returned a
       
   172     						LUID to the DM Module). For new objects, this is the LUID
       
   173 	    					inherited through the parent node.
       
   174 	    * @param aStream	Data of the object. Adapter should create write stream
       
   175 		    				and return, when data is written to stream by DM agent,
       
   176 			    			StreamCommittedL() is called by DM engine
       
   177 	    * @param aType		MIME type of the object
       
   178 	    * @param aStatusRef	Reference to correct command, i.e. this reference
       
   179     						must be used when calling the SetStatusL of this
       
   180 		    				command.
       
   181 	    * @publishedPartner
       
   182 	    * @prototype
       
   183 	    */
       
   184 	    void UpdateLeafObjectL( const TDesC8& aURI, 
       
   185 	                            const TDesC8& aLUID,
       
   186 								RWriteStream*& aStream, 
       
   187 								const TDesC8& aType,
       
   188 		 						TInt aStatusRef 
       
   189 		 				      );
       
   190 	    
       
   191 	    
       
   192 	    TInt InternalUpdateObjectL( const TDesC8& aURI, 
       
   193                                     const TDesC8& /*aLUID*/,
       
   194                                     const TDesC8& aObject, 
       
   195                                     const TDesC8& /*aType*/,
       
   196                                     TInt aStatusRef );
       
   197 	    /**
       
   198 	    * The function deletes an object and its child objects. The SetStatusL
       
   199 	    * should be used as described in UpdateLeafObjectL()
       
   200 	    * @param aURI		URI of the object
       
   201 	    * @param aLUID		LUID of the object (if the adapter have earlier returned
       
   202     						LUID to the DM Module).
       
   203 	    * @param aStatusRef	Reference to correct command, i.e. this reference must
       
   204 						be used when calling the SetStatusL of this command.
       
   205         * @publishedPartner
       
   206 	    * @prototype
       
   207 	    */
       
   208 	    void DeleteObjectL( const TDesC8& aURI, 
       
   209 	                        const TDesC8& aLUID,
       
   210 							TInt aStatusRef 
       
   211 					      );
       
   212 	
       
   213 	    /**
       
   214 	    * The function fetches data of a leaf object. The SetStatusL should be used
       
   215 	    * as described in UpdateLeafObjectL(). The data is returned by using the
       
   216 	    * SetResultsL function of MSmlCallback callback interface, and may be streamed.
       
   217 	    * @param aURI			URI of the object
       
   218 	    * @param aLUID			LUID of the object (if the adapter have earlier
       
   219     							returned LUID to the DM Module).   
       
   220 	    * @param aType 			MIME type of the object
       
   221 	    * @param aResultsRef	Reference to correct results, i.e. this reference
       
   222     							must be used when returning the result by calling
       
   223 	    						the SetResultsL.
       
   224 	    * @param aStatusRef		Reference to correct command, i.e. this reference
       
   225 		    					must be used when calling the SetStatusL of this
       
   226     							command.
       
   227 	    * @publishedPartner
       
   228 	    * @prototype
       
   229 	    */
       
   230 	    void FetchLeafObjectL( const TDesC8& aURI, 
       
   231 	                           const TDesC8& aLUID,
       
   232 							   const TDesC8& aType, 
       
   233 							   TInt aResultsRef,
       
   234 							   TInt aStatusRef 
       
   235 							 );
       
   236 	    
       
   237 	    TInt InternalFetchObjectL(  const TDesC8& aURI, 
       
   238                                     const TDesC8& aLUID, const TDesC8& aType, 
       
   239                                     CBufFlat* aObject,
       
   240                                     TInt aStatusRef );
       
   241 	    
       
   242 	    /**
       
   243 	    * The function fetches the size of the data of a leaf object. The size is
       
   244 	    * in bytes, and must reflect the number of bytes that will be transferred
       
   245 	    * when the framework calls FetchLeafObjectL. The SetStatusL should be used
       
   246 	    * as described in FetchLeafObjectL(). The size value is returned by using
       
   247 	    * the SetResultsL function of MSmlCallback callback interface, and must be
       
   248 	    * a decimal integer expressed as a string, eg. "1234".
       
   249 	    * Results from this call MUST NOT be streamed.
       
   250 	    * @param aURI			URI of the object
       
   251 	    * @param aLUID			LUID of the object (if the adapter have earlier
       
   252     							returned LUID to the DM Module).   
       
   253 	    * @param aType 			MIME type of the object
       
   254 	    * @param aResultsRef	Reference to correct results, i.e. this reference
       
   255     							must be used when returning the result by calling
       
   256 	    						the SetResultsL.
       
   257 	    * @param aStatusRef		Reference to correct command, i.e. this reference
       
   258      							must be used when calling the SetStatusL of this
       
   259 	    						command.
       
   260 	    * @publishedPartner
       
   261 	    * @prototype
       
   262 	    */
       
   263 	    void FetchLeafObjectSizeL( const TDesC8& aURI, 
       
   264 	                               const TDesC8& aLUID,
       
   265 								   const TDesC8& aType, 
       
   266 								   TInt aResultsRef,
       
   267 								   TInt aStatusRef 
       
   268 								 );
       
   269 	    /**
       
   270 	    * The function fetches URI list. An adapter returns the list of URI segments
       
   271 	    * under the given URI be separated by slash ("/"). The URI segment names for
       
   272 	    * new objects must be given by the adapter.
       
   273 	    * The list is returned by calling the SetResultsL function of MSmlCallback
       
   274 	    * callback interface.	Results from this call MUST NOT be streamed.
       
   275 	    * @param aParentURI					URI of the parent object
       
   276 	    * @param aParentLUID				LUID of the parent object (if the
       
   277     										adapter have earlier returned LUID to
       
   278 		    								the DM Module).   
       
   279 	    * @param aPreviousURISegmentList	URI list with mapping LUID information,
       
   280 			    							which is known by DM engine. An adapter
       
   281 				    						can use this information when verifying
       
   282 					    					if old objects still exists. An adapter
       
   283 						    				also knows what objects are new to DM
       
   284 							    			engine and can provide LUID mapping for
       
   285 								    		them. aPreviousURISegmentList parameter
       
   286 									    	(see above) helps to recognise new
       
   287     										objects.
       
   288 	    * @param aResultsRef				Reference to correct results, i.e. this
       
   289     										reference must be used when returning
       
   290 	    									the result by calling the SetResultsL.
       
   291 	    * @param aStatusRef					Reference to correct command, i.e. this
       
   292 		    								reference must be used when calling the
       
   293 			    							SetStatusL of this command.
       
   294 	    * @publishedPartner
       
   295 	    * @prototype
       
   296 	    */
       
   297 	    void ChildURIListL( const TDesC8& aURI, 
       
   298 	                        const TDesC8& aLUID,
       
   299 					        const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList,
       
   300 					        TInt aResultsRef, 
       
   301 					        TInt aStatusRef 
       
   302 					      );
       
   303 	
       
   304         /**
       
   305 	    * The function adds node object. In some cases an implementation of the
       
   306 	    * function may be empty function, if the node object does not need concrete
       
   307 	    * database update. Still this function may be helpful to an adapter, i.e. in
       
   308 	    * passing mapping LUID of the node to DM Module. The SetStatusL should be
       
   309 	    * used as described in UpdateLeafObjectL()
       
   310 	    * @param aURI			URI of the object
       
   311 	    * @param aParentLUID	LUID of the parent object (if the adapter have
       
   312      							earlier returned LUID to the DM Module).   
       
   313 	    * @param aStatusRef		Reference to correct command, i.e. this reference
       
   314 		    					must be used when calling the SetStatusL of this
       
   315 			    				command.
       
   316 	    * @publishedPartner
       
   317 	    * @prototype
       
   318 	    */
       
   319 	    void AddNodeObjectL( const TDesC8& aURI, 
       
   320 	                         const TDesC8& aParentLUID,
       
   321 		  					 TInt aStatusRef 
       
   322 		  				   );
       
   323 
       
   324 	    /**
       
   325 	    * The function implements execute command. The information about the success
       
   326 	    * of the command should be returned by calling SetStatusL function of
       
   327 	    * MSmlDmCallback callback interface. This makes it possible to buffer the
       
   328 	    * commands.
       
   329 	    * However, all the status codes for buffered commands must be returned at
       
   330 	    * the latest when the CompleteOutstandingCmdsL() of adapter is called.
       
   331 	    * @param aURI			URI of the command
       
   332 	    * @param aLUID			LUID of the object (if the adapter have earlier
       
   333     							returned LUID to the DM Module).   
       
   334 	    * @param aArgument		Argument for the command
       
   335 	    * @param aType			MIME type of the object 
       
   336 	    * @param aStatusRef		Reference to correct command, i.e. this reference
       
   337     							must be used when calling the SetStatusL of this
       
   338 	    						command.
       
   339 	    * @publishedPartner
       
   340 	    * @prototype
       
   341 	    */
       
   342 	    void ExecuteCommandL( const TDesC8& aURI, 
       
   343 	                          const TDesC8& aLUID,
       
   344 							  const TDesC8& aArgument, 
       
   345 							  const TDesC8& aType,
       
   346 							  TInt aStatusRef 
       
   347 							);
       
   348 
       
   349 	    /**
       
   350 	    * The function implements execute command. The information about the
       
   351 	    * success of the command should be returned by calling SetStatusL function
       
   352 	    * of MSmlDmCallback callback interface. This makes it possible to buffer the
       
   353 	    * commands.
       
   354 	    * However, all the status codes for buffered commands must be returned at
       
   355 	    * the latest when the CompleteOutstandingCmdsL() of adapter is called.
       
   356 	    * @param aURI			URI of the command
       
   357 	    * @param aLUID			LUID of the object (if the adapter have earlier
       
   358     							returned LUID to the DM Module).   
       
   359 	    * @param aStream		Argument for the command. Adapter should create
       
   360 		    					write stream and return, when data is written to
       
   361 			    				stream by DM agent, StreamCommittedL() is called by
       
   362 				    			DM engine
       
   363 	    * @param aType			MIME type of the object 
       
   364 	    * @param aStatusRef		Reference to correct command, i.e. this reference
       
   365     							must be used when calling the SetStatusL of this
       
   366 	    						command.
       
   367 	    * @publishedPartner
       
   368 	    * @prototype
       
   369 	    */
       
   370 	    void ExecuteCommandL( const TDesC8& aURI, 
       
   371 	                          const TDesC8& aLUID,
       
   372 							  RWriteStream*& aStream, 
       
   373 							  const TDesC8& aType,
       
   374 							  TInt aStatusRef 
       
   375 							);
       
   376 
       
   377 	    /**
       
   378 	    * The function implements copy command. The information about the success of
       
   379 	    * the command should be returned by calling SetStatusL function of
       
   380 	    * MSmlDmCallback callback interface. This makes it possible to buffer the
       
   381 	    * commands.
       
   382 	    * However, all the status codes for buffered commands must be returned at
       
   383 	    * the latest when the CompleteOutstandingCmdsL() of adapter is called.
       
   384 	    * @param aTargetURI		Target URI for the command
       
   385 	    * @param aSourceLUID	LUID of the target object (if one exists, and if the adapter
       
   386     							has	earlier returned a LUID to the DM Module).   
       
   387 	    * @param aSourceURI		Source URI for the command
       
   388 	    * @param aSourceLUID	LUID of the source object (if the adapter has
       
   389     							earlier returned a LUID to the DM Module).   
       
   390 	    * @param aType			MIME type of the objects
       
   391 	    * @param aStatusRef		Reference to correct command, i.e. this reference
       
   392     							must be used when calling the SetStatusL of this
       
   393 	    						command.
       
   394 	    * @publishedPartner
       
   395 	    * @prototype
       
   396 	    */
       
   397 	    void CopyCommandL( const TDesC8& aTargetURI, 
       
   398 	                       const TDesC8& aTargetLUID,
       
   399 						   const TDesC8& aSourceURI, 
       
   400 						   const TDesC8& aSourceLUID,
       
   401 						   const TDesC8& aType, 
       
   402 						   TInt aStatusRef 
       
   403 						 );
       
   404 
       
   405 	    /**
       
   406 	    * The function indicates start of Atomic command.
       
   407 	    * @publishedPartner
       
   408 	    * @prototype
       
   409 	    */
       
   410 	    void StartAtomicL();
       
   411 	
       
   412 	    /**
       
   413 	    * The function indicates successful end of Atomic command. The adapter
       
   414 	    * should commit all changes issued between StartAtomicL() and
       
   415 	    * CommitAtomicL()
       
   416 	    * @publishedPartner
       
   417 	    * @prototype
       
   418 	    */
       
   419 	    void CommitAtomicL();
       
   420 	
       
   421 	    /**
       
   422 	    * The function indicates unsuccessful end of Atomic command. The adapter
       
   423 	    * should rollback all changes issued between StartAtomicL() and
       
   424 	    * RollbackAtomicL(). If rollback fails for a command, adapter should use
       
   425 	    * SetStatusL() to indicate it.
       
   426 	    * @publishedPartner
       
   427 	    * @prototype
       
   428 	    */
       
   429 	    void RollbackAtomicL();
       
   430 	
       
   431 	    /**
       
   432         * Returns ETrue if adapter supports streaming otherwise EFalse.
       
   433 	    * @param aItemSize size limit for stream usage
       
   434         * @return TBool ETrue for streaming support
       
   435 	    * @publishedPartner
       
   436 	    * @prototype
       
   437         */
       
   438 	    TBool StreamingSupport( TInt& aItemSize );
       
   439 	
       
   440 	    /**
       
   441         * Called when stream returned from UpdateLeafObjectL or ExecuteCommandL has
       
   442 	    * been written to and committed. Not called when fetching item.
       
   443 	    * @publishedPartner
       
   444 	    * @prototype
       
   445         */	
       
   446 	    void StreamCommittedL();
       
   447 	
       
   448 	    /**
       
   449 	    * The function tells the adapter that all the commands of the message that
       
   450 	    * can be passed to the adapter have now been passed.  This indicates that
       
   451 	    * the adapter must supply status codes and results to any buffered commands.
       
   452 	    * This must be done at latest by the time this function returns.
       
   453 	    * This function is used at the end of SyncML messages, and during processing
       
   454 	    * of Atomic.   In the case of Atomic processing, the function will be
       
   455 	    * followed by a call to CommitAtomicL or RollbackAtomicL.
       
   456 	    * @publishedPartner
       
   457 	    * @prototype
       
   458 	    */
       
   459 	    void CompleteOutstandingCmdsL();
       
   460 
       
   461     private: // New methods
       
   462     	
       
   463     	/**
       
   464 	    * The function fills the adapter node with the details
       
   465 	    * @publishedPartner
       
   466 	    * @prototype
       
   467 	    */
       
   468         void FillNodeInfoL( MSmlDmDDFObject& aDDFObject, 
       
   469                                             TSmlDmAccessTypes& aAccessTypes, 
       
   470                                             MSmlDmDDFObject::TScope aScope,
       
   471                                             MSmlDmDDFObject::TDFFormat aFormat, 
       
   472                                             MSmlDmDDFObject::TOccurence aOccurence,
       
   473                                             const TDesC8& aDescription,
       
   474                                             const TDesC8& aMIMEType );
       
   475         
       
   476         /**
       
   477 	    * This function constructs the DDFnode with the details 
       
   478 	    * @publishedPartner
       
   479 	    * @prototype
       
   480 	    */ 
       
   481         void FillLAWMODDFL(MSmlDmDDFObject& aDDF);   
       
   482         
       
   483         // Fills the DDFnode details with the dynamic node info
       
   484         
       
   485         void FillDynamicNodeL(MSmlDmDDFObject& aDDF); 
       
   486         
       
   487         /**
       
   488     	* Maps a system wide error code to a TError.
       
   489     	* @param aError A system wide error code.
       
   490     	* @return A TError value depending on aError.
       
   491     	*/
       
   492     	CSmlDmAdapter::TError MapErrorToStatus( TInt aError ) const;    
       
   493     	
       
   494     	// Issues a lock request using tarm 3rd party api
       
   495     	TLawMoStatus LockDeviceL();
       
   496     	
       
   497     	// Issues a Unlock request using tarm 3rd party api
       
   498     	TLawMoStatus UnLockDeviceL();
       
   499     	
       
   500     	// Gets the current Lawmo state store in the cenrep
       
   501     	TLawMoStatus GetStateL(TInt& aState);
       
   502                          	
       
   503     private: // Constructor
       
   504         /**
       
   505         * Symbian 2nd phase constructor
       
   506         */
       
   507         void ConstructL();
       
   508 
       
   509         /**
       
   510         * C++ Constructor
       
   511         */    
       
   512         CLawmoDMAdapter( TAny* aEcomArguments );
       
   513         
       
   514         // Sends the Generic alert for wipe command
       
   515         void SendGenericAlertL();
       
   516         
       
   517         // Updates the current server id to the store
       
   518         void SetCurrentServerIdL();
       
   519         
       
   520         // Checks if the current profile doing the operation
       
   521         // is a factory profile
       
   522         TBool IsFactoryProfileL();
       
   523         
       
   524     private: // Data
       
   525         
       
   526         enum TNodeIdentifier
       
   527             {
       
   528             ENodeLawMo = 0,
       
   529             ENodeState,
       
   530             ENodeAvWipeList,
       
   531             ENodeDynamic,
       
   532             ENodeItemName,
       
   533             ENodeToBeWiped,
       
   534             ENodeOperations,
       
   535             ENodePartLock,
       
   536             ENodeUnlock,
       
   537             ENodeWipe,
       
   538             ENodeExt,
       
   539             ENodeWipeAll,
       
   540             ENodeNotUsedAndAlwaysLast
       
   541             };
       
   542         
       
   543         enum TLawmoState
       
   544             {
       
   545             EFullLocked = 10,
       
   546             EPartialLocked = 20,
       
   547             EUnlocked = 30
       
   548             };
       
   549         
       
   550         RLawmoClient ilawmoSession;
       
   551         TBool iConnected;
       
   552         TBuf8<KMaxBufferLength> iRootNode;        
       
   553 
       
   554     private:        
       
   555         // Gets the current node based on the URI
       
   556         TNodeIdentifier GetNodeIdentifier(const TDesC8& aURI);
       
   557         
       
   558     };
       
   559 
       
   560 #endif // __DCMODMADAPTER_H
       
   561 
       
   562 // End Of File