tsrc/provisioningenginestub/src/cwpcharacteristicstub.cpp
changeset 15 ccd8e69b5392
parent 2 b31261fd4e04
child 20 e8be2c2e049d
child 22 496ad160a278
equal deleted inserted replaced
2:b31261fd4e04 15:ccd8e69b5392
     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: 
       
    15 *
       
    16 */
       
    17 
       
    18 #include "cwpcharacteristic.h"
       
    19 
       
    20 
       
    21 // --------------------------------------------------------------------------
       
    22 //
       
    23 // --------------------------------------------------------------------------
       
    24 //
       
    25 CWPCharacteristic* CWPCharacteristic::NewL( TInt aType )
       
    26     {
       
    27     CWPCharacteristic* self = CWPCharacteristic::NewL( aType );
       
    28     CleanupStack::Pop();
       
    29     return self;
       
    30     }
       
    31 
       
    32 
       
    33 // --------------------------------------------------------------------------
       
    34 //
       
    35 // --------------------------------------------------------------------------
       
    36 //     
       
    37 CWPCharacteristic* CWPCharacteristic::NewLC( TInt aType )
       
    38     {
       
    39     CWPCharacteristic* self = new ( ELeave ) CWPCharacteristic( aType );
       
    40     CleanupStack::PushL( self );
       
    41     self->ConstructL();
       
    42     return self;
       
    43     }
       
    44 
       
    45 
       
    46 // --------------------------------------------------------------------------
       
    47 //
       
    48 // --------------------------------------------------------------------------
       
    49 //
       
    50 CWPCharacteristic::~CWPCharacteristic()
       
    51     {
       
    52     delete iName;
       
    53     iElements.ResetAndDestroy();
       
    54     }
       
    55 
       
    56 
       
    57 // --------------------------------------------------------------------------
       
    58 //
       
    59 // --------------------------------------------------------------------------
       
    60 //
       
    61 EXPORT_C void CWPCharacteristic::InsertL(MWPElement* aElement)
       
    62     {
       
    63     iElements.AppendL( aElement );
       
    64     }
       
    65     
       
    66 
       
    67 // --------------------------------------------------------------------------
       
    68 //
       
    69 // --------------------------------------------------------------------------
       
    70 //
       
    71 EXPORT_C void CWPCharacteristic::SetNameL( const TDesC& aValue )
       
    72     {
       
    73     delete iName;
       
    74     iName = NULL;
       
    75     iName = aValue.AllocL();
       
    76     }
       
    77 
       
    78 
       
    79 // --------------------------------------------------------------------------
       
    80 //
       
    81 // --------------------------------------------------------------------------
       
    82 //
       
    83 EXPORT_C const TDesC& CWPCharacteristic::Name() const
       
    84     {
       
    85     if ( iName )
       
    86         {
       
    87         return *iName;
       
    88         }
       
    89     return KNullDesC;
       
    90     }
       
    91     
       
    92 
       
    93 // --------------------------------------------------------------------------
       
    94 //
       
    95 // --------------------------------------------------------------------------
       
    96 //
       
    97 EXPORT_C void CWPCharacteristic::AcceptL( MWPVisitor& aVisitor )
       
    98     {
       
    99     for( TInt i( 0 ); i < iElements.Count(); i++ )
       
   100         {
       
   101         iElements[i]->CallVisitorL( aVisitor );
       
   102         }
       
   103     }
       
   104 
       
   105 
       
   106 // --------------------------------------------------------------------------
       
   107 //
       
   108 // --------------------------------------------------------------------------
       
   109 //
       
   110 void CWPCharacteristic::CallVisitorL( MWPVisitor& aVisitor )
       
   111     {
       
   112     aVisitor.VisitL( *this );
       
   113     }
       
   114         
       
   115 
       
   116 // --------------------------------------------------------------------------
       
   117 //
       
   118 // --------------------------------------------------------------------------
       
   119 //
       
   120 TInt CWPCharacteristic::Type() const
       
   121     {
       
   122     return iType;
       
   123     }
       
   124 
       
   125 
       
   126 // --------------------------------------------------------------------------
       
   127 //
       
   128 // --------------------------------------------------------------------------
       
   129 //
       
   130 void CWPCharacteristic::ExternalizeL( RWriteStream& /*aStream*/ ) const
       
   131     {
       
   132     }
       
   133     
       
   134     
       
   135 // --------------------------------------------------------------------------
       
   136 //
       
   137 // --------------------------------------------------------------------------
       
   138 //
       
   139 void CWPCharacteristic::InternalizeL( RReadStream& /*aStream*/ )
       
   140     {
       
   141     }
       
   142         
       
   143 
       
   144 // --------------------------------------------------------------------------
       
   145 //
       
   146 // --------------------------------------------------------------------------
       
   147 //
       
   148 CWPCharacteristic::CWPCharacteristic( TInt aType )
       
   149     :iType( aType )
       
   150     {
       
   151     }
       
   152 
       
   153 
       
   154 // --------------------------------------------------------------------------
       
   155 //
       
   156 // --------------------------------------------------------------------------
       
   157 //
       
   158 void CWPCharacteristic::ConstructL()
       
   159     {
       
   160     }
       
   161 
       
   162 
       
   163 
       
   164 
       
   165