photosgallery/viewframework/dataprovider/inc/glxdetailsmulmodelproviderimpl.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:    Implementation class for details data provider
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef _GLXDETAILSMULMODELPROVIDERIMPL_H_
       
    22 #define _GLXDETAILSMULMODELPROVIDERIMPL_H_
       
    23 
       
    24 #include "glxmulmodelproviderbase.h"            // Dataprovider base
       
    25 #include "mglxbindingobserver.h"                // Notifies that binding has changed
       
    26 
       
    27 // Forward declarations
       
    28 class TGlxMulBindingSetFactory;                 // Create binding set
       
    29 class CGlxAttributeRequirements;                // This class will set the required attribute to the medialist
       
    30 class CAlfEnv;                                  // This is the UI Accelerator Toolkit environment object
       
    31 class CEikMenuPane;                             // Menu panes are opened by activating the menu title
       
    32 class CGlxBinding;                              // This class holds the bindings required to populate the visual item
       
    33 /** Error Id EMPY-7MKDHP **/
       
    34 class MGlxMetadataDialogObserver ;				// call back to  details dailog
       
    35 
       
    36 namespace Alf
       
    37     {
       
    38     class IMulWidget;                           // An interface for all Multimedia widgets
       
    39     }
       
    40 
       
    41 /**
       
    42  * CGlxDetailsMulModelProviderImpl 
       
    43  * This is the implementation class of details data provider
       
    44  */
       
    45 NONSHARABLE_CLASS( CGlxDetailsMulModelProviderImpl ) : public CGlxMulModelProviderBase,
       
    46 														public MGlxBindingObserver
       
    47     {
       
    48 public:
       
    49 	
       
    50 	/** Constructor
       
    51  	 * @param aEnv Env variable of ALF
       
    52    	 * @param aWidget Alf Widget type
       
    53  	 * @param aMediaList medialist from which attributes to be fetched
       
    54  	 * @param aDefaultTemplate Template that will be set to model
       
    55  	 */
       
    56 	static CGlxDetailsMulModelProviderImpl* NewL(
       
    57 	    CAlfEnv& aEnv, 
       
    58     	Alf::IMulWidget& aWidget,
       
    59     	MGlxMediaList& aMediaList,
       
    60     	Alf::mulwidget::TLogicalTemplate aDefaultTemplate,
       
    61     	TInt aDataWindowSize );
       
    62     	
       
    63     /**
       
    64 	 * ConstructL
       
    65 	 * @param aEnv Alf environment
       
    66 	 * @param aDefaultTemplate The default template of the widget
       
    67 	 */
       
    68     void ConstructL(
       
    69         CAlfEnv& aEnv,
       
    70         Alf::mulwidget::TLogicalTemplate aDefaultTemplate,
       
    71         TInt aDataWindowSize );
       
    72         
       
    73     /**
       
    74 	 * Destructor
       
    75 	 */
       
    76     ~CGlxDetailsMulModelProviderImpl();
       
    77     
       
    78 	/**
       
    79 	 * This Api uses the binding set factory to create the binding set 
       
    80 	 * @param aFactory factory instance
       
    81 	 */
       
    82    void AddEntryL( const TGlxMulBindingSetFactory& aFactory );
       
    83 
       
    84     /// the ModelProvider will be calling this , change the comments
       
    85 	/**
       
    86 	 * OfferCommandL
       
    87 	 * This will be called from details provider whenever there is an event (for example: navi key pressed ) 
       
    88 	 * @param aCommandId Id of the command that is about to be executed
       
    89 	 */
       
    90     TBool OfferCommandL( TInt aCommandId );
       
    91 	
       
    92 	/**
       
    93 	 * InitMenuL
       
    94 	 * This will determine what options to be present in menu pane
       
    95 	 * @param aMenu The menu pane to edit
       
    96 	 */
       
    97     void InitMenuL( CEikMenuPane& aMenu );
       
    98     
       
    99     /**
       
   100      * HideLocationMenuItem
       
   101      * @param aMenu The menu pane to edit
       
   102      */
       
   103     void HideLocationMenuItem( CEikMenuPane& aMenu ); 
       
   104    
       
   105     /**
       
   106      * EnableMskL
       
   107      * This will change the middle softkey as per the focussed item
       
   108      */
       
   109     void EnableMskL();
       
   110 
       
   111      /**
       
   112      * SetDetailsDailogObserver
       
   113      * This will set the details dailog observer
       
   114      */
       
   115      /** Error Id EMPY-7MKDHP **/
       
   116     void SetDetailsDailogObserver( MGlxMetadataDialogObserver& aObserver ) ;
       
   117 
       
   118 private:
       
   119 
       
   120 	/**
       
   121 	 * Constructor
       
   122 	 * @param aWidget Alf Widget type
       
   123 	 */
       
   124 	CGlxDetailsMulModelProviderImpl(
       
   125 	    Alf::IMulWidget& aWidget, 
       
   126 	    MGlxMediaList& aMediaList,
       
   127 		Alf::mulwidget::TLogicalTemplate aDefaultTemplate,
       
   128 		TInt aDataWindowSize);
       
   129     
       
   130 	// From MGlxBindingObserver
       
   131 	void HandleBindingChanged( const CGlxBinding& aBinding );
       
   132     
       
   133     
       
   134 	// From CGlxMulModelProviderBase
       
   135 	void HandleFocusChanged( TInt aNewFocus, TInt aPreviousFocus );
       
   136 	
       
   137 	// From MGlxMediaListObserver
       
   138     void HandleAttributesAvailableL( TInt aIndex, 
       
   139         const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList );
       
   140         
       
   141 	void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex,
       
   142                                   MGlxMediaList* aList);        
       
   143 	
       
   144 	void HandleError( TInt aError );
       
   145 	
       
   146 	void HandleCommandCompleteL( TAny* aSessionId, CMPXCommand* aCommandResult, 
       
   147 	    TInt aError, MGlxMediaList* aList );
       
   148     // From IMulModelProvider
       
   149    void  ProvideData (int aIndex, int aCount, Alf::MulDataPath aPath);
       
   150 
       
   151 	/**
       
   152 	 * HasCommandL
       
   153 	 * This will check weather command is present in menu pane
       
   154 	 * @param aMenuPane The menu pane 
       
   155  	 * @param aCommandId the command in menu pane 
       
   156 	 */
       
   157    TBool HasCommandL( CEikMenuPane& aMenuPane, const TInt aCommandId );
       
   158    
       
   159     /**
       
   160     * Helper function used be HandleError
       
   161     * @param aError the error code to handle.
       
   162     */
       
   163    void DoHandleErrorL( TInt /*aError*/ );
       
   164 private:
       
   165 
       
   166 	// medialist not owned
       
   167 	MGlxMediaList& iMediaList;
       
   168 	
       
   169 	//Array of Bindings owned
       
   170 	RPointerArray< CGlxBinding > iEntries;
       
   171     
       
   172     //Fetch context
       
   173     CGlxAttributeRequirements* iAttributeRequirements;
       
   174     };
       
   175     
       
   176 #endif // _GLXDETAILSMULMODELPROVIDERIMPL_H_