photosgallery/viewframework/dataprovider/inc/glxmedialistmulmodelproviderimpl.h
changeset 0 4e91876724a2
child 1 9ba538e329bd
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:    Implementation class for Media data provider.
       
    15 *                 providign the data to the clients
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef _GLXMEDIALISTMULMODELPROVIDERIMPL_H_
       
    23 #define _GLXMEDIALISTMULMODELPROVIDERIMPL_H_
       
    24 
       
    25 #include <e32base.h>                       // Container Base Class
       
    26 #include "glxmulmodelproviderbase.h"       // DataProvider Base
       
    27 #include "mglxbindingobserver.h"           // Notifies that binding has changed
       
    28  
       
    29 namespace Alf
       
    30 	{
       
    31 	class IMulWidget;                      // An interface for all Multimedia widgets
       
    32 	}
       
    33 
       
    34 // Forward declarations
       
    35 class TGlxMulBindingSetFactory;            // Create binding set 
       
    36 class CGlxAttributeRequirements;           // This class will set the required attribute to the medialist
       
    37 class CAlfEnv;                             // This is the UI Accelerator Toolkit environment object
       
    38 class MGlxMediaList;                       // Interface for reading lists of media items
       
    39 class CGlxBindingSet;                      // basically holds the bindings required to populate the visual item.
       
    40 class CGlxResolutionUtility;               // Singleton containing resolution utility methods
       
    41 class CGlxUiUtility;                       // lib glxalfutils.lib  ; Alf utils
       
    42 
       
    43 /**
       
    44 * CGlxMediaListMulModelProviderImpl
       
    45 * The actual implemntation for providign the data to the clients is done here
       
    46 */
       
    47 NONSHARABLE_CLASS( CGlxMediaListMulModelProviderImpl ) : public CGlxMulModelProviderBase,
       
    48 														public MGlxBindingObserver 
       
    49     {
       
    50     	
       
    51 public:
       
    52 	/**
       
    53 	* The medialist data provider uses this API to create the provider impl
       
    54 	* @param aEnv The Alf Environment
       
    55 	* @param aWidget The widget being used by client for which the model has to be set
       
    56 	* @param aMediaList The instance of medialist which provides data for the model
       
    57 	* @param aFactory The instance of the bindingset factory 
       
    58 	* @param aDefaultTemplate The template that is being used for the widget.
       
    59 	*/
       
    60     static CGlxMediaListMulModelProviderImpl* NewL( CAlfEnv& aEnv, 
       
    61 													Alf::IMulWidget& aWidget, 
       
    62 													MGlxMediaList& aMediaList,
       
    63 													const TGlxMulBindingSetFactory& aFactory, 
       
    64 													Alf::mulwidget::TLogicalTemplate aDefaultTemplate,
       
    65 													TInt aDataWindowSize );
       
    66             
       
    67     /**
       
    68 	* Destructor
       
    69 	*/                       
       
    70     ~CGlxMediaListMulModelProviderImpl();
       
    71     
       
    72 private:
       
    73 	/**
       
    74 	* Constructor
       
    75 	* @param aWidget The widget being used by client for which the model has to be set
       
    76 	* @param aMediaList The instance of medialist which provides data for the model
       
    77 	*/
       
    78     CGlxMediaListMulModelProviderImpl( Alf::IMulWidget& aWidget, MGlxMediaList& aMediaList );
       
    79         
       
    80 	/**
       
    81 	* ConstructL
       
    82 	* @param aEnv The Alf Environment
       
    83 	* @param aFactory The instance of the bindingset factory 
       
    84 	* @param aDefaultTemplate The template that is being used for the widget.
       
    85 	*/   
       
    86     void ConstructL( CAlfEnv& aEnv,
       
    87                      const TGlxMulBindingSetFactory& aFactory,
       
    88                      Alf::mulwidget::TLogicalTemplate aDefaultTemplate,
       
    89                      TInt aDataWindowSize );
       
    90     
       
    91 	/**
       
    92      * Helper function used be HandleError
       
    93      * @param aError the error code to handle.
       
    94      */
       
    95     void DoHandleErrorL( TInt aError );
       
    96 
       
    97 	// From MGlxBindingObserver
       
    98     void HandleBindingChanged( const CGlxBinding& aBinding );
       
    99     
       
   100     void HandleOrientationChanged();  
       
   101 	// From CGlxMulModelProviderBase
       
   102 	void HandleFocusChanged(TInt aNewFocusIndex, TInt aPreviousFocusIndex);    
       
   103 	// From MGlxMediaListObserver
       
   104     void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList );
       
   105     void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList );
       
   106     void HandleAttributesAvailableL( TInt aItemIndex, 
       
   107         const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList );   
       
   108 	void HandleFocusChangedL( NGlxListDefs::TFocusChangeType aType, 
       
   109         TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList );
       
   110     void HandleError( TInt aError );
       
   111     //Bug fix for PKAA-7NRBYZ
       
   112     void HandleItemModifiedL( const RArray<TInt>& aItemIndexes, MGlxMediaList* aList );
       
   113      
       
   114     // From IMulModelProvider
       
   115     void  ProvideData (int aIndex, int aCount, Alf::MulDataPath aPath);
       
   116 private:
       
   117 
       
   118     MGlxMediaList& iMediaList;
       
   119     CGlxBindingSet* iBindingSet; // own
       
   120     TBool iIsReleventAttribute;
       
   121     CGlxAttributeRequirements* iAttributeRequirements; // own
       
   122     CGlxResolutionUtility* iResolutionUtility;
       
   123     Alf::IMulWidget& iWidget;
       
   124     CGlxUiUtility* iUiUtility;
       
   125 
       
   126     };
       
   127     
       
   128 #endif // _GLXMEDIALISTMULMODELPROVIDERIMPL_H_
       
   129 
       
   130