syncmlfw/dm/dmutils/inc/nsmldmtreedtd.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2005 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:  DM Utilities
       
    15 *
       
    16 */
       
    17 
       
    18  
       
    19 
       
    20 #ifndef __NSMLDMTREEDTD_H
       
    21 #define __NSMLDMTREEDTD_H
       
    22 
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 #include <s32file.h>
       
    26 #include <smldmadapter.h>
       
    27 
       
    28 
       
    29 _LIT8( KNSmlDmTreeDTDVersion, "1.1" ); 
       
    30 
       
    31 //XML generator flags
       
    32 _LIT8( KNSmlDDFMgmtTree, "<MgmtTree>" ); 
       
    33 _LIT8( KNSmlDDFMgmtTreeEnd, "</MgmtTree>" ); 
       
    34 _LIT8( KNSmlDDFNode, "<Node>" ); 
       
    35 _LIT8( KNSmlDDFNodeEnd, "</Node>" ); 
       
    36 _LIT8( KNSmlDDFNodeName, "<NodeName>" ); 
       
    37 _LIT8( KNSmlDDFNodeNameEnd, "</NodeName>" ); 
       
    38 _LIT8( KNSmlDDFDFProperties, "<DFProperties>" ); 
       
    39 _LIT8( KNSmlDDFDFPropertiesEnd, "</DFProperties>" ); 
       
    40 _LIT8( KNSmlDDFPath, "<Path>" ); 
       
    41 _LIT8( KNSmlDDFPathEnd, "</Path>" ); 
       
    42 _LIT8( KNSmlDDFValue, "<Value>" ); 
       
    43 _LIT8( KNSmlDDFValueEnd, "</Value>" ); 
       
    44 _LIT8( KNSmlDDFVerDTD, "<VerDTD>" );
       
    45 _LIT8( KNSmlDDFVerDTDEnd, "</VerDTD>" ); 
       
    46 _LIT8( KNSmlDDFMan, "<Man>" );
       
    47 _LIT8( KNSmlDDFManEnd, "</Man>" );
       
    48 _LIT8( KNSmlDDFMod, "<Mod>" );
       
    49 _LIT8( KNSmlDDFModEnd, "</Mod>" );
       
    50 _LIT8( KNSmlDDFAccessType, "<AccessType>" );
       
    51 _LIT8( KNSmlDDFAccessTypeEnd, "</AccessType>" );
       
    52 _LIT8( KNSmlDDFDefaultValue, "<DefaultValue>" );
       
    53 _LIT8( KNSmlDDFDefaultValueEnd, "</DefaultValue>" );
       
    54 _LIT8( KNSmlDDFDescription, "<Description>" );
       
    55 _LIT8( KNSmlDDFDescriptionEnd, "</Description>" );
       
    56 _LIT8( KNSmlDDFDFTitle, "<DFTitle>" );
       
    57 _LIT8( KNSmlDDFDFTitleEnd, "</DFTitle>" );
       
    58 _LIT8( KNSmlDDFDFType, "<DFType>" );
       
    59 _LIT8( KNSmlDDFDFTypeEnd, "</DFType>" );
       
    60 _LIT8( KNSmlDDFDFFormat, "<DFFormat>" );
       
    61 _LIT8( KNSmlDDFDFFormatEnd, "</DFFormat>" );
       
    62 _LIT8( KNSmlDDFFormatB64, "<b64/>" );
       
    63 _LIT8( KNSmlDDFFormatDate, "<date/>" );
       
    64 _LIT8( KNSmlDDFFormatTime, "<time/>" );
       
    65 _LIT8( KNSmlDDFFormatFloat, "<float/>" );
       
    66 _LIT8( KNSmlDDFFormatBool, "<bool/>" );
       
    67 _LIT8( KNSmlDDFFormatChr, "<chr/>" );
       
    68 _LIT8( KNSmlDDFFormatInt, "<int/>" );
       
    69 _LIT8( KNSmlDDFFormatNode, "<node/>" );
       
    70 _LIT8( KNSmlDDFFormatNull, "<null/>" );
       
    71 _LIT8( KNSmlDDFFormatXml, "<xml/>" );
       
    72 _LIT8( KNSmlDDFFormatBin, "<bin/>" );
       
    73 _LIT8( KNSmlDDFAccessTypeAdd, "<Add/>" );
       
    74 _LIT8( KNSmlDDFAccessTypeDelete, "<Delete/>" );
       
    75 _LIT8( KNSmlDDFAccessTypeGet, "<Get/>" );
       
    76 _LIT8( KNSmlDDFAccessTypeReplace, "<Replace/>" );
       
    77 _LIT8( KNSmlDDFAccessTypeExec, "<Exec/>" );
       
    78 _LIT8( KNSmlDDFAccessTypeCopy, "<Copy/>" );
       
    79 _LIT8( KNSmlDDFOccurrence, "<Occurrence>" );
       
    80 _LIT8( KNSmlDDFOccurrenceEnd, "</Occurrence>" ); 
       
    81 _LIT8( KNSmlDDFOccurrenceOne, "<One/>" );
       
    82 _LIT8( KNSmlDDFOccurrenceZeroOrOne, "<ZeroOrOne/>" );
       
    83 _LIT8( KNSmlDDFOccurrenceZeroOrMore, "<ZeroOrMore/>" );
       
    84 _LIT8( KNSmlDDFOccurrenceOneOrMore, "<OneOrMore/>" );
       
    85 _LIT8( KNSmlDDFOccurrenceZeroOrN, "<ZeroOrN/>" );
       
    86 _LIT8( KNSmlDDFOccurrenceOneOrN, "<OneOrN/>" );
       
    87 _LIT8( KNSmlDDFScope, "<Scope>" );
       
    88 _LIT8( KNSmlDDFScopeEnd, "</Scope>" );
       
    89 _LIT8( KNSmlDDFScopePermanent, "<Permanent/>" );
       
    90 _LIT8( KNSmlDDFScopeDynamic, "<Dynamic/>" );
       
    91 _LIT8( KNSmlDDFMIME, "<MIME>" );
       
    92 _LIT8( KNSmlDDFMIMEEnd, "</MIME>" );
       
    93 
       
    94 _LIT8( KNSmlDDFRTProperties, "<RTProperties>" ); 
       
    95 _LIT8( KNSmlDDFRTPropertiesEnd, "</RTProperties>" ); 
       
    96 _LIT8( KNSmlDDFACL, "<ACL>" ); 
       
    97 _LIT8( KNSmlDDFACLEnd, "</ACL>" ); 
       
    98 _LIT8( KNSmlDDFFormat, "<Format>" ); 
       
    99 _LIT8( KNSmlDDFFormatEnd, "</Format>" ); 
       
   100 _LIT8( KNSmlDDFName, "<Name>" ); 
       
   101 _LIT8( KNSmlDDFNameEnd, "</Name>" ); 
       
   102 _LIT8( KNSmlDDFSize, "<Size>" ); 
       
   103 _LIT8( KNSmlDDFSizeEnd, "</Size>" );
       
   104 _LIT8( KNSmlDDFTitle, "<Title>" ); 
       
   105 _LIT8( KNSmlDDFTitleEnd, "</Title>" );
       
   106 _LIT8( KNSmlDDFTStamp, "<TStamp>" ); 
       
   107 _LIT8( KNSmlDDFTStampEnd, "</TStamp>" );
       
   108 _LIT8( KNSmlDDFType, "<Type>" ); 
       
   109 _LIT8( KNSmlDDFTypeEnd, "</Type>" );
       
   110 _LIT8( KNSmlDDFVerNo, "<VerNo>" ); 
       
   111 _LIT8( KNSmlDDFVerNoEnd, "</VerNo>" );
       
   112 
       
   113 _LIT8( KNSmlDevInfoMan, "DevInfo/Man" );
       
   114 _LIT8( KNSmlDevInfoMod, "DevInfo/Mod" );
       
   115 
       
   116 _LIT( KNSmlTreeDTDPanic, "NSmlDMTreeDTD" );
       
   117 
       
   118 _LIT8( KNSmlDDFCaseSense, "CS" );
       
   119 _LIT8( KNSmlDDFCaseInSense, "CIS" );
       
   120 enum TNSmlDdfWBXMLTags 
       
   121 	{
       
   122 EDDFMgmtTree = 5,
       
   123 EDDFMgmtTreeEnd,
       
   124 EDDFNode,
       
   125 EDDFNodeEnd,
       
   126 EDDFNodeName,
       
   127 EDDFNodeNameEnd,        //10
       
   128 EDDFDFProperties,
       
   129 EDDFDFPropertiesEnd,
       
   130 EDDFPath,
       
   131 EDDFPathEnd,
       
   132 EDDFValue,              //15
       
   133 EDDFValueEnd,
       
   134 EDDFVerDTD,
       
   135 EDDFVerDTDEnd,
       
   136 EDDFMan,
       
   137 EDDFManEnd,             //20
       
   138 EDDFMod,
       
   139 EDDFModEnd,
       
   140 EDDFAccessType,
       
   141 EDDFAccessTypeEnd,
       
   142 EDDFDefaultValue,       //25
       
   143 EDDFDefaultValueEnd,
       
   144 EDDFDescription,
       
   145 EDDFDescriptionEnd,
       
   146 EDDFDFTitle,
       
   147 EDDFDFTitleEnd,         //30
       
   148 EDDFDFType,
       
   149 EDDFDFTypeEnd,
       
   150 EDDFDFFormat,
       
   151 EDDFDFFormatEnd,
       
   152 EDDFFormatB64,          //35
       
   153 EDDFFormatBool,
       
   154 EDDFFormatChr,
       
   155 EDDFFormatInt,
       
   156 EDDFFormatNode,
       
   157 EDDFFormatNull,         //40
       
   158 EDDFFormatXml,
       
   159 EDDFFormatBin,
       
   160 EDDFFormatDate,
       
   161 EDDFFormatTime,
       
   162 EDDFFormatFloat,
       
   163 EDDFAccessTypeAdd,
       
   164 EDDFAccessTypeDelete,
       
   165 EDDFAccessTypeGet,      //45
       
   166 EDDFAccessTypeReplace,
       
   167 EDDFAccessTypeExec,
       
   168 EDDFAccessTypeCopy,
       
   169 EDDFOccurrence,
       
   170 EDDFOccurrenceEnd,      //50
       
   171 EDDFOccurrenceOne,
       
   172 EDDFOccurrenceZeroOrOne,
       
   173 EDDFOccurrenceZeroOrMore,
       
   174 EDDFOccurrenceOneOrMore,
       
   175 EDDFOccurrenceZeroOrN,  //55
       
   176 EDDFOccurrenceOneOrN,
       
   177 EDDFScope,
       
   178 EDDFScopeEnd,
       
   179 EDDFScopePermanent,
       
   180 EDDFScopeDynamic,       //60
       
   181 EDDFMIME,
       
   182 EDDFMIMEEnd,
       
   183 EDDFRTProperties,
       
   184 EDDFRTPropertiesEnd,
       
   185 EDDFACL,                //65
       
   186 EDDFACLEnd,
       
   187 EDDFFormat,
       
   188 EDDFFormatEnd,
       
   189 EDDFName,
       
   190 EDDFNameEnd,            //70
       
   191 EDDFSize,
       
   192 EDDFSizeEnd,
       
   193 EDDFTitle,
       
   194 EDDFTitleEnd,
       
   195 EDDFTStamp,             //75
       
   196 EDDFTStampEnd,
       
   197 EDDFType,
       
   198 EDDFTypeEnd,
       
   199 EDDFVerNo,
       
   200 EDDFVerNoEnd,            //80
       
   201 EDDFStaticLevel,
       
   202 EDDFStaticLevelEnd,
       
   203 EDDFAdapterUid,
       
   204 EDDFAdapterUidEnd,
       
   205 EDDFHostServerId,
       
   206 EDDFHostServerIdEnd
       
   207 	};
       
   208 
       
   209 enum TNSmlDmDDFFormat 
       
   210 	{
       
   211 	ENSmlDmDDFLeaf,
       
   212 	ENSmlDmDDFNode,
       
   213 	ENSmlDmDDFNotFound
       
   214 	};
       
   215 
       
   216 
       
   217 //class forwards
       
   218 class CNSmlDmNodeList;
       
   219 
       
   220 // ===========================================================================
       
   221 //PCData element
       
   222 // ===========================================================================
       
   223 /**
       
   224 * CNSmlDmPcdata is data element in DDF tree structure
       
   225 *
       
   226 *  @since
       
   227 */
       
   228 class CNSmlDmPcdata : public CBase
       
   229 	{
       
   230 public:
       
   231 
       
   232 	/**
       
   233 	* Length of the data in this PCDATA structure
       
   234 	*/
       
   235 	TInt	iLength;
       
   236 	
       
   237 	/**
       
   238 	* Pointer to the data
       
   239 	*/
       
   240 	TAny*	iContent;       
       
   241 
       
   242 public:
       
   243 
       
   244 	/**
       
   245 	* Constructor
       
   246 	*/
       
   247 	CNSmlDmPcdata();
       
   248 
       
   249 	/**
       
   250 	* Destructor
       
   251 	*/
       
   252 	~CNSmlDmPcdata();
       
   253 	
       
   254 	/**
       
   255 	* Frees content
       
   256 	*/
       
   257 	void FreeContent();
       
   258 	
       
   259 	/**
       
   260 	* Sets data
       
   261 	* @param	aData				Data to be set
       
   262 	*/
       
   263 	void DataL( const TDesC8& aData );
       
   264 
       
   265 
       
   266 	/**
       
   267 	* Compare data
       
   268 	* @param	aStr				Data start  pointer
       
   269 	* @param	aLength				Data length
       
   270 	* @return						ETrue if data is similar to iContent
       
   271 	*/
       
   272 	TBool Compare(const TUint8* aStr, TInt aLength);
       
   273 
       
   274 private:
       
   275 	};
       
   276 
       
   277 
       
   278 // ===========================================================================
       
   279 // RTProperties 
       
   280 // ===========================================================================
       
   281 /**
       
   282 * CNSmlDmRTProperties contains runtime properties element in DDF tree
       
   283 * structure
       
   284 *
       
   285 *  @since
       
   286 */
       
   287 class CNSmlDmRTProperties : public CBase
       
   288 	{
       
   289 public:
       
   290 
       
   291 	/**
       
   292 	* ACL Property
       
   293 	*/
       
   294 	CNSmlDmPcdata iACL;
       
   295 
       
   296 	/**
       
   297 	* Name property
       
   298 	*/
       
   299 	CNSmlDmPcdata iName;				
       
   300 
       
   301 	/**
       
   302 	* Format property
       
   303 	*/
       
   304 	MSmlDmDDFObject::TDFFormat	iFormat;
       
   305 
       
   306 	/**
       
   307 	* Size property, optional
       
   308 	*/
       
   309 	CNSmlDmPcdata* iSize;		
       
   310 
       
   311 	/**
       
   312 	* Title property, optional
       
   313 	*/
       
   314 	CNSmlDmPcdata* iTitle;		
       
   315 
       
   316 	/**
       
   317 	* TimeStamp property, optional
       
   318 	*/
       
   319 	CNSmlDmPcdata* iTStamp;		
       
   320 	
       
   321 	/**
       
   322 	* Type property, optional
       
   323 	*/
       
   324 	CNSmlDmPcdata* iType;		
       
   325 
       
   326 	/**
       
   327 	* Version number property, optional
       
   328 	*/
       
   329 	CNSmlDmPcdata* iVerNo;		
       
   330 
       
   331 public:
       
   332 	/**
       
   333 	* Destructor
       
   334 	*/
       
   335 	virtual ~CNSmlDmRTProperties();
       
   336 
       
   337 	/**
       
   338 	* Generates xml of elelment
       
   339 	* @param	aObject			Buffer to write xml
       
   340 	*/
       
   341 	void GenerateRTPropertiesL(CBufBase& aObject);
       
   342 
       
   343 private:
       
   344 	/**
       
   345 	* Constructor
       
   346 	*/
       
   347 	CNSmlDmRTProperties();
       
   348 	};
       
   349 
       
   350 
       
   351 
       
   352 // ===========================================================================
       
   353 // DFProperties 
       
   354 // ===========================================================================
       
   355 /**
       
   356 * CNSmlDmDFProperties contains description framwork properties element in
       
   357 * DDF tree structure
       
   358 *
       
   359 *  @since
       
   360 */
       
   361 class CNSmlDmDFProperties : public CBase
       
   362 	{
       
   363 public:
       
   364 
       
   365 	/**
       
   366 	* Accestype property of the node
       
   367 	*/
       
   368 	TUint8 iAccessTypes;
       
   369 
       
   370 	/**
       
   371 	* Default value property of the node, optional
       
   372 	*/
       
   373 	CNSmlDmPcdata* iDefaultValue;					
       
   374 
       
   375 	/**
       
   376 	* Description property of the node, optional
       
   377 	*/
       
   378 	CNSmlDmPcdata* iDescription;	
       
   379 
       
   380 	/**
       
   381 	* Format property of the node
       
   382 	*/
       
   383 	MSmlDmDDFObject::TDFFormat iDFFormat;		
       
   384 
       
   385 	/**
       
   386 	* Occurrence property of the node, optional
       
   387 	*/
       
   388 	MSmlDmDDFObject::TOccurence iOccurrence;
       
   389 
       
   390 	/**
       
   391 	* Scope property of the node, optional
       
   392 	*/
       
   393 	MSmlDmDDFObject::TScope iScope;	
       
   394 
       
   395 	/**
       
   396 	* Title property of the node, optional
       
   397 	*/
       
   398 	CNSmlDmPcdata* iDFTitle;
       
   399 			
       
   400 	/**
       
   401 	* Type property of the node, optional
       
   402 	*/
       
   403 	CNSmlDmPcdata* iDFType;
       
   404 
       
   405     TBool iCaseSense;
       
   406 public:
       
   407 
       
   408 	/**
       
   409 	* Desstructor
       
   410 	*/
       
   411 	~CNSmlDmDFProperties();
       
   412 
       
   413 	/**
       
   414 	* Constructor
       
   415 	*/
       
   416 	CNSmlDmDFProperties();
       
   417 
       
   418 	/**
       
   419 	* Generates xml of elelment
       
   420 	* @param	aObject			Buffer to write xml
       
   421 	*/
       
   422 	void GenerateDFPropertiesL(CBufBase& aObject);
       
   423 
       
   424 	/**
       
   425 	* Generates wbxml of elelment
       
   426 	* @param	aObject			Buffer to write xml
       
   427 	*/
       
   428 	void GenerateDFPropertiesWBXMLL(RWriteStream& aStream);
       
   429 
       
   430 private:
       
   431 	/**
       
   432 	* Generates xml of elelment
       
   433 	* @param	aObject			Buffer to write xml
       
   434 	*/
       
   435 	void GenerateDFPropsSubmethodL(CBufBase& aObject);
       
   436 	};
       
   437 
       
   438 
       
   439 // ===========================================================================
       
   440 // CNSmlDmNode 
       
   441 // ===========================================================================
       
   442 /**
       
   443 * CNSmlDmNode is node object in DDF structure
       
   444 *
       
   445 *  @since
       
   446 */
       
   447 class CNSmlDmNode : public CBase, public MSmlDmDDFObject
       
   448 	{
       
   449 public:
       
   450 	/**
       
   451 	* Path of the node, optional
       
   452 	*/
       
   453 	CNSmlDmPcdata* iPath;
       
   454 
       
   455 	/**
       
   456 	* Run time properties of the node, optional
       
   457 	*/
       
   458 	CNSmlDmRTProperties* iRTProperties;
       
   459 	
       
   460 	/**
       
   461 	* Description framework properties of the node
       
   462 	*/
       
   463 	CNSmlDmDFProperties iDFProperties;
       
   464 
       
   465 	/**
       
   466 	* Children of the node, optional
       
   467 	* (if null -> leaf otherwise interior node)
       
   468 	*/
       
   469 	CNSmlDmNodeList* iNodeListPtr;
       
   470 	
       
   471 	/**
       
   472 	* Default value of the node, optional
       
   473 	*/
       
   474 	CNSmlDmPcdata* iValue;
       
   475 
       
   476 	/**
       
   477 	* Name of the node
       
   478 	*/
       
   479 	CNSmlDmPcdata iNodeName;
       
   480 	
       
   481 	/**
       
   482 	* True if node is static level, i.e. before firs nameless level
       
   483 	*/
       
   484 	TBool iStaticLevel;
       
   485 
       
   486 	/**
       
   487 	* Implementation uid of adapter which handles the current node
       
   488 	*/
       
   489 	TUint32 iImplUid;
       
   490 
       
   491 	/**
       
   492 	* Host server id which handles adapter
       
   493 	*/
       
   494 	TUint8 iHostServerId;
       
   495 
       
   496 public:
       
   497 
       
   498 	/**
       
   499 	* Constructor
       
   500 	*/
       
   501 	CNSmlDmNode();
       
   502 
       
   503 	/**
       
   504 	* Desstructor
       
   505 	*/
       
   506 	virtual ~CNSmlDmNode();
       
   507 	
       
   508 	/**
       
   509 	* Sets access types to node
       
   510 	* @param	aAccessTypes		Access types
       
   511 	*/
       
   512 	void SetAccessTypesL( TSmlDmAccessTypes aAccessTypes );
       
   513 
       
   514 	/**
       
   515 	* Sets default value to node
       
   516 	* @param	aDefaultValue		Default value
       
   517 	*/
       
   518 	void SetDefaultValueL( const TDesC8& aDefaultValue ); 
       
   519 
       
   520 	/**
       
   521 	* Sets description to node
       
   522 	* @param	aDescription		Description
       
   523 	*/
       
   524 	void SetDescriptionL( const TDesC8& aDescription );
       
   525 
       
   526 	/**
       
   527 	* Sets format of the node
       
   528 	* @param	aFormat				Format
       
   529 	*/
       
   530 	void SetDFFormatL( TDFFormat aFormat );
       
   531 	
       
   532 	/**
       
   533 	* Sets occurrence of the node
       
   534 	* @param	aOccurence			Occurrence
       
   535 	*/
       
   536 	void SetOccurenceL( TOccurence aOccurence );
       
   537 
       
   538 
       
   539     /**
       
   540 	* Sets case sense of the node
       
   541 	* @param	aOccurence			Occurrence
       
   542 	*/
       
   543 	void SetCaseSenseL( TBool aCaseSense );
       
   544 
       
   545 	/**
       
   546 	* Sets scope of the node
       
   547 	* @param	aScope			Scope
       
   548 	*/
       
   549 	void SetScopeL( TScope aScope );
       
   550 
       
   551 	/**
       
   552 	* Sets Title of the node
       
   553 	* @param	aTitle			Title
       
   554 	*/
       
   555 	void SetDFTitleL( const TDesC8& aTitle );
       
   556 
       
   557 	/**
       
   558 	* Sets mime type of the node
       
   559 	* @param	aMimeType 		Mime type
       
   560 	*/
       
   561 	void AddDFTypeMimeTypeL( const TDesC8& aMimeType );
       
   562 	
       
   563 	/**
       
   564 	* Sets the object as object group. Inherited from MSmlDmDDFObject
       
   565 	* but not used anymore
       
   566 	*/
       
   567 	void SetAsObjectGroup();
       
   568 
       
   569 	/**
       
   570 	* Compare data
       
   571 	* @param	aNodeName			Name of the child node
       
   572 	* @return						Reference to created child object
       
   573 	*/
       
   574 	MSmlDmDDFObject& AddChildObjectL(const TDesC8& aNodeName);
       
   575 
       
   576 	/**
       
   577 	* Add nameless child to node
       
   578 	* @return						Reference to created child object
       
   579 	*/
       
   580 	MSmlDmDDFObject& AddChildObjectGroupL();
       
   581 	
       
   582 
       
   583 	/**
       
   584 	* Pointer to parent node
       
   585 	*/
       
   586 	CNSmlDmNode* iParent;
       
   587 
       
   588 
       
   589 private:
       
   590 	};
       
   591 
       
   592 
       
   593 // ===========================================================================
       
   594 // CNSmlDmNodeList 
       
   595 // ===========================================================================
       
   596 /**
       
   597 * CNSmlDmNodeList is node list object in DDF structure and it contains pointer
       
   598 * to node and pointer to next CNSmlDmNodeList object
       
   599 *
       
   600 *  @since
       
   601 */
       
   602 class CNSmlDmNodeList : public CBase
       
   603 	{
       
   604 public:
       
   605 	/**
       
   606 	* Constructor
       
   607 	*/
       
   608 	CNSmlDmNodeList();
       
   609 	
       
   610 	/**
       
   611 	* Pointer to node
       
   612 	*/
       
   613 	CNSmlDmNode* iNode;
       
   614 
       
   615 	/**
       
   616 	* Pointer to next list item
       
   617 	*/
       
   618 	CNSmlDmNodeList* iNext;
       
   619 
       
   620 	/**
       
   621 	* Generates nodelist xml to aObject
       
   622 	* @param	aObject			Buffer to write xml
       
   623 	*/
       
   624 	void GenerateNodeListL(CBufBase& aObject);
       
   625 
       
   626 	/**
       
   627 	* Generates nodelist wbxml to aObject
       
   628 	* @param	aStream			Stream to write wbxml
       
   629 	*/
       
   630 	void GenerateNodeListWBXMLL(RWriteStream& aStream);
       
   631 	
       
   632 	/**
       
   633 	* Parse nodelist wbxml to structure
       
   634 	* @param	aReader			Stream which contains wbxml
       
   635 	* @param	aNodeListPtr	Reference to nodelist ptr where to build
       
   636 	*							ddf structure
       
   637 	* @param	aParent			Parent node pointer
       
   638 	*/
       
   639 	TUint ParseNodeListWBXMLL(RReadStream& aReader,
       
   640 		CNSmlDmNodeList*& aNodeListPtr, CNSmlDmNode* aParent);
       
   641 		
       
   642 	/**
       
   643 	* Parse node wbxml to structure
       
   644 	* @param	aReader			Stream which contains wbxml
       
   645 	* @param	aNode			Reference to node where to build
       
   646 	*							ddf structure
       
   647 	*/
       
   648 	void ParseNodeWBXMLL(RReadStream& aReader,CNSmlDmNode* aNode );
       
   649 
       
   650 	/**
       
   651 	* Parse df properties wbxml to structure
       
   652 	* @param	aReader			Stream which contains wbxml
       
   653 	* @param	aNodePtr		Pointer to node where to build
       
   654 	*							ddf structure
       
   655 	*/
       
   656    	void ParseDFPropertiesWBXMLL(RReadStream& aReader,
       
   657    		MSmlDmDDFObject* aNodePtr );
       
   658    		
       
   659 	/**
       
   660 	* Get adapter id and host session id
       
   661 	* @param	aImplUid		Reference where to write adapter id
       
   662 	* @param	aSessionId		Reference where to write session id
       
   663 	*/
       
   664 	IMPORT_C void GetImplUid(TUint32& aImplUid,TUint8& aSessionId);
       
   665 
       
   666 private:
       
   667 	};
       
   668 
       
   669 
       
   670 // ===========================================================================
       
   671 // CNSmlDmMgmtTree 
       
   672 // ===========================================================================
       
   673 /**
       
   674 * CNSmlDmMgmtTree is the root node in DDF structure
       
   675 *
       
   676 *  @since
       
   677 */
       
   678 class CNSmlDmMgmtTree : public CBase, public MSmlDmDDFObject
       
   679 	{
       
   680 public:
       
   681 	/**
       
   682 	* Two-phased construction
       
   683 	* @return				Pointer to newly created instance
       
   684 	*/
       
   685 	IMPORT_C static CNSmlDmMgmtTree* NewL();
       
   686 
       
   687 	/**
       
   688 	* Destructor
       
   689 	*/
       
   690 	virtual ~CNSmlDmMgmtTree();
       
   691 
       
   692 	/**
       
   693 	* Inherited from MSmlDmDDFObject, no use in this class
       
   694 	* @param	aAccessTypes		Access type
       
   695 	*/
       
   696 	void SetAccessTypesL( TSmlDmAccessTypes aAccessTypes );
       
   697 
       
   698 	/**
       
   699 	* Inherited from MSmlDmDDFObject, no use in this class
       
   700 	* @param	aDefaultValue		Default value
       
   701 	*/
       
   702 	void SetDefaultValueL( const TDesC8& aDefaultValue ); 
       
   703 
       
   704 	/**
       
   705 	* Inherited from MSmlDmDDFObject, no use in this class
       
   706 	* @param	aDescription		Description
       
   707 	*/
       
   708 	void SetDescriptionL( const TDesC8& aDescription );
       
   709 
       
   710 	/**
       
   711 	* Inherited from MSmlDmDDFObject, no use in this class
       
   712 	* @param	aFormat			Format
       
   713 	*/
       
   714 	void SetDFFormatL( TDFFormat aFormat );
       
   715 
       
   716 	/**
       
   717 	* Inherited from MSmlDmDDFObject, no use in this class
       
   718 	* @param	aOccurence		Occurence
       
   719 	*/
       
   720 	void SetOccurenceL( TOccurence aOccurence );
       
   721 
       
   722 	/**
       
   723 	* Inherited from MSmlDmDDFObject, no use in this class
       
   724 	* @param	aScope			Scope
       
   725 	*/
       
   726 	void SetScopeL( TScope aScope );
       
   727 
       
   728 	/**
       
   729 	* Inherited from MSmlDmDDFObject, no use in this class
       
   730 	* @param	aTitle			Title
       
   731 	*/
       
   732 	void SetDFTitleL( const TDesC8& aTitle );
       
   733 
       
   734 	/**
       
   735 	* Inherited from MSmlDmDDFObject, no use in this class
       
   736 	* @param	aMimeType			Mime type
       
   737 	*/
       
   738 	void AddDFTypeMimeTypeL( const TDesC8& aMimeType );
       
   739 
       
   740 	/**
       
   741 	* Inherited from MSmlDmDDFObject, no use in this class
       
   742 	*/
       
   743 	void SetAsObjectGroup();
       
   744 
       
   745 	/**
       
   746 	* Adds child object with name under th root node.
       
   747 	* This is inherited from MSmlDmDDFObject.
       
   748 	* @param	aNodeName		Node name
       
   749 	*/
       
   750 	MSmlDmDDFObject& AddChildObjectL(const TDesC8& aNodeName);
       
   751 
       
   752 	/**
       
   753 	* Inherited from MSmlDmDDFObject, no use in this class
       
   754 	*/
       
   755 	MSmlDmDDFObject& AddChildObjectGroupL();
       
   756 
       
   757 	/**
       
   758 	* Generates xml of the whole DDF and writes it to aObject
       
   759 	* @param	aObject			Reference to buffer where to write
       
   760 	*							generated xml
       
   761 	*/
       
   762 	IMPORT_C void GenerateXMLL(CBufBase& aObject);
       
   763 
       
   764 	/**
       
   765 	* Looks through the ddf tree and sets the adapter id to new static nodes
       
   766 	* @param	aUid			Adapter id
       
   767 	*/
       
   768 	IMPORT_C void SetAdapterUid(TUint32 aUid);
       
   769 
       
   770 	/**
       
   771 	* Looks through the ddf tree and sets the session id to new static nodes
       
   772 	* @param	aServerId		Id of the session to correct host server
       
   773 	*/
       
   774 	IMPORT_C void SetServerId(TUint8 aServerId);
       
   775 
       
   776 	/**
       
   777 	* Returns pointer to actual root nodelist pointer. The whole tree can be
       
   778 	* accessed through this pointer
       
   779 	* @reutrn				Root nodelist pointer
       
   780 	*/
       
   781 	IMPORT_C CNSmlDmNodeList* NodeListPtr();
       
   782 
       
   783 	/**
       
   784 	* Generates wbxml of the whole DDF and writes it to aStream
       
   785 	* @param	aStream			Reference to stream where to write
       
   786 	*							generated wbxml
       
   787 	*/
       
   788 	IMPORT_C void GenerateWBXMLL(RWriteStream& aStream);
       
   789 
       
   790 	/**
       
   791 	* Parses wbxml from stream to ddf structure. This is used when
       
   792 	* ddf subtree is got from hostserver. The ddf is parsed on the existing
       
   793 	* tree, i.e the whole tree is got when all subtrees are parsed.
       
   794 	* @param	aReader			Reference to stream where to read wbxml
       
   795 	*							
       
   796 	*/
       
   797 	IMPORT_C void ParseWBXMLL(RReadStream& aReader);
       
   798 
       
   799 	/**
       
   800 	* Finds the node pointed by aURI from tree 
       
   801 	* @param	aURI			Uri
       
   802 	* @param	aFinalPtr		Found pointer is written here
       
   803 	* @return					ENSmlDmDDFLeaf,ENSmlDmDDFNode or
       
   804 	*							ENSmlDmDDFNotFound
       
   805 	*/
       
   806 	IMPORT_C TNSmlDmDDFFormat FindNameFromNodeListL(const TDesC8& aURI,
       
   807 		CNSmlDmNodeList*& aFinalPtr);
       
   808 		
       
   809 	/**
       
   810 	* Finds the allrady loaded adapters 
       
   811 	* @param	aLoadedAdapters Arrayf of found adapter ids			
       
   812 	* @param	aNodeListPtr	Algorythm is recursive and next level nodelist
       
   813 	*							pointer is provided here
       
   814 	* @return					Not used
       
   815 	*/
       
   816 	IMPORT_C TBool FindLoadedAdaptersL(RArray<TUint32>& aLoadedAdapters,
       
   817 		CNSmlDmNodeList* aNodeListPtr=NULL);
       
   818 
       
   819 	
       
   820 private:
       
   821 	/**
       
   822 	* Constructor
       
   823 	*/
       
   824 	CNSmlDmMgmtTree();
       
   825 
       
   826 	/**
       
   827 	* Second phase constructor
       
   828 	*/
       
   829 	void ConstructL();
       
   830 
       
   831 	/**
       
   832 	* Looks through the ddf tree and sets the adapter id to new static nodes
       
   833 	* @param	aNodeListPtr	Algorythm is recursive and next level nodelist
       
   834 	*							pointer is provided here
       
   835 	* @param	aUid			Adapter id
       
   836 	*/
       
   837 	TBool SetUidToNewItems ( CNSmlDmNodeList* aNodeListPtr, TUint32 aUid);
       
   838 
       
   839 	/**
       
   840 	* Looks through the ddf tree and sets the session id to new static nodes
       
   841 	* @param	aNodeListPtr	Algorythm is recursive and next level nodelist
       
   842 	*							pointer is provided here
       
   843 	* @param	aServerId		Id of the session to correct host server
       
   844 	*/
       
   845 	TBool SetServerIdToNewItems ( CNSmlDmNodeList* aNodeListPtr,
       
   846 		TUint8 aServerId );
       
   847 
       
   848 public:
       
   849 	
       
   850 	/**
       
   851 	* Pointer to root node list pointer
       
   852 	*/
       
   853 	CNSmlDmNodeList* iNodeListPtr;
       
   854 
       
   855 
       
   856 private:
       
   857 	/**
       
   858 	* dtd version
       
   859 	*/
       
   860 	CNSmlDmPcdata iVerDTD;
       
   861 	};
       
   862 
       
   863 
       
   864 
       
   865 
       
   866 #endif // __NSMLDMTREEDTD_H