photosgallery/viewframework/medialists/inc/mglxfetchcontext.h
changeset 0 4e91876724a2
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2008-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 and attribute fetch context
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef M_GLXFETCHCONTEXT_H
       
    22 #define M_GLXFETCHCONTEXT_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "glxmediaid.h"
       
    26 
       
    27 #include <mpxattributespecs.h>
       
    28 
       
    29 class MGlxMediaList;
       
    30 class TMPXAttribute;
       
    31 
       
    32 /**
       
    33  *  MGlxFetchContext
       
    34  *
       
    35  *  Interface that allows clients to define which media items should be 
       
    36  *  retrieved and which properties for them
       
    37  *
       
    38  *  @lib none
       
    39  */
       
    40 class MGlxFetchContext 
       
    41     {
       
    42 public:
       
    43     /**
       
    44      * Specifies which attributes should be fetched for a particular item
       
    45      * in the list.
       
    46      * @param aList the list for which the request relates to
       
    47      * @return in aItemIndices the list indices for which the attributes should be requested for
       
    48      *         if no items requiring attributes, returns an empty array.
       
    49      *         Caller should make sure the array is empty before calling.
       
    50      * @return in aAttributes the attributes that should be retrieved
       
    51      * @return in aDetailedSpecs a new detailed specification object 
       
    52      *		   regarding the attributes or NULL. Caller must set the 
       
    53      *		   parameter to NULL.
       
    54      * @return TInt number of items with outstanding requests.
       
    55      *     KErrGeneral if there are no more requests but there are outstanding errors.
       
    56      */
       
    57     virtual TInt AttributeRequestL(const MGlxMediaList* aList, RArray<TInt>& aItemIndices, 
       
    58     	RArray<TMPXAttribute>& aAttributes, CMPXAttributeSpecs*& aDetailedSpecs) const = 0;
       
    59     
       
    60     /**
       
    61      * Lists all attributes that a required for a particular item in the list.
       
    62      * Ignores whether the attributes have been loaded or not. This function 
       
    63      * is used for garbage collection, in order to know if an attribute is 
       
    64      * still in use. 
       
    65      * @param aList the list for which the call relates to
       
    66      * @param aListIndex the index in the list of the particular item
       
    67      * @return in aAttributes all attributes that this context requires.
       
    68      *		   if no attributes are required, returns the array as empty.
       
    69      *	       Caller must make sure the array is empty before calling.
       
    70      */
       
    71     virtual void AllAttributesL(const MGlxMediaList* aList, TInt aListIndex, 
       
    72     	RArray<TMPXAttribute>& aAttributes) const = 0;
       
    73 
       
    74     /**
       
    75      * Provides the number of items with currently outstanding requests
       
    76      *
       
    77      * @param aList the list for which the call relates to
       
    78      * @return TInt number of items with outstanding requests.
       
    79      *     KErrGeneral if there are no more requests but there are outstanding errors.
       
    80      */
       
    81     virtual TInt RequestCountL(const MGlxMediaList* aList) const = 0;
       
    82     };
       
    83 
       
    84 #endif // M_GLXFETCHCONTEXT_H