omadmadapters/syncmldm/tsrc/src/TestDmDDFObject.cpp
author hgs
Tue, 13 Jul 2010 03:48:30 +0530
changeset 45 0f9fc722d255
parent 44 deviceupdatesui/omadmadapters/syncmlds/tsrc/src/TestDmDDFObject.cpp@137912d1a556
permissions -rw-r--r--
201021_01
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     1
/*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     3
* All rights reserved.
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     8
*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
     9
* Initial Contributors:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    11
*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    12
* Contributors:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    13
*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    14
* Description:  Implementation of DM adapter test component
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    15
* 	This is part of omadmextensions/adapter test application.
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    16
*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    17
*/
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    18
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    19
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    20
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    21
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    22
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    23
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    24
// INCLUDE FILES
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    25
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    26
#include "TestDmDDFObject.h"
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    27
#include "StifLogger.h"
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    28
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    29
// EXTERNAL DATA STRUCTURES
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    30
//extern  ?external_data;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    31
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    32
// EXTERNAL FUNCTION PROTOTYPES  
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    33
//extern ?external_function( ?arg_type,?arg_type );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    34
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    35
// CONSTANTS
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    36
//const ?type ?constant_var = ?constant;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    37
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    38
// MACROS
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    39
//#define ?macro ?macro_def
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    40
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    41
// LOCAL CONSTANTS AND MACROS
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    42
//const ?type ?constant_var = ?constant;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    43
//#define ?macro_name ?macro_def
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    44
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    45
// MODULE DATA STRUCTURES
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    46
//enum ?declaration
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    47
//typedef ?declaration
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    48
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    49
// LOCAL FUNCTION PROTOTYPES
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    50
//?type ?function_name( ?arg_type, ?arg_type );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    51
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    52
// FORWARD DECLARATIONS
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    53
//class ?FORWARD_CLASSNAME;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    54
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    55
// ============================= LOCAL FUNCTIONS ===============================
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    56
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    57
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    58
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    59
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    60
// ============================ MEMBER FUNCTIONS ===============================
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    61
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    62
// -----------------------------------------------------------------------------
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    63
// CTestDmDDFObject::CTestDmDDFObject
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    64
// C++ default constructor can NOT contain any code, that
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    65
// might leave.
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    66
// -----------------------------------------------------------------------------
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    67
//
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    68
CTestDmDDFObject::CTestDmDDFObject( CStifLogger *aLog )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    69
	: iName( 0 )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    70
	, iAccessTypes()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    71
	, iDefaultValue( 0 )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    72
	, iDescription( 0 )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    73
	, iFormat( (TDFFormat)0 )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    74
	, iOccurence( (TOccurence)0 )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    75
	, iScope( (TScope)0 )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    76
	, iTitle ( 0 )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    77
	, iMimeType( 0 )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    78
	, iObjectGroup( EFalse )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    79
	, iLog( aLog )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    80
//	RPointerArray<CTestDmDDFObject> iChildren;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    81
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    82
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    83
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    84
// -----------------------------------------------------------------------------
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    85
// CTestDmDDFObject::ConstructL
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    86
// Symbian 2nd phase constructor can leave.
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    87
// -----------------------------------------------------------------------------
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    88
//
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    89
void CTestDmDDFObject::ConstructL()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    90
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    91
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    92
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    93
// -----------------------------------------------------------------------------
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    94
// CTestDmDDFObject::NewL
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    95
// Two-phased constructor.
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    96
// -----------------------------------------------------------------------------
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    97
//
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    98
CTestDmDDFObject* CTestDmDDFObject::NewL( CStifLogger *aLog )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
    99
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   100
    CTestDmDDFObject* self = CTestDmDDFObject::NewLC( aLog );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   101
    CleanupStack::Pop( self );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   102
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   103
    return self;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   104
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   105
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   106
CTestDmDDFObject* CTestDmDDFObject::NewLC( CStifLogger *aLog )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   107
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   108
    CTestDmDDFObject* self = new( ELeave ) CTestDmDDFObject( aLog );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   109
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   110
    CleanupStack::PushL( self );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   111
    self->ConstructL();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   112
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   113
    return self;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   114
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   115
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   116
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   117
// Destructor
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   118
CTestDmDDFObject::~CTestDmDDFObject()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   119
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   120
	delete iName;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   121
	delete iDefaultValue;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   122
	delete iDescription;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   123
	delete iTitle;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   124
	delete iMimeType;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   125
	iChildren.ResetAndDestroy();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   126
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   127
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   128
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   129
// -----------------------------------------------------------------------------
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   130
// CTestDmDDFObject::?member_function
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   131
// ?implementation_description
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   132
// (other items were commented in a header).
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   133
// -----------------------------------------------------------------------------
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   134
//
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   135
/*?type CTestDmDDFObject::?member_function(
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   136
    ?arg_type arg,
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   137
    ?arg_type arg )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   138
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   139
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   140
    ?code
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   141
    
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   142
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   143
*/
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   144
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   145
void CTestDmDDFObject::SetAccessTypesL( TSmlDmAccessTypes aAccessTypes )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   146
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   147
	iLog->Log( _L8( "SetAccessTypesL, aAccessTypes=%d" ), aAccessTypes.GetACL() );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   148
	iAccessTypes = aAccessTypes;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   149
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   150
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   151
void CTestDmDDFObject::SetDefaultValueL( const TDesC8& aDefaultValue )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   152
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   153
	iLog->Log( _L8( "SetDefaultValueL, aDefaultValue='%S'" ), &aDefaultValue );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   154
	delete iDefaultValue;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   155
	iDefaultValue = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   156
	iDefaultValue = aDefaultValue.AllocL();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   157
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   158
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   159
void CTestDmDDFObject::SetDescriptionL( const TDesC8& aDescription )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   160
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   161
	iLog->Log( _L8( "SetDescriptionL, aDescription='%S'" ), &aDescription );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   162
	delete iDescription;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   163
	iDescription = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   164
	iDescription = aDescription.AllocL();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   165
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   166
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   167
void CTestDmDDFObject::SetDFFormatL( TDFFormat aFormat )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   168
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   169
	iLog->Log( _L8( "SetDFFormatL, aFormat=%d" ), aFormat );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   170
	iFormat = aFormat;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   171
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   172
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   173
void CTestDmDDFObject::SetOccurenceL( TOccurence aOccurence )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   174
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   175
	iLog->Log( _L8( "SetOccurenceL, aOccurence=%d" ), aOccurence );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   176
	iOccurence = aOccurence;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   177
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   178
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   179
void CTestDmDDFObject::SetScopeL( TScope aScope )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   180
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   181
	iLog->Log( _L8( "SetScopeL, aScope=%d" ), aScope );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   182
	iScope = aScope;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   183
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   184
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   185
void CTestDmDDFObject::SetDFTitleL( const TDesC8& aTitle )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   186
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   187
	iLog->Log( _L8( "SetDFTitleL, aTitle='%S'" ), &aTitle );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   188
	delete iTitle;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   189
	iTitle = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   190
	iTitle = aTitle.AllocL();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   191
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   192
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   193
void CTestDmDDFObject::AddDFTypeMimeTypeL( const TDesC8& aMimeType )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   194
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   195
	iLog->Log( _L8( "AddDFTypeMimeTypeL, aMimeType='%S'" ), &aMimeType );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   196
	delete iMimeType;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   197
	iMimeType = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   198
	iMimeType = aMimeType.AllocL();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   199
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   200
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   201
void CTestDmDDFObject::SetAsObjectGroup()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   202
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   203
	iLog->Log( _L8( "SetAsObjectGroup, true" ) );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   204
	iObjectGroup = ETrue;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   205
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   206
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   207
MSmlDmDDFObject& CTestDmDDFObject::AddChildObjectL(const TDesC8& aNodeName)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   208
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   209
	iLog->Log( _L8( "AddChildObjectL, aNodeName='%S'" ), &aNodeName );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   210
	CTestDmDDFObject* child = CTestDmDDFObject::NewLC( iLog ); //, aNodeName );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   211
	child->SetNameL( aNodeName );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   212
	iChildren.AppendL( child );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   213
	CleanupStack::Pop( child ); // Don't destroy
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   214
	return *child;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   215
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   216
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   217
MSmlDmDDFObject& CTestDmDDFObject::AddChildObjectGroupL()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   218
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   219
	iLog->Log( _L8( "AddChildObjectGroupL, ''" ) );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   220
	CTestDmDDFObject* child = CTestDmDDFObject::NewLC( iLog ); //, KNullDesC );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   221
	child->SetAsObjectGroup();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   222
	iChildren.AppendL( child );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   223
	CleanupStack::Pop( child ); // Don't destroy
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   224
	return *child;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   225
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   226
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   227
// Own functions
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   228
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   229
void CTestDmDDFObject::SetNameL( const TDesC8& aName )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   230
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   231
	delete iName;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   232
	iName = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   233
	iName = aName.AllocL();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   234
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   235
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   236
void CTestDmDDFObject::DumpL( const TDesC8& aParentName, TBool aFullDump )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   237
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   238
	TPtrC8 name( _L8("<X>") );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   239
	if (iName && iName->Length() > 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   240
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   241
		name.Set( *iName );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   242
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   243
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   244
	HBufC8* fullName = HBufC8::NewLC( aParentName.Length() + name.Length() + 1 );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   245
	*fullName = aParentName;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   246
	if (aParentName.Length() > 0 && aParentName[ aParentName.Length() - 1 ] != '/')
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   247
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   248
		fullName->Des().Append( _L8("/"));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   249
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   250
	fullName->Des().Append( name );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   251
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   252
	/* Translate some members to text for dumping */
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   253
	TBuf8<20> strAccessTypes;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   254
	TUint8 accessTypes = iAccessTypes.GetACL();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   255
	if ((accessTypes & iAccessTypes.EAccessType_Add) != 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   256
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   257
		strAccessTypes.Append( _L8("A") );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   258
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   259
	if ((accessTypes & iAccessTypes.EAccessType_Copy) != 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   260
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   261
		strAccessTypes.Append( _L8("C") );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   262
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   263
	if ((accessTypes & iAccessTypes.EAccessType_Delete) != 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   264
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   265
		strAccessTypes.Append( _L8("D") );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   266
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   267
	if ((accessTypes & iAccessTypes.EAccessType_Exec) != 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   268
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   269
		strAccessTypes.Append( _L8("E") );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   270
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   271
	if ((accessTypes & iAccessTypes.EAccessType_Get) != 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   272
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   273
		strAccessTypes.Append( _L8("G") );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   274
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   275
	if ((accessTypes & iAccessTypes.EAccessType_Replace) != 0)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   276
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   277
		strAccessTypes.Append( _L8("R") );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   278
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   279
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   280
	TBuf8<20> strFormat;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   281
	switch( iFormat )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   282
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   283
	case EB64:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   284
		strFormat = _L8("Base64");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   285
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   286
	case EBool:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   287
		strFormat = _L8("Bool");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   288
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   289
	case EChr:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   290
		strFormat = _L8("Chr");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   291
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   292
	case EInt:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   293
		strFormat = _L8("Int");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   294
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   295
	case ENode:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   296
		strFormat = _L8("Node");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   297
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   298
	case ENull:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   299
		strFormat = _L8("Null");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   300
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   301
	case EXml:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   302
		strFormat = _L8("Xml");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   303
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   304
	case EBin:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   305
		strFormat = _L8("Bin");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   306
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   307
	default:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   308
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   309
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   310
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   311
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   312
	TBuf8<20> strOccurence;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   313
	switch( iOccurence )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   314
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   315
	case EOne:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   316
		/** The node appears exactly once */
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   317
		strOccurence = _L8("M:1");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   318
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   319
	case EZeroOrOne:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   320
		/** The node is optional and may appear zero or once */
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   321
		strOccurence = _L8("O:0-1");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   322
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   323
	case EZeroOrMore:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   324
		/** The node is optional and may appear zero or more times */
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   325
		strOccurence = _L8("O:0-*");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   326
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   327
	case EOneOrMore:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   328
		/** The node is mandatory and may appear once or more times */
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   329
		strOccurence = _L8("M:1-*");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   330
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   331
	case EZeroOrN:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   332
		/** The node is optional and may appear between once and 'N' times */
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   333
		strOccurence = _L8("O:1-N");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   334
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   335
	case EOneOrN:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   336
		/** The node is mandatory and may appear between once and 'N' times */
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   337
		strOccurence = _L8("M:1-N");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   338
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   339
	default:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   340
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   341
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   342
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   343
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   344
	TBuf8<20> strScope;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   345
	switch( iScope)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   346
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   347
	case EPermanent:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   348
		/** The node appears exactly once */
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   349
		strScope = _L8("Permanent");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   350
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   351
	case EDynamic:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   352
		/** The node is optional and may appear zero or once */
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   353
		strScope = _L8("O:Dynamic");
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   354
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   355
	default:
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   356
		break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   357
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   358
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   359
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   360
	/* Dump main data */
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   361
	if (aFullDump)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   362
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   363
		iLog->Log( _L8( "DDFObject: '%S'" ), fullName );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   364
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   365
		else
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   366
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   367
		iLog->Log( _L8( "DDFObject: '%S'   (%S), %S, %S, %S" ),
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   368
					fullName, &strAccessTypes, &strFormat, &strOccurence, &strScope );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   369
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   370
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   371
	/* Dump members */
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   372
	if (aFullDump)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   373
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   374
		TPtrC8 empty( _L8( "<null>" ) );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   375
		#define CHK_NULL(a) ((a)==0?(TDesC8*)(&empty):(TDesC8*)(a))
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   376
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   377
		iLog->Log( _L8( "    iName=='%S'" ), iName );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   378
		iLog->Log( _L8( "    iAccessTypes=%d (%S)" ), iAccessTypes.GetACL(), &strAccessTypes );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   379
		iLog->Log( _L8( "    iDefaultValue='%S'" ), CHK_NULL(iDefaultValue));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   380
		iLog->Log( _L8( "    iDescription='%S'" ), CHK_NULL(iDescription ));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   381
		iLog->Log( _L8( "    iFormat=%d (%S)" ), iFormat, &strFormat );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   382
		iLog->Log( _L8( "    iOccurence=%d (%S)" ), iOccurence, &strOccurence );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   383
		iLog->Log( _L8( "    iScope=%d (%S)" ), iScope, &strScope );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   384
		iLog->Log( _L8( "    iTitle='%S'" ), CHK_NULL(iTitle ));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   385
		iLog->Log( _L8( "    iMimeType='%S'" ), CHK_NULL(iMimeType ));
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   386
		iLog->Log( _L8( "----------------------------------" ) );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   387
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   388
	
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   389
	/* Dump children */
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   390
	for (TInt i = 0 ; i < iChildren.Count() ; i++)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   391
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   392
		iChildren[i]->DumpL( *fullName, aFullDump );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   393
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   394
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   395
	CleanupStack::PopAndDestroy( fullName );
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   396
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   397
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   398
/*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   399
void CTestDmDDFObject::ExternalizeL(RWriteStream& aStream) const
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   400
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   401
	X;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   402
	aStream << *iName << eol;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   403
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   404
*/
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   405
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   406
const TDesC8& CTestDmDDFObject::Name()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   407
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   408
	return (iName != 0) ? *iName : KNullDesC8();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   409
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   410
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   411
TSmlDmAccessTypes  CTestDmDDFObject::AccessTypes()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   412
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   413
	return iAccessTypes;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   414
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   415
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   416
const TDesC8& CTestDmDDFObject::DefaultValue()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   417
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   418
	return (iDefaultValue != 0) ? *iDefaultValue : KNullDesC8();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   419
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   420
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   421
const TDesC8& CTestDmDDFObject::Description()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   422
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   423
	return (iDescription != 0) ? *iDescription : KNullDesC8();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   424
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   425
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   426
CTestDmDDFObject::TDFFormat CTestDmDDFObject::DFFormat()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   427
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   428
	return iFormat;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   429
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   430
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   431
CTestDmDDFObject::TOccurence CTestDmDDFObject::Occurence()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   432
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   433
	return iOccurence;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   434
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   435
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   436
CTestDmDDFObject::TScope CTestDmDDFObject::Scope()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   437
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   438
	return iScope;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   439
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   440
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   441
const TDesC8& CTestDmDDFObject::DFTitle()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   442
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   443
	return (iTitle != 0) ? *iTitle : KNullDesC8();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   444
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   445
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   446
const TDesC8& CTestDmDDFObject::DFTypeMimeType()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   447
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   448
	return (iMimeType != 0) ? *iMimeType : KNullDesC8();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   449
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   450
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   451
TBool CTestDmDDFObject::ObjectGroup()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   452
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   453
	return iObjectGroup;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   454
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   455
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   456
TInt CTestDmDDFObject::ChildObjectCount()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   457
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   458
	return iChildren.Count();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   459
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   460
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   461
CTestDmDDFObject& CTestDmDDFObject::ChildObject( TInt aIndex )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   462
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   463
	return *iChildren[aIndex];
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   464
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   465
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   466
CTestDmDDFObject* CTestDmDDFObject::FindChildObject( const TDesC8& aName )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   467
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   468
	CTestDmDDFObject* foundObject = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   469
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   470
	for (TInt i = 0 ; i < iChildren.Count() ; i++)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   471
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   472
		if ( aName.CompareC( iChildren[i]->Name() ) == 0 )
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   473
			{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   474
			foundObject = iChildren[i];
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   475
			break;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   476
			}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   477
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   478
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   479
	return foundObject;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   480
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   481
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   482
TInt CTestDmDDFObject::SubObjectsCount()
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   483
	{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   484
	TInt count = 0;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   485
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   486
	TInt i;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   487
	for (i = 0 ; i < iChildren.Count() ; i++)
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   488
		{
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   489
		count += iChildren[i]->SubObjectsCount();
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   490
		}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   491
	count += i;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   492
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   493
	return count;
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   494
	}
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   495
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   496
/*
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   497
// ========================== OTHER EXPORTED FUNCTIONS =========================
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   498
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   499
// -----------------------------------------------------------------------------
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   500
// ?function_name implements...
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   501
// ?implementation_description.
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   502
// Returns: ?value_1: ?description
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   503
//          ?value_n: ?description
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   504
//                    ?description
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   505
// -----------------------------------------------------------------------------
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   506
//
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   507
?type  ?function_name(
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   508
    ?arg_type arg,  // ?description
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   509
    ?arg_type arg )  // ?description
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   510
    {
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   511
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   512
    ?code
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   513
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   514
    }
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   515
*/
7464c1e21dae 201008_internal
hgs
parents:
diff changeset
   516
//  End of File