photosgallery/viewframework/dataprovider/inc/glxcontainerlistbinding.h
changeset 0 4e91876724a2
child 56 b023a8d2866a
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:    CGlxContainerListBinding This class holds the list of 
       
    15 *                 tags/albums associated with a media item
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef _GLXCONTAINERLISTBINDING_H_
       
    23 #define _GLXCONTAINERLISTBINDING_H_
       
    24 
       
    25 #include <e32base.h>                  // Container Base Class
       
    26 #include <mpxattribute.h>             // lib mpxcommon.lib
       
    27 #include <mglxmedialistobserver.h>    // Observes for changes in media list
       
    28 #include "glxattributecontext.h"      // Fetch context to retrieve thumbnails
       
    29 #include "glxbinding.h"               // holds the bindings required to populate the visual item
       
    30 #include "glxustringconverter.h"      // class that converts the symbian types to UString type
       
    31 
       
    32 class CMPXCollectionPath;             //  mpxcommon.lib
       
    33 class CGlxAttributeContext;           // Fetch context to retrieve thumbnails
       
    34 class MGlxMediaList;                  // lib glxmedialists.lib
       
    35 class TGlxMedia;                      // media item in the item pool
       
    36 
       
    37 namespace Alf
       
    38     {
       
    39     class IAlfVariantType;            // lib alfwidgetmodel.lib
       
    40     class MulVisualItem;              // Client need to use this class to add data in data model
       
    41     }
       
    42 
       
    43 namespace osncore
       
    44     {
       
    45     class UString;                    // encapsulates utf-8 encoded string
       
    46     }
       
    47        
       
    48 /**
       
    49  * CGlxContainerListBinding This class holds the list of tags/albums associated with a media item
       
    50  */
       
    51 NONSHARABLE_CLASS( CGlxContainerListBinding ) : public CGlxSingleTagBinding, 
       
    52         public MGlxMediaListObserver
       
    53     {
       
    54 public:
       
    55 
       
    56 	/**
       
    57 	 * NewL Two phase construction
       
    58 	 */
       
    59 	static CGlxContainerListBinding* NewL( const Alf::mulvisualitem::TVisualAttribute& aMulTag /*const char* const aMulTag*/, 
       
    60 		const CMPXCollectionPath& aPath );
       
    61 	
       
    62 	/**
       
    63 	 * NewLC Two phase construction
       
    64 	 */
       
    65 	static CGlxContainerListBinding* NewLC( const Alf::mulvisualitem::TVisualAttribute& aMulTag /*const char* const aMulTag*/, 
       
    66 		const CMPXCollectionPath& aPath );
       
    67 		
       
    68 	/**
       
    69 	* Destructor
       
    70 	*/	
       
    71 	~CGlxContainerListBinding();
       
    72 
       
    73 private:
       
    74 
       
    75 	/**
       
    76 	 * ConstructL Two phase construction
       
    77 	 */
       
    78 	void ConstructL( const Alf::mulvisualitem::TVisualAttribute& aMulTag /*const char* const aMulTag*/, const CMPXCollectionPath& aPath );
       
    79 
       
    80 	// From MGlxMediaListObserver
       
    81 	void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList );
       
    82 	void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList );
       
    83 	void HandleAttributesAvailableL( TInt aItemIndex, 
       
    84 	    const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList );    
       
    85 	void HandleFocusChangedL( NGlxListDefs::TFocusChangeType aType, 
       
    86         TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList );
       
    87 	void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList ) ;
       
    88 	void HandleMessageL( const CMPXMessage& aMessage, MGlxMediaList* aList ) ;
       
    89 	void HandleMediaL( TInt aListIndex, MGlxMediaList* aList ) ;
       
    90 	void HandleItemModifiedL( const RArray<TInt>& aItemIndexes, MGlxMediaList* aList );
       
    91 	    
       
    92 	// From CGlxBinding
       
    93 	void PopulateT( Alf::MulVisualItem& aItem, const TGlxMedia& aMedia,
       
    94 													TBool aIsFocused ) const;
       
    95 
       
    96 	/**
       
    97      * Create media list
       
    98      * @ param aMediaId media id for creating filtered media list
       
    99      */ 
       
   100 	void CreateMediaListL(TGlxMediaId aMedia) const;
       
   101 	
       
   102     /**
       
   103      * Close media list
       
   104      */ 
       
   105 	void CloseMediaList();
       
   106 	
       
   107 	/**
       
   108 	 * HandleFocusChanged
       
   109 	 * @param aIsGained holds the focus change status
       
   110 	 * @param aPath source path to the collection
       
   111 	 */
       
   112     TResponse HandleFocusChanged( TBool aIsGained );
       
   113     
       
   114 private:
       
   115 
       
   116 	//Medialist that holds the list of tags/albums
       
   117 	mutable MGlxMediaList* iContainerList;
       
   118 	
       
   119 	//Fetch context to get the attributes
       
   120 	CGlxDefaultAttributeContext* iFetchContext;
       
   121 	
       
   122 	// collection path from which to fetch the attribute
       
   123 	CMPXCollectionPath* iContainerPath;
       
   124 	
       
   125 	TGlxSequentialIterator iIterator;
       
   126 	
       
   127     };
       
   128     
       
   129 #endif //_GLXCONTAINERLISTBINDING_H_