menufw/hierarchynavigator/hnpresentationmodel/src/hnattributebase.cpp
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2007-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:  abstract base class for attribute models.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "hnattributebase.h"
       
    20 
       
    21 // ============================ MEMBER FUNCTIONS =============================
       
    22 
       
    23 // ---------------------------------------------------------------------------
       
    24 //
       
    25 // ---------------------------------------------------------------------------
       
    26 //
       
    27 EXPORT_C void CHnAttributeBase::SetNameL( const TDesC8& aName )
       
    28     {
       
    29     iName.Close();
       
    30     iName.CreateL( aName.Length() + 1 );
       
    31     iName.Copy( aName );
       
    32     }
       
    33 
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 // ---------------------------------------------------------------------------
       
    37 //
       
    38 EXPORT_C const TDesC8& CHnAttributeBase::Name( ) const
       
    39     {
       
    40     return iName;
       
    41     }
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 // ---------------------------------------------------------------------------
       
    46 //
       
    47 CHnAttributeBase::~CHnAttributeBase( )
       
    48     {
       
    49     iName.Close();
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 EXPORT_C TAttributeType CHnAttributeBase::Type()
       
    57     {
       
    58     return iAttributeType;
       
    59     }
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 //
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 void CHnAttributeBase::RemoveLiwObjects()
       
    66     {
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 EXPORT_C const TDesC8& CHnAttributeBase::Value()
       
    74     {
       
    75     // The descendant should override this if such functionality is provided.
       
    76     // if that functionality is not provided, generally it means that this
       
    77     // should not be invoked this assert in debug.
       
    78     ASSERT(EFalse);
       
    79     return KNullDesC8;
       
    80     }
       
    81 
       
    82 
       
    83 // ---------------------------------------------------------------------------
       
    84 //
       
    85 // ---------------------------------------------------------------------------
       
    86 //
       
    87 EXPORT_C CGulIcon* CHnAttributeBase::GetIcon( TSize* /*aDesiredIconSize*/ )
       
    88     {
       
    89     // The descendant should override this if such functionality is provided.
       
    90     // if that functionality is not provided, generally it means that this
       
    91     // should not be invoked this assert in debug.    
       
    92     ASSERT(EFalse);
       
    93     return NULL;
       
    94     }
       
    95 
       
    96 CHnIconHolder* CHnAttributeBase::GetIconHolder( TSize* /*aDesiredIconSize*/ )
       
    97     {
       
    98     // The descendant should override this just like the other methods.
       
    99     ASSERT( EFalse );
       
   100     return NULL;
       
   101     }