serviceproviders/sapi_applicationmanager/src/appitemslist.cpp
changeset 5 989d2f495d90
equal deleted inserted replaced
1:a36b1e19a461 5:989d2f495d90
       
     1 /*
       
     2 * Copyright (c) 2007-2007 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 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 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implements CLiwIterable type
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "appitemslist.h"
       
    20 #include "appinfomap.h"
       
    21 #include "appmanagerservice.h"
       
    22 
       
    23 
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // CAppItemsList::CAppItemsList
       
    27 // Parameterised constructor
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 
       
    31 CAppItemsList::CAppItemsList( MIterator* aIter)
       
    32               : iIter(aIter)
       
    33     {
       
    34 
       
    35     }
       
    36 // ---------------------------------------------------------------------------
       
    37 // CAppItemsList::NewL
       
    38 // Two-phased constructor
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 
       
    42 CAppItemsList* CAppItemsList::NewL( MIterator* aIter )
       
    43     {
       
    44     return new( ELeave ) CAppItemsList( aIter );
       
    45     }
       
    46 
       
    47 
       
    48 // ---------------------------------------------------------------------------
       
    49 // CAppItemsList::~CAppItemsList
       
    50 // Class destructor
       
    51 // ---------------------------------------------------------------------------
       
    52 //
       
    53 CAppItemsList::~CAppItemsList()
       
    54     {
       
    55 	delete iIter;
       
    56 	}
       
    57 // ---------------------------------------------------------------------------
       
    58 // CAppItemsList::Reset
       
    59 // Resets the iterator to point to the beginning of list
       
    60 // ---------------------------------------------------------------------------
       
    61 //
       
    62 
       
    63 void CAppItemsList::Reset()
       
    64     {
       
    65     iIter->Reset();
       
    66     }
       
    67 
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // CAppItemsList::NextL
       
    71 // Constructs the next media item in the form of a map
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 TBool CAppItemsList::NextL( TLiwVariant& aItem )
       
    75     {
       
    76 
       
    77      MInfoMap* coremap = NULL;
       
    78      if ( iIter->NextL( coremap ) )
       
    79         {
       
    80         CAppInfoMap *outputMap = CAppInfoMap::NewL( coremap );
       
    81         CleanupClosePushL( *outputMap );
       
    82         aItem.SetL( TLiwVariant( outputMap ) );
       
    83         outputMap->DecRef();
       
    84         CleanupStack::Pop( outputMap );
       
    85         return ETrue;
       
    86         }
       
    87      else
       
    88         {
       
    89             return EFalse;
       
    90         }
       
    91   
       
    92     }
       
    93 
       
    94 
       
    95 
       
    96 
       
    97