DirectPrint/DirectPrintApp/src/directprintproperty.cpp
changeset 19 2275db202402
parent 11 613a5ff70823
equal deleted inserted replaced
2:acc370d7f2f6 19:2275db202402
       
     1 /*
       
     2 * Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "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 * Kanrikogaku Kenkyusho, Ltd. - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include <s32strm.h>
       
    20 
       
    21 #include "directprintproperty.h"
       
    22 
       
    23 EXPORT_C CPrinterProperty::CPrinterProperty()
       
    24 	{
       
    25 	}
       
    26 
       
    27 EXPORT_C CPrinterProperty::~CPrinterProperty()
       
    28 	{
       
    29 	iPropertyItems.Close();
       
    30 	}
       
    31 
       
    32 EXPORT_C void CPrinterProperty::InternalizeL(RReadStream& aStream)
       
    33 	{
       
    34 	iPrinterId = aStream.ReadInt32L();
       
    35 	iApplicationId = aStream.ReadInt32L();
       
    36 	iPropertyItems.Reset();
       
    37 	TInt count = aStream.ReadInt32L();
       
    38 	for (TInt i=0; i<count; i++)
       
    39 		{
       
    40 		TDirectPrintPropertyData item;
       
    41 		item.InternalizeL(aStream);
       
    42 		iPropertyItems.Append(item);
       
    43 		}
       
    44 	}
       
    45 
       
    46 EXPORT_C void CPrinterProperty::ExternalizeL(RWriteStream& aStream) const
       
    47 	{
       
    48 	aStream.WriteInt32L(iPrinterId);
       
    49 	aStream.WriteInt32L(iApplicationId);
       
    50 	TInt count = iPropertyItems.Count();
       
    51 	aStream.WriteInt32L(count);
       
    52 	for (TInt i=0; i<count; i++)
       
    53 		{
       
    54 		iPropertyItems[i].ExternalizeL(aStream);
       
    55 		}
       
    56 	}
       
    57 
       
    58 EXPORT_C CPrinterProperty& CPrinterProperty::operator=(const CPrinterProperty& aProperty)
       
    59 	{
       
    60 	iPrinterId = aProperty.iPrinterId;
       
    61 	iApplicationId = aProperty.iApplicationId;
       
    62 	iPropertyItems.Reset();
       
    63 	TInt count = aProperty.iPropertyItems.Count();
       
    64 	for (TInt i=0; i<count; i++)
       
    65 		{
       
    66 		iPropertyItems.Append(aProperty.iPropertyItems[i]);
       
    67 		}
       
    68 	return *this;
       
    69 	}
       
    70