browserplugin/cpixnpplugin/src/cnpdocumentfield.cpp
changeset 0 ccd0fd43f247
equal deleted inserted replaced
-1:000000000000 0:ccd0fd43f247
       
     1 /*
       
     2 * Copyright (c) 2010 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 #include "CNPDocumentField.h"
       
    18 #include "CNPSearchDocument.h"
       
    19 #include "CDocumentField.h"
       
    20 
       
    21 CNPDocumentField *CNPDocumentField::NewL( CNPSearchDocument& aOwner, const CDocumentField& aField )
       
    22 	{
       
    23 	CNPDocumentField* self = new (ELeave)CNPDocumentField( aOwner, aField );
       
    24     CleanupStack::PushL( self );
       
    25     self->ConstructL();
       
    26     CleanupStack::Pop(); // self;
       
    27     return self;
       
    28 	}
       
    29 
       
    30 CNPDocumentField::~CNPDocumentField()
       
    31 	{
       
    32 	iOwner.Release(); // After this moment, the owner may have become released
       
    33 	}
       
    34 	
       
    35 CNPDocumentField::CNPDocumentField( CNPSearchDocument& aOwner, const CDocumentField& aField  )
       
    36 : 	iOwner( aOwner ), 
       
    37 	iField( aField )
       
    38 	{
       
    39 	iOwner.Retain(); 
       
    40 	}
       
    41 
       
    42 void CNPDocumentField::ConstructL()
       
    43 	{
       
    44 	InitInterfaceL();
       
    45 	}
       
    46 
       
    47 const TDesC& CNPDocumentField::Name() const
       
    48 	{
       
    49 	return iField.Name(); 
       
    50 	}
       
    51 
       
    52 const TDesC& CNPDocumentField::Value() const
       
    53 	{
       
    54 	return iField.Value(); 
       
    55 	}