ncdengine/provider/protocol/src/ncd_cp_queryelementimpl.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006 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 "ncd_cp_queryelementimpl.h"
       
    20 #include "ncd_cp_queryoptionimpl.h"
       
    21 #include "ncd_cp_detailimpl.h"
       
    22 #include "ncdprotocolutils.h"
       
    23 #include "ncdprotocoltypes.h"
       
    24 #include "ncdstring.h"
       
    25 
       
    26 CNcdConfigurationProtocolQueryElementImpl::CNcdConfigurationProtocolQueryElementImpl()
       
    27 : iOptional( EFalse )
       
    28 {
       
    29 }
       
    30 
       
    31 
       
    32 void CNcdConfigurationProtocolQueryElementImpl::ConstructL()
       
    33     {
       
    34     NcdProtocolUtils::AssignEmptyDesL( iId );
       
    35     iLabel = CNcdString::NewL();
       
    36     iMessage = CNcdString::NewL();
       
    37     iDescription = CNcdString::NewL();
       
    38     }
       
    39 
       
    40 CNcdConfigurationProtocolQueryElementImpl::~CNcdConfigurationProtocolQueryElementImpl()
       
    41     {
       
    42     delete iId;
       
    43     delete iLabel;
       
    44     delete iMessage;
       
    45     delete iDescription;
       
    46     iOptions.ResetAndDestroy();
       
    47     delete iDetails;
       
    48     }
       
    49 
       
    50 const TDesC& CNcdConfigurationProtocolQueryElementImpl::Id() const
       
    51     {
       
    52     return *iId;
       
    53     }
       
    54     
       
    55 MNcdQueryItem::TSemantics
       
    56     CNcdConfigurationProtocolQueryElementImpl::Semantics() const
       
    57     {
       
    58     return iSemantics;
       
    59     }
       
    60 
       
    61 MNcdConfigurationProtocolQueryElement::TNcdProtocolQueryElementType
       
    62     CNcdConfigurationProtocolQueryElementImpl::Type() const
       
    63     {
       
    64     return iType;
       
    65     }
       
    66 
       
    67 TBool CNcdConfigurationProtocolQueryElementImpl::Optional() const
       
    68     {
       
    69     return iOptional;
       
    70     }
       
    71 
       
    72 const CNcdString& CNcdConfigurationProtocolQueryElementImpl::Label() const
       
    73     {
       
    74     return *iLabel;
       
    75     }
       
    76 
       
    77 const CNcdString& CNcdConfigurationProtocolQueryElementImpl::Message() const
       
    78     {
       
    79     return *iMessage;
       
    80     }
       
    81 
       
    82 const CNcdString& CNcdConfigurationProtocolQueryElementImpl::Description() const
       
    83     {
       
    84     return *iDescription;
       
    85     }
       
    86 
       
    87 TInt CNcdConfigurationProtocolQueryElementImpl::OptionCount() const
       
    88     {
       
    89     return iOptions.Count();
       
    90     }
       
    91 
       
    92 const MNcdConfigurationProtocolQueryOption&
       
    93 CNcdConfigurationProtocolQueryElementImpl::Option( TInt aIndex ) const
       
    94     {
       
    95     DASSERT( aIndex >= 0 && aIndex < iOptions.Count() );
       
    96     return *iOptions[aIndex];
       
    97     }
       
    98 
       
    99 const MNcdConfigurationProtocolDetail* 
       
   100 CNcdConfigurationProtocolQueryElementImpl::Detail() const
       
   101     {
       
   102     return iDetails;
       
   103     }
       
   104