menufw/hierarchynavigator/hnmetadatamodel/src/hnmdvaluebase.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:   
       
    15 *
       
    16 */
       
    17 
       
    18 #include <xmlengdom.h>
       
    19 #include <liwservicehandler.h>
       
    20 
       
    21 #include "hnmdvaluebase.h"
       
    22 #include "hnmdvalueimage.h"
       
    23 #include "hnmdvaluetext.h"
       
    24 
       
    25 // ======== MEMBER FUNCTIONS ========
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // 
       
    29 // ---------------------------------------------------------------------------
       
    30 //  
       
    31 CHnMdValueBase* CHnMdValueBase::CreateL(
       
    32         const TXmlEngElement& aElement, THnMdCommonPointers* aCmnPtrs )
       
    33     {
       
    34     CHnMdValueBase* ret( NULL );
       
    35             
       
    36     // check the child element name
       
    37     if ( !aElement.Name().Compare( KImageElementItem8 ) )
       
    38         {
       
    39         ret = CHnMdValueImage::NewL( aElement, aCmnPtrs);
       
    40         }
       
    41     else if ( !aElement.Name().Compare( KTextElementItem8 ) )
       
    42         {
       
    43         ret = CHnMdValueText::NewL(aElement, aCmnPtrs);
       
    44         }
       
    45     else if ( !aElement.Name().Compare( KOutputElementItem8 ) )
       
    46         {
       
    47         // now we have two options, element value, or attribute
       
    48         // text will hande it
       
    49         ret = CHnMdValueText::NewL(aElement, aCmnPtrs);
       
    50         }
       
    51     else
       
    52         {
       
    53         User::Leave( KErrNotSupported );
       
    54         }    
       
    55     return ret;
       
    56     }
       
    57 
       
    58