photosgallery/viewframework/views/viewbase/inc/glxtitlefetcher.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:    Title fetcher 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef GLXTITLEFETCHER_H
       
    22 #define GLXTITLEFETCHER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <coedef.h>
       
    26 #include <w32std.h>
       
    27 #include <mglxmedialistobserver.h>
       
    28 #include "mglxtitlefetcherobserver.h"
       
    29 
       
    30 
       
    31 class CMPXCollectionPath;
       
    32 class MGlxMediaList;                   
       
    33 class CGlxDefaultAttributeContext;
       
    34 
       
    35 
       
    36 class CGlxTitleFetcher : public CBase, public MGlxMediaListObserver
       
    37     {
       
    38 public:
       
    39     /**
       
    40      * Constructs an instance of CGlxTitleFetcher and initiates obtaining
       
    41      * a title 
       
    42      *
       
    43      * @param aObserver Observer of this list 
       
    44      * @param aPath The current path by which to obtain the title 
       
    45      */
       
    46     static CGlxTitleFetcher*  NewL(MGlxTitleFetcherObserver& aObserver,
       
    47                                     CMPXCollectionPath* aPath);
       
    48 
       
    49 	IMPORT_C virtual ~CGlxTitleFetcher();
       
    50                         
       
    51     // From MGlxMediaListObserver                    
       
    52 	virtual void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex,
       
    53 		MGlxMediaList* aList);
       
    54 
       
    55     /**
       
    56      * Notification that media object is now available for an item 
       
    57      *
       
    58      * @param Index of the item 
       
    59      */
       
    60 	virtual void HandleMediaL(TInt /*aListIndex*/, MGlxMediaList* /*aList*/) {};
       
    61 
       
    62     /**
       
    63      * Notification that media item was removed from the list
       
    64      *
       
    65      * @param aStartIndex First item that was removed 
       
    66      * @param aEndIndex Last item that was removed
       
    67      */
       
    68 	virtual void HandleItemRemovedL(TInt /*aStartIndex*/, TInt /*aEndIndex*/,
       
    69 		MGlxMediaList* /*aList*/) {};
       
    70 
       
    71     /**
       
    72      * Notification that media item was changed
       
    73      *
       
    74      * @param aItemIndexes Indexes of items that were changed
       
    75      */
       
    76 	virtual void HandleItemModifiedL(const RArray<TInt>& /*aItemIndexes*/, 
       
    77 		MGlxMediaList* /*aList*/) {};
       
    78 
       
    79 
       
    80     /**
       
    81      * Notification that an attribute is available
       
    82      *
       
    83      * @param aItemIndex Index of the for which the thumbnail is available
       
    84      * @param aAttributes Array of attributes that have become available
       
    85      * @param aList List that this callback relates to 
       
    86      */
       
    87 	virtual void HandleAttributesAvailableL(TInt aItemIndex, 	
       
    88 		const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList);	
       
    89 			
       
    90     /**
       
    91      * Notification that focus has moved
       
    92      *
       
    93      * @param aType the direction of the focus change
       
    94      * @param aNewIndex the new index after the focus change
       
    95      * @param aOldIndex the old index before the focus change
       
    96      * @param aList List that this callback relates to
       
    97      */
       
    98 	virtual void HandleFocusChangedL(NGlxListDefs::TFocusChangeType /*aType*/, 
       
    99 	    TInt /*aNewIndex*/, TInt /*aOldIndex*/, MGlxMediaList* /*aList*/) {};
       
   100 
       
   101 	/**
       
   102 	 * Notification that an item has been selected/deselected
       
   103 	 *
       
   104 	 * @param aIndex Index of the item that has been selected/deselected
       
   105 	 * @param aSelected Boolean to indicate selection/deselection
       
   106 	 * @param aList List that the selection relates to
       
   107 	 */
       
   108 	virtual void HandleItemSelectedL(TInt /*aIndex*/, TBool /*aSelected*/, 
       
   109 	              MGlxMediaList* /*aList*/) {};
       
   110 
       
   111 	/**
       
   112 	 * Notification from the collection.  E.g. Items added/modified/deleted and progress notifications
       
   113 	 *
       
   114 	 * @param aMessage Message notification from the collection
       
   115 	 * @param aList List that the notification relates to
       
   116 	 */
       
   117 	virtual void HandleMessageL(const CMPXMessage& /*aMessage*/, 
       
   118 	                            MGlxMediaList* /*aList*/) {};
       
   119 	
       
   120 private:
       
   121                         
       
   122     CGlxTitleFetcher(MGlxTitleFetcherObserver& aObserver,
       
   123                      CMPXCollectionPath* aPath);
       
   124     
       
   125     void ConstructL();
       
   126     
       
   127 private:
       
   128 
       
   129     MGlxTitleFetcherObserver& iObserver;
       
   130     CMPXCollectionPath* iPath;
       
   131     TMPXItemId iPathId;
       
   132     MGlxMediaList*  iBackMediaList; 
       
   133     CGlxDefaultAttributeContext* iContext;                  
       
   134     };
       
   135 
       
   136 
       
   137 #endif // GLXTITLEFETCHER_H