PECengine/PresenceManager2/SrcSearch/CPEngSearchCriteria2.cpp
author Fionntina Carville <fionntinac@symbian.org>
Mon, 15 Nov 2010 11:27:49 +0000
branchRCL_3
changeset 22 df9aab66f73e
parent 0 094583676ce7
permissions -rw-r--r--
Bug 3539. Update localisation mappings.

/*
* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Search criteria.
*
*/

#include "CPEngSearchCriteria2.h"
#include <PEngPresenceEngineConsts2.h>


// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// CPEngNWSessionSlot2::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
EXPORT_C CPEngSearchCriteria2* CPEngSearchCriteria2::NewL()
    {
    CPEngSearchCriteria2* self = new( ELeave )CPEngSearchCriteria2;
    return self;
    }


// -----------------------------------------------------------------------------
// CPEngNWSessionSlot2::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
EXPORT_C CPEngSearchCriteria2* CPEngSearchCriteria2::NewLC()
    {
    CPEngSearchCriteria2* self = new( ELeave )CPEngSearchCriteria2;
    CleanupStack::PushL( self );
    return self;
    }



// Destructor
CPEngSearchCriteria2::~CPEngSearchCriteria2()
    {
    delete iSearchValue;
    }



// -----------------------------------------------------------------------------
// CPEngSearchCriteria2::CPEngSearchCriteria2()
// C++ default constructor can NOT contain any code, that
// might leave.
// -----------------------------------------------------------------------------
//
CPEngSearchCriteria2::CPEngSearchCriteria2()
        : iElement( KPEngNullSearchElement )
    {
    }


// -----------------------------------------------------------------------------
// CPEngSearchCriteria2::SetSearchL()
// -----------------------------------------------------------------------------
//
EXPORT_C void CPEngSearchCriteria2::SetSearchL( TInt aElement,
                                                const TDesC& aSearchValue )
    {
    HBufC* tmp = aSearchValue.AllocL();

    delete iSearchValue;
    iSearchValue = tmp;
    iElement = aElement;
    }


// -----------------------------------------------------------------------------
// CPEngSearchCriteria2::Element()
// -----------------------------------------------------------------------------
//
EXPORT_C TInt CPEngSearchCriteria2::Element() const
    {
    return iElement;
    }


// -----------------------------------------------------------------------------
// CPEngSearchCriteria2::SearchValue()
// -----------------------------------------------------------------------------
//
EXPORT_C const TDesC& CPEngSearchCriteria2::SearchValue() const
    {
    if ( iSearchValue )
        {
        return *iSearchValue;
        }

    return KNullDesC;
    }


//End of file