tsrc/provisioningenginestub/src/cwpparameterstub.cpp
changeset 0 f0cf47e981f9
equal deleted inserted replaced
-1:000000000000 0:f0cf47e981f9
       
     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 
       
    19 
       
    20 #include "cwpparameter.h"
       
    21 #include "mwpvisitor.h"
       
    22 
       
    23 
       
    24 // --------------------------------------------------------------------------
       
    25 //
       
    26 // --------------------------------------------------------------------------
       
    27 //
       
    28 CWPParameter* CWPParameter::NewL()
       
    29     {
       
    30     CWPParameter* self = CWPParameter::NewL();
       
    31     CleanupStack::Pop();
       
    32     return self;
       
    33     }
       
    34 
       
    35 
       
    36 // --------------------------------------------------------------------------
       
    37 //
       
    38 // --------------------------------------------------------------------------
       
    39 //     
       
    40 CWPParameter* CWPParameter::NewLC()
       
    41     {
       
    42     CWPParameter* self = new ( ELeave ) CWPParameter();
       
    43     CleanupStack::PushL( self );
       
    44     self->ConstructL();
       
    45     return self;
       
    46     }
       
    47 
       
    48 
       
    49 // --------------------------------------------------------------------------
       
    50 //
       
    51 // --------------------------------------------------------------------------
       
    52 //     
       
    53 CWPParameter::~CWPParameter()
       
    54     {
       
    55     delete iName;
       
    56     delete iValue;
       
    57     }
       
    58     
       
    59 
       
    60 // --------------------------------------------------------------------------
       
    61 //
       
    62 // --------------------------------------------------------------------------
       
    63 //     
       
    64 EXPORT_C void CWPParameter::SetID( TInt aId )
       
    65     {
       
    66     iParameterID = aId;
       
    67     }
       
    68     
       
    69 
       
    70 // --------------------------------------------------------------------------
       
    71 //
       
    72 // --------------------------------------------------------------------------
       
    73 //     
       
    74 EXPORT_C TInt CWPParameter::ID() const
       
    75     {
       
    76     return iParameterID;
       
    77     }
       
    78 
       
    79 // --------------------------------------------------------------------------
       
    80 //
       
    81 // --------------------------------------------------------------------------
       
    82 //     
       
    83 EXPORT_C void CWPParameter::SetNameL( const TDesC& aValue )
       
    84     {
       
    85     delete iName;
       
    86     iName = NULL;
       
    87     iName = aValue.AllocL();
       
    88     }
       
    89 
       
    90 // --------------------------------------------------------------------------
       
    91 //
       
    92 // --------------------------------------------------------------------------
       
    93 //     
       
    94 EXPORT_C const TDesC& CWPParameter::Name() const
       
    95     {
       
    96     if ( iName )
       
    97         {
       
    98         return *iName;
       
    99         }
       
   100     return KNullDesC;
       
   101     }
       
   102 
       
   103 // --------------------------------------------------------------------------
       
   104 //
       
   105 // --------------------------------------------------------------------------
       
   106 //     
       
   107 EXPORT_C void CWPParameter::SetValueL( const TDesC& aValue )
       
   108     {
       
   109     delete iValue;
       
   110     iValue = NULL;
       
   111     iValue = aValue.AllocL();
       
   112     }
       
   113 
       
   114 // --------------------------------------------------------------------------
       
   115 //
       
   116 // --------------------------------------------------------------------------
       
   117 //     
       
   118 EXPORT_C const TDesC& CWPParameter::Value() const
       
   119     {
       
   120     if ( iValue )
       
   121         {
       
   122         return *iValue;
       
   123         }
       
   124     return KNullDesC;
       
   125     }
       
   126 
       
   127 
       
   128 // --------------------------------------------------------------------------
       
   129 //
       
   130 // --------------------------------------------------------------------------
       
   131 //
       
   132 void CWPParameter::CallVisitorL( MWPVisitor& aVisitor )
       
   133     {
       
   134     aVisitor.VisitL( *this );
       
   135     }
       
   136         
       
   137 
       
   138 // --------------------------------------------------------------------------
       
   139 //
       
   140 // --------------------------------------------------------------------------
       
   141 //
       
   142 TInt CWPParameter::Type() const
       
   143     {
       
   144     return 0;
       
   145     }
       
   146 
       
   147 
       
   148 // --------------------------------------------------------------------------
       
   149 //
       
   150 // --------------------------------------------------------------------------
       
   151 //
       
   152 void CWPParameter::ExternalizeL( RWriteStream& /*aStream*/ ) const
       
   153     {
       
   154     }
       
   155     
       
   156     
       
   157 // --------------------------------------------------------------------------
       
   158 //
       
   159 // --------------------------------------------------------------------------
       
   160 //
       
   161 void CWPParameter::InternalizeL( RReadStream& /*aStream*/ )
       
   162     {
       
   163     }
       
   164 
       
   165 
       
   166 // --------------------------------------------------------------------------
       
   167 //
       
   168 // --------------------------------------------------------------------------
       
   169 //
       
   170 CWPParameter::CWPParameter()
       
   171     {
       
   172     }
       
   173     
       
   174 
       
   175 // --------------------------------------------------------------------------
       
   176 //
       
   177 // --------------------------------------------------------------------------
       
   178 //
       
   179 void CWPParameter::ConstructL()
       
   180     {
       
   181     }
       
   182 
       
   183 
       
   184