menufw/hierarchynavigator/hnmetadatamodel/src/hnmdquery.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 
       
    19 #include <xmlengdom.h>
       
    20 // for CleanupResetAndDestroyPushL
       
    21 #include <mmf/common/mmfcontrollerpluginresolver.h>
       
    22 
       
    23 #include "hnmdkeyfactory.h"
       
    24 #include "hnmdbasekey.h"
       
    25 #include "hnmdquery.h"
       
    26 #include "hnconvutils.h"
       
    27 #include "hnmdservicecommand.h"
       
    28 #include "hnmdservice.h"
       
    29 
       
    30 // ======== MEMBER FUNCTIONS ========
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // 
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 void CHnMdQuery::ConstructL( TXmlEngElement aElement )
       
    37     {
       
    38     ASSERT( aElement.Name() == KQueryElementItem8 );
       
    39 
       
    40     SetNameSpaceL( aElement.AttributeNodeL( KNameSpaceAttrName8 ) );
       
    41     iService = CHnMdService::NewL( aElement );
       
    42     }
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 // 
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 CHnMdQuery* CHnMdQuery::NewL( TXmlEngElement aElement )
       
    49     {
       
    50     CHnMdQuery* self = CHnMdQuery::NewLC( aElement );
       
    51     CleanupStack::Pop( self );
       
    52     return self;
       
    53     }
       
    54 
       
    55 // ---------------------------------------------------------------------------
       
    56 // 
       
    57 // ---------------------------------------------------------------------------
       
    58 //
       
    59 CHnMdQuery* CHnMdQuery::NewLC( TXmlEngElement aElement )
       
    60     {
       
    61     CHnMdQuery* self = new( ELeave ) CHnMdQuery();
       
    62     CleanupStack::PushL( self );
       
    63     self->ConstructL( aElement );
       
    64     return self;
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 // 
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 CHnMdQuery::CHnMdQuery()
       
    72     {
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // 
       
    77 // ---------------------------------------------------------------------------
       
    78 //
       
    79 CHnMdQuery::~CHnMdQuery()
       
    80     {
       
    81     iNameSpace.Close();
       
    82     delete iService;
       
    83     }
       
    84   
       
    85 // ---------------------------------------------------------------------------
       
    86 // 
       
    87 // ---------------------------------------------------------------------------
       
    88 //
       
    89 const TDesC& CHnMdQuery::NameSpace() const
       
    90     {
       
    91     return iNameSpace;
       
    92     }
       
    93     
       
    94 // ---------------------------------------------------------------------------
       
    95 // 
       
    96 // ---------------------------------------------------------------------------
       
    97 //
       
    98 void CHnMdQuery::SetNameSpaceL( const TDesC& aNameSpace )
       
    99     {
       
   100     iNameSpace.Close();
       
   101     iNameSpace.CreateL(aNameSpace);
       
   102     }
       
   103 
       
   104 // ---------------------------------------------------------------------------
       
   105 // 
       
   106 // ---------------------------------------------------------------------------
       
   107 //
       
   108 void CHnMdQuery::SetNameSpaceL( TXmlEngAttr aAttr )
       
   109     {
       
   110     HBufC* nspace = HnConvUtils::Str8ToStrLC( aAttr.Value() );
       
   111     SetNameSpaceL( *nspace );
       
   112     
       
   113     // clean up
       
   114     CleanupStack::PopAndDestroy( nspace );
       
   115     }
       
   116 
       
   117 // ---------------------------------------------------------------------------
       
   118 // 
       
   119 // ---------------------------------------------------------------------------
       
   120 //
       
   121 CHnMdService& CHnMdQuery::GetService() const
       
   122     {
       
   123     return *iService;
       
   124     }
       
   125