srsf/nssvasapi/nssvascore/src/nssvasctag.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:29:17 +0100
branchRCL_3
changeset 19 e36f3802f733
parent 0 bf1d17376201
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2002-2006 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:  CNssTag implements MNssTag. In addition, it provides members for use
*               by VAS internal components.
*
*/


// INCLUDE FILES
#include "nssvasctag.h"
#include "rubydebug.h"


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

// ---------------------------------------------------------
// CNssTag::CNssTag
// C++ constructor can NOT contain any code, that might leave.
// ---------------------------------------------------------
//
CNssTag::CNssTag( CNssContext* aContext, CNssRRD* aRRD, 
                  CNssSpeechItem* aSpeechItem )
    {
    iContext = aContext;
    iRRD = aRRD;
    iSpeechItem = aSpeechItem;
    iTagId = KNssVASDbDefaultValue;
    }

// ---------------------------------------------------------
// CNssTag::~CNssTag
// Destructor
// ---------------------------------------------------------
//
CNssTag::~CNssTag()
    {
    delete iContext;
    iContext = NULL;
    
    delete iRRD;
    iRRD = NULL;
    
    delete iSpeechItem;
    iSpeechItem = NULL;
    }

// ---------------------------------------------------------
// CNssTag::Context
// get the context object for this tag
// ---------------------------------------------------------
//
MNssContext* CNssTag::Context()
    {
    return  iContext;
    }

// ---------------------------------------------------------
// CNssTag::RRD
// get the RRD object for this tag
// ---------------------------------------------------------
//
MNssRRD* CNssTag::RRD()
    {
    return  iRRD;
    }

// ---------------------------------------------------------
// CNssTag::SpeechItem
// get the speech item for this tag
// ---------------------------------------------------------
//
MNssSpeechItem* CNssTag::SpeechItem()
    {
    return iSpeechItem;
    }

// ---------------------------------------------------------
// CNssTag::TagId
// get the tag id for this tag
// ---------------------------------------------------------
//
TInt CNssTag::TagId()
    {
    return iTagId;
    }

// ---------------------------------------------------------
// CNssTag::SetTagId
// Set the tag id for this tag
// ---------------------------------------------------------
//
void CNssTag::SetTagId(TInt aId)
    {
    iTagId = aId;
    
    if ( iSpeechItem )
        {
        iSpeechItem->SetTagId( aId );
        }
    }

// ---------------------------------------------------------
// CNssTag::CopyL
// Make a deep copy of the tag
// ---------------------------------------------------------
//
CNssTag* CNssTag::CopyL()
    {
    CNssContext *context = iContext->CopyL();
    CleanupStack::PushL( context );
    CNssRRD *rrd = iRRD->CopyL();
    CleanupStack::PushL( rrd );
    CNssSpeechItem *speechItem = iSpeechItem->CopyL( context );
    CleanupStack::PushL( speechItem );
    CNssTag* copy = new (ELeave) CNssTag( context, rrd, speechItem );
    CleanupStack::Pop( speechItem );
    CleanupStack::Pop( rrd );
    CleanupStack::Pop( context );
    copy->iTagId = iTagId;
    return copy;
    }

//  End of File