mmappcomponents/audiofetcher/inc/audiofetcherlisthandler.h
changeset 0 a2952bb97e68
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     1 /*
       
     2 * Copyright (c) 2009 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: Media Fetch plug-in list handler
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDES
       
    19 #include <e32base.h>
       
    20 #include <bamdesca.h>
       
    21 
       
    22 /**
       
    23 * MAudioFetcherListHandlerObserver
       
    24 * 
       
    25 * CAudioFetcherListHandler uses MAudioFetcherListHandlerObserver to get listbox item texts.
       
    26 */
       
    27 class MAudioFetcherListHandlerObserver
       
    28     {
       
    29     public:
       
    30         virtual TPtrC ConstructListboxItem( TInt aListIndex ) = 0;
       
    31         virtual TInt ListboxItemCount() = 0;
       
    32     };
       
    33 
       
    34 /**
       
    35 * CMFListHandler
       
    36 * 
       
    37 * This class is used as listbox model's item array. Listbox uses it to draw 
       
    38 * list items. CAudioFetcherListHandler gets list item texts from CAudioFetcherFileHandler
       
    39 * (metadata query result). This way there is no need to copy all list items
       
    40 * into listbox model.  
       
    41 */
       
    42 class CAudioFetcherListHandler : public CBase, public MDesCArray
       
    43     {
       
    44     public:
       
    45         static CAudioFetcherListHandler* NewL();
       
    46         virtual ~CAudioFetcherListHandler();
       
    47         
       
    48     private:
       
    49         
       
    50         void ConstructL();
       
    51         CAudioFetcherListHandler();
       
    52 
       
    53     public:  // from MDesCArray
       
    54         
       
    55         TInt MdcaCount() const;
       
    56         TPtrC16 MdcaPoint(TInt aIndex) const;
       
    57 
       
    58     public:
       
    59         
       
    60         void SetObserver( MAudioFetcherListHandlerObserver* aObserver );
       
    61         static void Panic( TInt aReason );
       
    62         
       
    63     private:
       
    64         
       
    65         MAudioFetcherListHandlerObserver* iObserver;  // does not own
       
    66     };