phoneplugins/telbranding/src/telbrandingsettingshandler.cpp
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     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:  Sets brand according service id.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 //  Include Files  
       
    20 #include "telbrandingsettingshandler.h"	// CTelBrandingSettingHandler
       
    21 #include <spsettings.h>
       
    22 #include <spproperty.h>
       
    23 
       
    24 //  Member Functions
       
    25 
       
    26 // ---------------------------------------------------------
       
    27 // CTelBrandingSettingsHandler::NewL
       
    28 // ---------------------------------------------------------
       
    29 //
       
    30 CTelBrandingSettingsHandler* CTelBrandingSettingsHandler::NewL()
       
    31     {
       
    32     CTelBrandingSettingsHandler* self = 
       
    33         new (ELeave) CTelBrandingSettingsHandler();
       
    34     
       
    35     CleanupStack::PushL( self );
       
    36     self->ConstructL();
       
    37     CleanupStack::Pop( self );
       
    38     return self;
       
    39     }
       
    40 
       
    41 // ---------------------------------------------------------
       
    42 // CTelBrandingSettingsHandler::CTelBrandingSettingsHandler
       
    43 // ---------------------------------------------------------
       
    44 //
       
    45 CTelBrandingSettingsHandler::CTelBrandingSettingsHandler()
       
    46     {
       
    47     }
       
    48 
       
    49 // ---------------------------------------------------------
       
    50 // CTelBrandingSettingsHandler::ConstructL
       
    51 // ---------------------------------------------------------
       
    52 //
       
    53 void CTelBrandingSettingsHandler::ConstructL()
       
    54     {
       
    55 
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------
       
    59 // CTelBrandingSettingsHandler::BrandId
       
    60 // ---------------------------------------------------------
       
    61 //
       
    62 HBufC* CTelBrandingSettingsHandler::BrandIdLC( TUint32 aServiceId ) const
       
    63     {
       
    64     HBufC* ret = HBufC::NewLC( KSPMaxDesLength );
       
    65     TPtr ptr( ret->Des() );
       
    66     CSPSettings* settings = CSPSettings::NewLC();
       
    67     CSPProperty* property = CSPProperty::NewLC();
       
    68     
       
    69     User::LeaveIfError( settings->FindPropertyL( aServiceId, 
       
    70         EPropertyBrandId, *property) );
       
    71     
       
    72     User::LeaveIfError( property->GetValue( ptr ) );
       
    73     
       
    74     CleanupStack::PopAndDestroy( property );
       
    75     CleanupStack::PopAndDestroy( settings );
       
    76     
       
    77     return ret;
       
    78     }
       
    79 
       
    80 // ---------------------------------------------------------
       
    81 // CTelBrandingSettingsHandler:::~CTelBrandingSettingsHandler
       
    82 // ---------------------------------------------------------
       
    83 //
       
    84 CTelBrandingSettingsHandler::~CTelBrandingSettingsHandler()
       
    85     {
       
    86 
       
    87     }
       
    88 
       
    89 
       
    90 
       
    91 // end of file