mpx/commonframework/common/src/mpxcollectiontype.cpp
changeset 0 a2952bb97e68
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Class representing the supported collection types
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <mpxuser.h>
       
    21 #include "mpxcollectiontype.h"
       
    22 
       
    23 // ======== MEMBER FUNCTIONS ========
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // Constructor
       
    27 // ---------------------------------------------------------------------------
       
    28 //
       
    29 EXPORT_C CMPXCollectionType::CMPXCollectionType(
       
    30     const TUid& aUid,
       
    31     CDesCArray* aMimeTypes, 
       
    32     CDesCArray* aExtensions)
       
    33 :   iUid(aUid), iMimeTypes(aMimeTypes),iExtensions(aExtensions)
       
    34     {
       
    35     }
       
    36     
       
    37 // ---------------------------------------------------------------------------
       
    38 // Constructor
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 EXPORT_C CMPXCollectionType::CMPXCollectionType()
       
    42     {
       
    43     }
       
    44     
       
    45 // ---------------------------------------------------------------------------
       
    46 // destructor
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 CMPXCollectionType::~CMPXCollectionType()
       
    50     {
       
    51     delete iMimeTypes;
       
    52     delete iExtensions;
       
    53     }
       
    54 
       
    55 // ---------------------------------------------------------------------------
       
    56 // Externalize the object
       
    57 // ---------------------------------------------------------------------------
       
    58 //
       
    59 EXPORT_C void CMPXCollectionType::ExternalizeL(RWriteStream& aStream) const 
       
    60     {
       
    61     aStream.WriteInt32L( iUid.iUid );
       
    62     MPXUser::ExternalizeL(iMimeTypes, aStream);
       
    63     MPXUser::ExternalizeL(iExtensions, aStream);
       
    64     }
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // Internalize the object
       
    68 // ---------------------------------------------------------------------------
       
    69 //    
       
    70 EXPORT_C void CMPXCollectionType::InternalizeL(RReadStream& aStream)
       
    71     {
       
    72     // UID
       
    73     iUid.iUid = aStream.ReadInt32L();
       
    74     MPXUser::InternalizeL(iMimeTypes, aStream);
       
    75     MPXUser::InternalizeL(iExtensions, aStream);
       
    76     }