menucontentsrv/srvsrc/mcsgetlistflatcreator.cpp
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2008 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 
       
    18 #include <e32cmn.h> 
       
    19 #include <liwcommon.h>
       
    20 #include <liwgenericparam.h>
       
    21 #include <s32mem.h>
       
    22 #include "mcsgetlistflatcreator.h"
       
    23 
       
    24 // ---------------------------------------------------------
       
    25 // CMcsGetlistFlatCreator::NewL
       
    26 // ---------------------------------------------------------
       
    27 //
       
    28 CMcsGetlistFlatCreator* CMcsGetlistFlatCreator::NewL( CMenuSrvEng& aEng )
       
    29 	{
       
    30 	CMcsGetlistFlatCreator* self;
       
    31 	self = new ( ELeave ) CMcsGetlistFlatCreator( aEng );
       
    32 	CleanupStack::PushL( self );
       
    33 	self->ConstructL();
       
    34 	CleanupStack::Pop( self );
       
    35 	return self;
       
    36 	}
       
    37 
       
    38 // ---------------------------------------------------------
       
    39 // CMcsGetlistFlatCreator::~CMcsGetlistFlatCreator
       
    40 // ---------------------------------------------------------
       
    41 //
       
    42 CMcsGetlistFlatCreator::~CMcsGetlistFlatCreator()
       
    43     {
       
    44     }
       
    45 
       
    46 // ---------------------------------------------------------
       
    47 // CMcsGetlistFlatCreator::CMcsGetlistFlatCreator
       
    48 // ---------------------------------------------------------
       
    49 //
       
    50 CMcsGetlistFlatCreator::CMcsGetlistFlatCreator( CMenuSrvEng& aEng ):
       
    51 	CMcsGetListCreatorInterface(aEng)
       
    52     {
       
    53     }
       
    54 
       
    55 // ---------------------------------------------------------
       
    56 // CMcsGetlistFlatCreator::ConstructL
       
    57 // ---------------------------------------------------------
       
    58 //
       
    59 void CMcsGetlistFlatCreator::ConstructL()
       
    60     {
       
    61     CMcsGetListCreatorInterface::ConstructL();
       
    62     }
       
    63 
       
    64 // ---------------------------------------------------------
       
    65 // CMcsGetlistFlatCreator::CreateLC
       
    66 // ---------------------------------------------------------
       
    67 //
       
    68 CLiwDefaultList* CMcsGetlistFlatCreator::CreateLC(
       
    69 	    RArray<TMenuItem>& aIdsArray,
       
    70 	    CDesC16Array* aRequiredAttributes,
       
    71 	    CDesC16Array* aIgnoredAttributes)
       
    72 	{
       
    73 	CLiwDefaultList* list = CLiwDefaultList::NewLC();
       
    74 
       
    75 	TInt arrCount = aIdsArray.Count();
       
    76 	for( TInt index = 0; index < arrCount; ++index )
       
    77 		{
       
    78 		CLiwDefaultMap* map = CLiwDefaultMap::NewLC();
       
    79 		// Build Map
       
    80 		BuildMapL( aIdsArray[index], aRequiredAttributes,
       
    81 				aIgnoredAttributes, map );
       
    82 
       
    83 
       
    84 		TLiwVariant lvMap( map );
       
    85 		lvMap.PushL();
       
    86 		list->AppendL( lvMap );
       
    87 		CleanupStack::PopAndDestroy( &lvMap );
       
    88 		CleanupStack::PopAndDestroy( map );
       
    89 
       
    90 		}
       
    91 	return list;
       
    92 	}
       
    93 
       
    94 
       
    95 
       
    96 
       
    97 
       
    98 //  End of File