metadataengine/client/src/mdecondition.cpp
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 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:  Base class for all search condition tree nodes.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "mdecondition.h"
       
    19 #include "mdcquery.h"
       
    20 #include "mdepanic.h"
       
    21 #include "mdcserializationbuffer.h"
       
    22 
       
    23 CMdECondition::CMdECondition(TConditionType aType)
       
    24         : iType(aType), iNegated(EFalse)
       
    25     {
       
    26 	__ASSERT_DEBUG(aType > EConditionTypeFirst && aType < EConditionTypeLast,
       
    27 					TMdEPanic::Panic(TMdEPanic::EInternal));
       
    28     }
       
    29 
       
    30 void CMdECondition::ConditionConstruct()
       
    31     {
       
    32     }
       
    33 
       
    34 CMdECondition::~CMdECondition()
       
    35 	{
       
    36 	}
       
    37 
       
    38 EXPORT_C TConditionType CMdECondition::Type() const
       
    39     {
       
    40     return iType;
       
    41     }
       
    42 
       
    43 EXPORT_C TBool CMdECondition::Negate() const
       
    44     {
       
    45     return iNegated;
       
    46     }
       
    47 
       
    48 EXPORT_C void CMdECondition::SetNegate(TBool aNegate)
       
    49     {
       
    50     AssertNotLocked();
       
    51     iNegated = aNegate;
       
    52     }
       
    53 
       
    54 EXPORT_C TBool CMdECondition::Locked() const
       
    55     {
       
    56     return iLocked;
       
    57     }
       
    58 
       
    59 EXPORT_C void CMdECondition::SetLocked(TBool aLocked)
       
    60     {
       
    61     iLocked = aLocked;
       
    62     }
       
    63 
       
    64 void CMdECondition::AssertNotLocked() const
       
    65     {
       
    66     __ASSERT_DEBUG(!iLocked, TMdEPanic::Panic(TMdEPanic::EConditionLocked));
       
    67     }