serviceproviders/sapi_mediamanagement/inc/mgitemslist.h
changeset 5 989d2f495d90
child 23 50974a8b132e
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 #ifndef __CMGITEMSLIST_H
       
    20 #define __CMGITEMSLIST_H
       
    21 
       
    22 #include <liwgenericparam.h> 
       
    23 #include "mgservice.hrh"
       
    24 
       
    25 class MCLFItemListModel;
       
    26 class MgMediaItemFactory;
       
    27 class CMgMediaItem;
       
    28 /**
       
    29  *  This class implements the abstract methods of CLiwIterable   
       
    30  *  class so that the user may iterate over the result 
       
    31  *  
       
    32  *  @since Series60 v3.2
       
    33  */
       
    34 NONSHARABLE_CLASS( CMgItemsList ) : public CLiwIterable
       
    35     {
       
    36 
       
    37 public:
       
    38        
       
    39     /**
       
    40      * Two-phased constructor.
       
    41      * @param aItemListModel holds a reference to the item list model
       
    42      * @param aCmdId specifies whether the SAPI is GetFiles or GetFilesInfo
       
    43      * @return A pointer of type CMgItemsList
       
    44      */
       
    45      static CMgItemsList* NewL( MCLFItemListModel* aItemListModel, TMgCmdId aCmdId );
       
    46     
       
    47     /**
       
    48     * Destructor.
       
    49     */
       
    50     ~CMgItemsList();
       
    51 
       
    52 
       
    53     /**
       
    54      * Resets the iterator to point to the beginning of list
       
    55      * @param void
       
    56      * @return void
       
    57      */
       
    58     void Reset();	
       
    59     
       
    60     /**
       
    61      * Constructs the next media item in the form of a map
       
    62      * @param TLiwVariant an output parameter that contains the result
       
    63      * @return TBool On success this returns ETrue else returns EFalse
       
    64      */	
       
    65     TBool NextL( TLiwVariant& aItem );
       
    66 
       
    67 
       
    68 private:
       
    69     
       
    70      /**
       
    71      * Parameterised constructor
       
    72      * @since  Series60 v3.2
       
    73      * @param  aItemListModel holds a reference to the item list model
       
    74      * @param  aCmdId specifies whether the SAPI is GetFiles or GetFilesInfo
       
    75      */
       
    76     
       
    77     CMgItemsList( MCLFItemListModel* aItemListModel, TMgCmdId aCmdId );
       
    78     
       
    79 private: // data
       
    80 
       
    81     /**
       
    82     * A pointer to MCLFItemListModel class
       
    83     */
       
    84     MCLFItemListModel* iItemListModel;
       
    85     /**
       
    86     * Indicates whether GetFiles or GetFilesInfo SAPI is being processed
       
    87     */
       
    88     TMgCmdId iCmdId;
       
    89     /**
       
    90     * Gives the total number of items in list model 
       
    91     */
       
    92     TInt iCount;
       
    93     /**
       
    94     * Gives the current item being processed
       
    95     */
       
    96     TInt iCurrent;
       
    97     /**
       
    98     * Store the file type of current list 
       
    99     */
       
   100     CMgMediaItem* iMediaItem;
       
   101     };
       
   102 
       
   103 #endif // __CMGITEMSLIST_H