mds_plat/metadata_engine_api/inc/mdetextproperty.inl
changeset 58 fe894bb075c2
parent 51 87e65c44ff3a
child 60 79f826a55db2
equal deleted inserted replaced
51:87e65c44ff3a 58:fe894bb075c2
     1 /*
       
     2 * Copyright (c) 2008-2009 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:  CMdETextProperty's compatibility wrapper to CMdEProperty
       
    15 *
       
    16 */
       
    17 
       
    18 _LIT( KCMdETextPropertyGetValuePanic, "CMdETextProperty::Value" );
       
    19 _LIT( KCMdETextPropertySetValuePanic, "CMdETextProperty::SetValueL" );
       
    20 
       
    21 // ---------------------------------------------------------------------------
       
    22 // Value
       
    23 // ---------------------------------------------------------------------------
       
    24 //
       
    25 inline const TDesC& CMdETextProperty::Value() const
       
    26 	{
       
    27 	TDesC* des = NULL;
       
    28 
       
    29 	TRAPD( err, des = CONST_CAST( TDesC*, &TextValueL() ) );
       
    30 	if( err != KErrNone )
       
    31 		{
       
    32 #ifdef _DEBUG
       
    33 		User::Panic( KCMdETextPropertyGetValuePanic, KErrNotSupported );
       
    34 #endif
       
    35 		return KNullDesC;
       
    36 		}
       
    37 	return *des;
       
    38 	}
       
    39 
       
    40 // ---------------------------------------------------------------------------
       
    41 // SetValueL
       
    42 // ---------------------------------------------------------------------------
       
    43 //
       
    44 inline void CMdETextProperty::SetValueL(const TDesC& aValue)
       
    45 	{
       
    46 	TRAPD( err, SetTextValueL( aValue ) );
       
    47 	if( err != KErrNone )
       
    48 		{
       
    49 #ifdef _DEBUG		
       
    50 		User::Panic( KCMdETextPropertySetValuePanic, KErrNotSupported );
       
    51 #endif
       
    52 		}
       
    53 	}
       
    54