uiservicetabsettings/src/cvimpstsettings.cpp
branchRCL_3
changeset 22 3104fc151679
parent 21 2b7283837edb
child 23 9a48e301e94b
equal deleted inserted replaced
21:2b7283837edb 22:3104fc151679
     1 /*
       
     2 * Copyright (c) 2008 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:  settings container.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include    <e32std.h>
       
    20 #include	<centralrepository.h>
       
    21 #include    <s32mem.h>
       
    22 
       
    23 #include    "cvimpstsettings.h"
       
    24 #include    "cvimpstsettingskeyvaluepairs.h"
       
    25 #include    "cvimpstsettingskeyvaluepair.h"
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 // ================= MEMBER FUNCTIONS =======================
       
    31 // -----------------------------------------------------------------------------
       
    32 // CVIMPSTSettings::NewL()
       
    33 // Two-phased constructor.
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 CVIMPSTSettings* CVIMPSTSettings::NewL()
       
    37     {
       
    38     CVIMPSTSettings* self = CVIMPSTSettings::NewLC();
       
    39     CleanupStack::Pop();
       
    40     return self;
       
    41     }
       
    42 
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // CVIMPSTSettings::NewLC()
       
    46 // Two-phased constructor.
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 CVIMPSTSettings* CVIMPSTSettings::NewLC()
       
    50     {
       
    51     CVIMPSTSettings* self = new (ELeave) CVIMPSTSettings();
       
    52     CleanupStack::PushL( self );
       
    53     self->iKeyValuePairs = CVIMPSTSettingsKeyValuePairs::NewL();   
       
    54     return self;
       
    55     }
       
    56 
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CVIMPSTSettings::~CVIMPSTSettings()
       
    60 // Destructor
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 CVIMPSTSettings::~CVIMPSTSettings()
       
    64     {    
       
    65     delete iKeyValuePairs;
       
    66     }
       
    67 
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CVIMPSTSettings::CVIMPSTSettings()
       
    71 // C++ default constructor can NOT contain any code, that
       
    72 // might leave.
       
    73 // -----------------------------------------------------------------------------
       
    74 //
       
    75 CVIMPSTSettings::CVIMPSTSettings()
       
    76     {
       
    77     }
       
    78 // -----------------------------------------------------------------------------
       
    79 // CVIMPSTSettings::SetOpaqueDesC16()
       
    80 // Key-value pairs.
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 TInt CVIMPSTSettings::SetOpaqueDesC16( const TDesC& aKey,
       
    84         const TDesC16& aValue )
       
    85     {
       
    86     TInt err = iKeyValuePairs->SetValueDesC16( aKey, aValue );    
       
    87     return err;
       
    88     }
       
    89 // -----------------------------------------------------------------------------
       
    90 // CVIMPSTSettings::GetOpaqueDesC16()
       
    91 // Key-value pairs.
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 TInt CVIMPSTSettings::GetOpaqueDesC16( const TDesC& aKey,
       
    95                                                  TPtrC16& aValue ) const
       
    96     {
       
    97     return iKeyValuePairs->GetValueDesC16( aKey, aValue );
       
    98     }
       
    99 
       
   100 // -----------------------------------------------------------------------------
       
   101 // CVIMPSTSettings::DeleteOpaque()
       
   102 // Key-value pairs.
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 TInt CVIMPSTSettings::DeleteOpaque( const TDesC& aKey )
       
   106     {
       
   107     return iKeyValuePairs->DeletePair( aKey );
       
   108     }
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111 // CVIMPSTSettings::KeyValuePairs()
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 CVIMPSTSettingsKeyValuePairs& CVIMPSTSettings::KeyValuePairs()
       
   115     {
       
   116     return *iKeyValuePairs;
       
   117     }
       
   118 //  End of File
       
   119