epoc32/include/mw/cnode.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100 (2010-03-31)
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
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
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     2
// All rights reserved.
williamr@4
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@4
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     7
//
williamr@4
     8
// Initial Contributors:
williamr@4
     9
// Nokia Corporation - initial contribution.
williamr@4
    10
//
williamr@4
    11
// Contributors:
williamr@4
    12
//
williamr@4
    13
// Description:
williamr@4
    14
// This contains the definitions of CDataDelete, CDataNoDelete, CIntAttribute, CNode, and CTypedNode.
williamr@4
    15
// CDataNoDelete is a base class to CDataDelete and are essentially a wrapper around an HBufC16.
williamr@4
    16
// The node owns the data that is added to it and therefore is responsible for deleting all its data,
williamr@4
    17
// hence theses two classes allow a user to have non deletable data. Internally to the node it is also 
williamr@4
    18
// sometimes necessary to change the data into either deletable or non-deletable data api's are provided
williamr@4
    19
// for this.
williamr@4
    20
// CIntAttribute is wrapper around a TInt, this is provided as the nodes attribute value is a CBase* however
williamr@4
    21
// it might be desirable to store integer's in here. Attribute value is owned by the node therefore the node is
williamr@4
    22
// responsible for deleting it.
williamr@4
    23
// CNode is the basis for constructing a tree. It consists of an array of child nodes, node type, a parent node,
williamr@4
    24
// an array of attributes, and a data member. Internally the data member is defined as CDataNoDelete however
williamr@4
    25
// to the user all the exported api's take an HBufC16*. Data is owned by the node and is destroyed by the node,
williamr@4
    26
// However in certain circumstances this is not desirable hence the api's to make the data non-deletable. The
williamr@4
    27
// node type is defined as a TAny* however normal usage would use the templated node - CTypedNode. The node type
williamr@4
    28
// is used to identify groups of nodes. The attribute array is fairy simple and consists of AttributeType and 
williamr@4
    29
// AttributeValue. AttributeType can be defined by using the templated class and should be a 32bit value. AttributeValue
williamr@4
    30
// can be any object derived from CBase and the node takes ownership therefore the node delete's it.
williamr@4
    31
// Basic usage should be to use the templated class in order to make use of the templated types (TNodeType,TAttributeType).
williamr@4
    32
// Create a node for example:
williamr@4
    33
// CTypedNode<CNode*, const TDesC*> *tree = CTypedNode<CNode*, const TDesC*>::NewL(0,0);
williamr@4
    34
// add a new child:
williamr@4
    35
// CNODE *TestChildNode1 = tree->AppendNodeL(aTempNodeForNodeType);
williamr@4
    36
// add some data:
williamr@4
    37
// TestChildNode1->SetDataL(aHBufC16);
williamr@4
    38
// add an attribute:
williamr@4
    39
// TestChildNode1->->AddAttributeL(aTAttributeType,aCBasePointerAttributeValue);
williamr@4
    40
// Explanation of individual api's is documented below.
williamr@4
    41
//
williamr@2
    42
williamr@2
    43
 
williamr@2
    44
williamr@2
    45
#ifndef __CNODE_H__
williamr@2
    46
#define __CNODE_H__
williamr@2
    47
williamr@2
    48
#include <e32base.h>
williamr@2
    49
#include <f32file.h>
williamr@2
    50
williamr@2
    51
williamr@2
    52
/**
williamr@2
    53
	@file
williamr@2
    54
	@publishedAll
williamr@4
    55
	@deprecated
williamr@2
    56
*/
williamr@2
    57
williamr@2
    58
//Granularity of arrays
williamr@2
    59
const TInt KGranularity = 5;
williamr@2
    60
williamr@2
    61
//enum of panic reasons
williamr@2
    62
enum TNodePanic
williamr@2
    63
	{
williamr@2
    64
	ENodeBadArgument,
williamr@2
    65
	ENodeNoChildren,
williamr@2
    66
	ENoData,
williamr@2
    67
	EAttributeFailure
williamr@2
    68
	};
williamr@2
    69
williamr@2
    70
//node panic function
williamr@2
    71
inline void Panic(TNodePanic aPanic);
williamr@2
    72
williamr@2
    73
//Wrapper around an HBufC16 doesn't delete data
williamr@2
    74
//##ModelId=3B666BCC0303
williamr@2
    75
class CDataNoDelete : public CBase
williamr@2
    76
/** Provides a wrapper around an HBufC16: the buffer is not deleted when the object is deleted.
williamr@2
    77
*/
williamr@2
    78
	{
williamr@2
    79
public:
williamr@2
    80
	//##ModelId=3B666BCC032D
williamr@2
    81
	CDataNoDelete(HBufC16* aData);
williamr@2
    82
	//##ModelId=3B666BCC032C
williamr@2
    83
	virtual ~CDataNoDelete();
williamr@2
    84
	//##ModelId=3B666BCC0324
williamr@2
    85
	HBufC16* SetData(HBufC16* aData);
williamr@2
    86
	//##ModelId=3B666BCC0322
williamr@2
    87
	virtual void ResetDataPointer(HBufC16* aData);
williamr@2
    88
	//##ModelId=3B666BCC0321
williamr@2
    89
	HBufC16* Data();
williamr@2
    90
williamr@2
    91
protected:
williamr@2
    92
	/** The wrapped buffer. */
williamr@2
    93
	//##ModelId=3B666BCC0319
williamr@2
    94
	HBufC16* iData;
williamr@2
    95
	};
williamr@2
    96
williamr@2
    97
//Wrapper around an HBufC16 does delete data
williamr@2
    98
//##ModelId=3B666BCC0399
williamr@2
    99
class CDataDelete : public CDataNoDelete
williamr@2
   100
/** Provides a wrapper around an HBufC16: the buffer is deleted when the 
williamr@2
   101
object is deleted.
williamr@2
   102
*/
williamr@2
   103
	{
williamr@2
   104
public:
williamr@2
   105
	//##ModelId=3B666BCC03B7
williamr@2
   106
	CDataDelete(HBufC16* aData);
williamr@2
   107
	//##ModelId=3B666BCC03B0
williamr@2
   108
	virtual ~CDataDelete();
williamr@2
   109
	//##ModelId=3B666BCC03AE
williamr@2
   110
	virtual void ResetDataPointer(HBufC16* aData);
williamr@2
   111
	};
williamr@2
   112
williamr@2
   113
//Wrapper around an HBufC16 does delete data (FileName)
williamr@2
   114
// After Removing referenced File 
williamr@2
   115
//##ModelId=3B666BC7026F
williamr@2
   116
class CFileDataDelete : public CDataNoDelete
williamr@2
   117
/** Provides a wrapper around a filename: the referenced file is deleted when the object is deleted.
williamr@2
   118
*/
williamr@2
   119
	{
williamr@2
   120
public:
williamr@2
   121
	//##ModelId=3B666BC7028F
williamr@2
   122
	CFileDataDelete(HBufC16* aData);
williamr@2
   123
	//##ModelId=3B666BC7028E
williamr@2
   124
	virtual ~CFileDataDelete();
williamr@2
   125
	//##ModelId=3B666BC70285
williamr@2
   126
	virtual void ResetDataPointer(HBufC16* aData);
williamr@2
   127
private:
williamr@2
   128
	//##ModelId=3B666BC70284
williamr@2
   129
	void RemoveFile();
williamr@2
   130
	};
williamr@2
   131
williamr@2
   132
//Wrapper around a TInt used for attribute values in order to allow the node to call a dtor
williamr@2
   133
//##ModelId=3B666BC6023E
williamr@2
   134
class CIntAttribute : public CBase
williamr@2
   135
/** Provides an object wrapper around a TInt value. */
williamr@2
   136
	{
williamr@2
   137
public:
williamr@2
   138
	//##ModelId=3B666BC6025B
williamr@2
   139
	inline CIntAttribute(TInt aInteger);		
williamr@2
   140
	//##ModelId=3B666BC6025A
williamr@2
   141
	inline TInt Int() const;
williamr@2
   142
private:
williamr@2
   143
	//##ModelId=3B666BC60264
williamr@2
   144
	CIntAttribute();
williamr@2
   145
	//##ModelId=3B666BC60253
williamr@2
   146
	TInt iInteger;
williamr@2
   147
	};
williamr@2
   148
williamr@2
   149
//
williamr@2
   150
// Node class
williamr@2
   151
// Normal usage would be to use CTypedNode in order to use specific templated types
williamr@2
   152
//
williamr@2
   153
williamr@2
   154
//##ModelId=3B666BCD02D2
williamr@2
   155
class CNode : public CBase 
williamr@2
   156
	{
williamr@2
   157
public:
williamr@2
   158
	//##ModelId=3B666BCE0139
williamr@2
   159
	IMPORT_C ~CNode();
williamr@2
   160
williamr@2
   161
	//NewL parameters aType to indentify the type of node, CNode* to set the parent of this node
williamr@2
   162
	//##ModelId=3B666BCE0125
williamr@2
   163
	IMPORT_C static CNode* NewL(TAny* aType,CNode* aParent);
williamr@2
   164
williamr@2
   165
	//Deletes a child node which is passed in as a parameter
williamr@2
   166
	//##ModelId=3B666BCE011C
williamr@2
   167
	IMPORT_C void DeleteChildNode(CNode* aNode);
williamr@2
   168
williamr@2
   169
	//Deletes all the child nodes haging of this node
williamr@2
   170
	//##ModelId=3B666BCE011B
williamr@2
   171
	IMPORT_C void DeleteAllChildNodes();
williamr@2
   172
williamr@2
   173
	//Creates a new node and adds it to the childlist, reference to new node is returned. Can leave if it can't allocate memory for a new node
williamr@2
   174
	//Type of node is the parameter
williamr@2
   175
	//##ModelId=3B666BCE0108
williamr@2
   176
	IMPORT_C CNode& AppendNodeL(TAny* aType = 0);
williamr@2
   177
williamr@2
   178
	//Appends a node which is passed in as a parameter to this node, so its added to the childlist
williamr@2
   179
	//##ModelId=3B666BCE00FD
williamr@2
   180
	IMPORT_C void AppendNodeToThisNodeL(CNode* aNode);
williamr@2
   181
williamr@2
   182
	//Sets the data in the node to the parameter that is passed in. It's deletable and the node will delete it in dtor
williamr@2
   183
	//Push aDataNowNodeOwns onto the CleanupStack before calling then pop off on return
williamr@2
   184
	//##ModelId=3B666BCE00F3
williamr@2
   185
	IMPORT_C void SetDataL(HBufC16* aDataNowNodeOwns);
williamr@2
   186
williamr@2
   187
	//returns the data stored in the node, which is returned as an HBufC16*
williamr@2
   188
	//##ModelId=3B666BCE00EB
williamr@2
   189
	IMPORT_C HBufC16* Data() const;
williamr@2
   190
williamr@2
   191
	//WARNING this function can leave as it deletes the wrapper object and then creates
williamr@2
   192
	//a new non deletable wrapper object and sets the data pointer inside the new object
williamr@2
   193
	//IF THIS LEAVES YOU WILL LOSE YOUR DATA
williamr@2
   194
	//##ModelId=3B666BCE00EA
williamr@2
   195
	IMPORT_C void SetDataNoDeleteL();
williamr@2
   196
williamr@2
   197
	//WARNING this function can leave as it deletes the wrapper object and then creates
williamr@2
   198
	//a new deletable wrapper object then sets the pointer in the new object
williamr@2
   199
	//##ModelId=3B666BCE00E9
williamr@2
   200
	IMPORT_C void ClearSetDataNoDeleteL();
williamr@2
   201
williamr@2
   202
	// Sets the data in the node to the FileName parameter that is passed in. 
williamr@2
   203
	// It's deletable and the node will delete it, and the file it refers to in dtor
williamr@2
   204
	// Push aDataLocationNowNodeOwns onto the CleanupStack before calling then pop off on return
williamr@2
   205
	//##ModelId=3B666BCE00DF
williamr@2
   206
	IMPORT_C void SetFileDataL(HBufC16* aFileDataLocationNowNodeOwns);
williamr@2
   207
williamr@2
   208
	//Resets the data pointer to point to aData parameter will delete the data that is owned by the node
williamr@2
   209
	//##ModelId=3B666BCE00D5
williamr@2
   210
	IMPORT_C void ResetDataPointer(HBufC16* aData);
williamr@2
   211
williamr@2
   212
	//returns a reference to the absolute root of the tree
williamr@2
   213
	//##ModelId=3B666BCE00CB
williamr@2
   214
	IMPORT_C const CNode& Root() const;
williamr@2
   215
williamr@2
   216
	//returns a child node which is stored in the array of children. The child node is accessed by the index that is the parameter.
williamr@2
   217
	//##ModelId=3B666BCE00C1
williamr@2
   218
	IMPORT_C CNode* Child(TInt aByIndex) const;
williamr@2
   219
williamr@2
   220
	//Returns either the first child of this node if the parameter is NULL. Or it returns the next chld in the array after
williamr@2
   221
	//the child passed in as a parameter
williamr@2
   222
	//##ModelId=3B666BCE00AE
williamr@2
   223
	IMPORT_C CNode* NextChild(const CNode* aNode = NULL) const;
williamr@2
   224
williamr@2
   225
	//returns the previous child to the child passed in as a parameter. The node parameter is a reference because its the child previous
williamr@2
   226
	//to the node passed in which obviously must exist
williamr@2
   227
	//##ModelId=3B666BCE00A4
williamr@2
   228
	IMPORT_C CNode* PrevChild(const CNode& aNode) const;
williamr@2
   229
williamr@2
   230
	//Returns the parent of this node
williamr@2
   231
	//##ModelId=3B666BCE00A3
williamr@2
   232
	IMPORT_C CNode* Parent() const;
williamr@2
   233
williamr@2
   234
	//WARNING this function can leave as it calls AppendNodeToThisNode. The aParent parameter is the node to which you would like to make
williamr@2
   235
	//the parent of 'this' node.
williamr@2
   236
	//It removes itself from the childlist of it's current parent
williamr@2
   237
	//##ModelId=3B666BCE0099
williamr@2
   238
	IMPORT_C void ReparentL(CNode* aParent);
williamr@2
   239
williamr@2
   240
	//Returns the next sibling which means in effect that it asks for the next child of its parent.
williamr@2
   241
	//Sibling means brother or sister.
williamr@2
   242
	//##ModelId=3B666BCE0090
williamr@2
   243
	IMPORT_C CNode* NextSibling() const;
williamr@2
   244
williamr@2
   245
	//Returns the previous sibling which means in effect that it asks for the previous child of its parent.
williamr@2
   246
	//Sibling means brother or sister.
williamr@2
   247
	//##ModelId=3B666BCE008F
williamr@2
   248
	IMPORT_C CNode* PrevSibling() const;
williamr@2
   249
williamr@2
   250
	//returns the number of children that this node has
williamr@2
   251
	//##ModelId=3B666BCE0085
williamr@2
   252
	IMPORT_C TInt NumberImmediateChildren() const;
williamr@2
   253
williamr@2
   254
	//Deletes the attribute of which is of aAttributeType (the parameter)
williamr@2
   255
	//WARNING Attribute values of nodes will be deleted as the node owns them if you don't want it deleted then use a wrapper
williamr@2
   256
	//##ModelId=3B666BCE007C
williamr@2
   257
	IMPORT_C void DeleteAttribute(TAny* aAttributeType);
williamr@2
   258
williamr@2
   259
	//Deletes all the attributes of this node
williamr@2
   260
	//WARNING Attribute values of nodes will be deleted as the node owns them if you don't want it deleted then use a wrapper
williamr@2
   261
	//##ModelId=3B666BCE007B
williamr@2
   262
	IMPORT_C void DeleteAllAttributes();
williamr@2
   263
williamr@2
   264
	//remove an attribute without deleting it, this is done by simply setting the attributeValue pointer to NULL
williamr@2
   265
	//WARNING you are now responsiblefor the destruction of this attribute value
williamr@2
   266
	//##ModelId=3B666BCE0071
williamr@2
   267
	IMPORT_C void RemoveAttributeNoDelete(TAny* aAttributeType);
williamr@2
   268
williamr@2
   269
	// Returns the number of attributes that this node has
williamr@2
   270
	//##ModelId=3B666BCE0067
williamr@2
   271
	IMPORT_C TInt AttributeCount() const;
williamr@2
   272
williamr@2
   273
	//Returns the type of attribute (AttributeType) at a given index...NOT the attributeValue
williamr@2
   274
	//##ModelId=3B666BCE005D
williamr@2
   275
	IMPORT_C TAny* AttributeTypeByIndex(TInt aIndex) const; 
williamr@2
   276
williamr@2
   277
	//Returns the value of an attribute (AttributeValue) at a given index...NOT the attributeType
williamr@2
   278
	//##ModelId=3B666BCE003F
williamr@2
   279
	IMPORT_C CBase* AttributeByIndex(TInt aIndex) const;
williamr@2
   280
	//##ModelId=3B666BCE0049
williamr@2
   281
	IMPORT_C CBase* AttributeByIndex(TInt aIndex,TAny*& aType) const;
williamr@2
   282
williamr@2
   283
	//Adds an attribute, parameters are the type of attribute and its value
williamr@2
   284
	//WARNING node takes ownership of aAttributeValue
williamr@4
   285
	//Push aAttributeValue onto the CleanupStack before calling then pop off on return
williamr@2
   286
	//##ModelId=3B666BCE002B
williamr@2
   287
	IMPORT_C void AddAttributeL(TAny* AttributeType, CBase* aAttributeValue);
williamr@2
   288
williamr@2
   289
	//Adds data to the node and also adds an attribute, parameters are the Data to be added, the type of attribute and its value
williamr@2
   290
	//WARNING node takes ownership of aData and aAttributeValue
williamr@4
   291
	//Push aAttributeValue and aData onto the CleanupStack before calling then pop off on return
williamr@2
   292
	//##ModelId=3B666BCE000D
williamr@2
   293
	IMPORT_C void AddDataAndAttributeL(HBufC16 *aData, TAny* AttributeType, CBase* aAttributeValue);
williamr@2
   294
williamr@2
   295
	//Returns an attribute value for the given AttributeType(the parameter)
williamr@2
   296
	//##ModelId=3B666BCE0003
williamr@2
   297
	IMPORT_C CBase* Attribute(TAny* AttributeType) const;
williamr@2
   298
williamr@2
   299
	//Returns TRUE if the attribute of the given type exists
williamr@2
   300
	//##ModelId=3B666BCD03E1
williamr@2
   301
	IMPORT_C TBool AttributeExists(TAny* aAttributeType) const;
williamr@2
   302
williamr@2
   303
	//Returns the node type
williamr@2
   304
	//##ModelId=3B666BCD03D7
williamr@2
   305
	IMPORT_C TAny* Type() const;
williamr@2
   306
williamr@2
   307
	//Sets the node type to be aType (the parameter)
williamr@2
   308
	//##ModelId=3B666BCD03CD
williamr@2
   309
	IMPORT_C void SetType(TAny* aType);
williamr@2
   310
williamr@2
   311
williamr@2
   312
protected:
williamr@2
   313
	//ctor
williamr@2
   314
	//##ModelId=3B666BCD03B9
williamr@2
   315
	CNode(TAny* aType, CNode* aParent);
williamr@2
   316
williamr@2
   317
	//internal finds a child which is passed in as a parameter
williamr@2
   318
	//##ModelId=3B666BCD03AF
williamr@2
   319
	TInt FindChild(const CNode* aNode) const;
williamr@2
   320
williamr@2
   321
	//##ModelId=3B666BCD03A7
williamr@2
   322
	HBufC16* SetupDeletableOrNonDeleteableDataLC();
williamr@2
   323
	//##ModelId=3B666BCD03A6
williamr@2
   324
	void AdjustBasePointers();
williamr@2
   325
private:
williamr@2
   326
	// Reserved for future expansion
williamr@2
   327
	//##ModelId=3B666BCD039B
williamr@2
   328
	virtual void Reserved1();			
williamr@2
   329
	//##ModelId=3B666BCD03A5
williamr@2
   330
	virtual void Reserved1() const;
williamr@2
   331
williamr@2
   332
protected:
williamr@2
   333
	//the Type of Node
williamr@2
   334
	//##ModelId=3B666BCD0392
williamr@2
   335
	TAny* iType;
williamr@2
   336
williamr@2
   337
	//This Nodes parent
williamr@2
   338
	//##ModelId=3B666BCD037E
williamr@2
   339
	CNode *iParent;
williamr@2
   340
williamr@2
   341
	// stores attribute type and value. iTypes must be Flat array
williamr@2
   342
	//##ModelId=3B666BCD0372
williamr@2
   343
	CArrayPtrFlat<CBase> iValues;
williamr@2
   344
	//##ModelId=3B666BCD034C
williamr@2
   345
	CArrayPtrFlat<TAny> iTypes;
williamr@2
   346
williamr@2
   347
	//##ModelId=3B666BCD0324
williamr@2
   348
	TInt32* iTypesBasePtr;
williamr@2
   349
	//##ModelId=3B666BCD0310
williamr@2
   350
	CDataNoDelete* iDataValue;
williamr@2
   351
//
williamr@2
   352
	//An array of child nodes
williamr@2
   353
	//##ModelId=3B666BCD02FC
williamr@2
   354
	CArrayPtr<CNode> *iChildList;
williamr@2
   355
private:
williamr@2
   356
	//##ModelId=3B666BCD02DF
williamr@2
   357
	TAny*	iReserved;						// Reserved for future expansion
williamr@2
   358
	};
williamr@2
   359
williamr@2
   360
williamr@2
   361
//CTypedNode is derived from CNode and is a thin template. TNodeType you should define as a 32 bit value
williamr@2
   362
//TAttributeType should be defined as a 32 bit value
williamr@2
   363
//FOR EXPLANATION OF API'S SEE ABOVE 
williamr@2
   364
//##ModelId=3B666BCC01A4
williamr@2
   365
template <class TNodeType, class TAttributeType>
williamr@2
   366
class CTypedNode : public CNode 
williamr@2
   367
/** Template class for a node in a node tree.
williamr@2
   368
williamr@2
   369
The node type is set to the template parameter TNodeType and the attribute type to 
williamr@2
   370
TAttributeType. These parameters should be pointers to the type required to store 
williamr@2
   371
the type value: e.g. for a string, a const TDesC*.
williamr@2
   372
williamr@2
   373
The class is thin template over CNode. */
williamr@2
   374
	{
williamr@2
   375
public:
williamr@2
   376
	//##ModelId=3B666BCC024A
williamr@2
   377
	inline static CTypedNode* NewL(TNodeType aType,CNode* aParent);
williamr@2
   378
	//##ModelId=3B666BCC0248
williamr@2
   379
	inline void DeleteChildNode(CNode* aNode);
williamr@2
   380
	//##ModelId=3B666BCC0247
williamr@2
   381
	inline void DeleteAllChildNodes();
williamr@2
   382
	//##ModelId=3B666BCC0245
williamr@2
   383
	inline CTypedNode<TNodeType,TAttributeType>& AppendNodeL(TNodeType aType);
williamr@2
   384
	//##ModelId=3B666BCC023B
williamr@2
   385
	inline void AppendNodeToThisNodeL(CNode* aNode);
williamr@2
   386
	//##ModelId=3B666BCC0228
williamr@2
   387
	inline void SetDataL(HBufC16* aDataNowNodeOwns);
williamr@2
   388
	//##ModelId=3B666BCC0227
williamr@2
   389
	inline void SetDataNoDeleteL();
williamr@2
   390
	//##ModelId=3B666BCC0221
williamr@2
   391
	inline void ClearSetDataNoDeleteL();
williamr@2
   392
	//##ModelId=3B666BCC021F
williamr@2
   393
	inline void SetFileDataL(HBufC16* aFileDataLocationNowNodeOwns);
williamr@2
   394
	//##ModelId=3B666BCC021D
williamr@2
   395
	inline void ResetDataPointer(HBufC16* aData);
williamr@2
   396
	//##ModelId=3B666BCC0215
williamr@2
   397
	inline HBufC16* Data() const;
williamr@2
   398
	//##ModelId=3B666BCC0214
williamr@2
   399
	inline const CTypedNode& Root() const;
williamr@2
   400
	//##ModelId=3B666BCC020B
williamr@2
   401
	inline CTypedNode* Child(TInt aByIndex) const;
williamr@2
   402
	//##ModelId=3B666BCC0209
williamr@2
   403
	inline CTypedNode* NextChild(const CNode* aNode = NULL) const;
williamr@2
   404
	//##ModelId=3B666BCC0201
williamr@2
   405
	inline CTypedNode* PrevChild( const CNode& aNode) const;
williamr@2
   406
	//##ModelId=3B666BCC0200
williamr@2
   407
	inline CTypedNode* Parent() const;
williamr@2
   408
	//##ModelId=3B666BCC01FE
williamr@2
   409
	inline void ReparentL(CNode* aParent);
williamr@2
   410
	//##ModelId=3B666BCC01F5
williamr@2
   411
	inline CTypedNode* NextSibling() const;
williamr@2
   412
	//##ModelId=3B666BCC01F4
williamr@2
   413
	inline CTypedNode* PrevSibling() const;
williamr@2
   414
	//##ModelId=3B666BCC01EE
williamr@2
   415
	inline TInt NumberImmediateChildren() const;
williamr@2
   416
	//##ModelId=3B666BCC01EC
williamr@2
   417
	inline void DeleteAttribute(TAttributeType aAttributeType);
williamr@2
   418
	//##ModelId=3B666BCC01EB
williamr@2
   419
	inline void DeleteAllAttributes();
williamr@2
   420
	//##ModelId=3B666BCC01E5
williamr@2
   421
	inline void RemoveAttributeNoDelete(TAttributeType aAttributeType);
williamr@2
   422
	//##ModelId=3B666BCC01E4
williamr@2
   423
	inline TInt AttributeCount() const; // Returns the number of attributes
williamr@2
   424
	//##ModelId=3B666BCC01E2
williamr@2
   425
	inline TAttributeType AttributeTypeByIndex(TInt aIndex) const; 
williamr@2
   426
	//##ModelId=3B666BCC01DC
williamr@2
   427
	inline CBase* AttributeByIndex(TInt aIndex) const; 
williamr@2
   428
	//##ModelId=3B666BCC01DE
williamr@2
   429
	inline CBase* AttributeByIndex(TInt aIndex,TAttributeType& aType) const; 
williamr@2
   430
	//##ModelId=3B666BCC01D9
williamr@2
   431
	inline void AddAttributeL(TAttributeType aAttributeType, CBase* aAttributeValue);
williamr@2
   432
	//##ModelId=3B666BCC01D0
williamr@2
   433
	inline void AddDataAndAttributeL(HBufC16 *aData, TAttributeType aAttributeType, CBase* aAttributeValue);
williamr@2
   434
	//##ModelId=3B666BCC01CE
williamr@2
   435
	inline CBase* Attribute(TAttributeType aAttributeType) const;
williamr@2
   436
	//##ModelId=3B666BCC01CC
williamr@2
   437
	inline TBool AttributeExists(TAttributeType aAttributeType) const;
williamr@2
   438
	//##ModelId=3B666BCC01C9
williamr@2
   439
	inline TNodeType Type() const;
williamr@2
   440
	//##ModelId=3B666BCC01C7
williamr@2
   441
	inline void SetType(TNodeType aType);
williamr@2
   442
protected:
williamr@2
   443
	//##ModelId=3B666BCC01C4
williamr@2
   444
	CTypedNode(TNodeType aType, CNode* aParent);
williamr@2
   445
	};
williamr@2
   446
#include <cnode.inl>
williamr@2
   447
#endif