mulwidgets/mulcoverflowwidget/inc/mulcoverflowitemelement.h
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:23:18 +0100
branchRCL_3
changeset 26 0e9bb658ef58
parent 0 e83bab7cf002
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Item element header for Cover Flow.
*
*/

// This file defines the API for mulcoverflowwidget.dll
#ifndef MULCOVERFLOWITEMELEMENT_H_
#define MULCOVERFLOWITEMELEMENT_H_


// Includes
#include <alf/alfelement.h>
#include <alf/ialfwidgeteventhandler.h>

#include <vector>

#include "mulvisualtemplate.h"
// Forward declarations.
class MulTemplateInterface;

namespace Alf
	{
		
class MulCoverFlowItemElement: public AlfElement, public IAlfWidgetEventHandler
	{
				
public: // Constructor and Destructor
	
   /**
	* Constructor
	* @param aControl WidgetControl
	* @param aName Name of the element.	
	*/
	// third parameter shd be moved.
	MulCoverFlowItemElement( CAlfWidgetControl& aControl, const char* aName , MulTemplateInterface& aControlInterface );
	
   /**
    * Destructor
	*/
	~MulCoverFlowItemElement();
	
public: // From IAlfWidgetEventHandler

    bool accept( CAlfWidgetControl& aControl, const TAlfEvent& aEvent ) const;
    
    void setActiveStates( unsigned int aStates );
    
    AlfEventStatus offerEvent( CAlfWidgetControl& aControl, const TAlfEvent& aEvent );
    
    IAlfInterfaceBase* makeInterface( const IfId& aType );

    void setEventHandlerData( const AlfWidgetEventHandlerInitData& aData );
	  
	AlfWidgetEventHandlerInitData* eventHandlerData();
	
	  AlfEventHandlerType eventHandlerType() ;

    AlfEventHandlerExecutionPhase eventExecutionPhase() ;

    
public: // new methods 
	
	CAlfVisual* CreateIconStructure(CAlfLayout* aParentLayout, const UString& aTemplateId);  
    
    void DoSetImage(IAlfVariantType* data, CAlfImageVisual* aImgVisual);
	      	
			

private:

   /**
 	* gets the handle to the visual template.
 	*/
  	MulVisualTemplate* VisualTemplate()
		{
		return static_cast<MulVisualTemplate*>(getVisualTemplate());
		}
private: // Member data
	
    std::vector<CAlfVisual*> mRecycleVisualArray;        //stores sizes and positions of all items 
	bool mVisualRecycled;
	int mNumVisualsRecycled;
	CAlfFlowLayout* mIconFlow;	
	};
	
	} // namespace ends here
	
#endif /*MULCOVERFLOWITEMELEMENT_H_*/