mulwidgets/mulcoverflowwidget/inc/mulcoverflowitemelement.h
changeset 17 3eca7e70b1b8
parent 3 4526337fb576
equal deleted inserted replaced
3:4526337fb576 17:3eca7e70b1b8
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Item element header for Cover Flow.
       
    15 *
       
    16 */
       
    17 
       
    18 // This file defines the API for mulcoverflowwidget.dll
       
    19 #ifndef MULCOVERFLOWITEMELEMENT_H_
       
    20 #define MULCOVERFLOWITEMELEMENT_H_
       
    21 
       
    22 
       
    23 // Includes
       
    24 #include <alf/alfelement.h>
       
    25 #include <alf/ialfwidgeteventhandler.h>
       
    26 
       
    27 #include <vector>
       
    28 
       
    29 #include "mulvisualtemplate.h"
       
    30 // Forward declarations.
       
    31 class MulTemplateInterface;
       
    32 
       
    33 namespace Alf
       
    34 	{
       
    35 		
       
    36 class MulCoverFlowItemElement: public AlfElement, public IAlfWidgetEventHandler
       
    37 	{
       
    38 				
       
    39 public: // Constructor and Destructor
       
    40 	
       
    41    /**
       
    42 	* Constructor
       
    43 	* @param aControl WidgetControl
       
    44 	* @param aName Name of the element.	
       
    45 	*/
       
    46 	// third parameter shd be moved.
       
    47 	MulCoverFlowItemElement( CAlfWidgetControl& aControl, const char* aName , MulTemplateInterface& aControlInterface );
       
    48 	
       
    49    /**
       
    50     * Destructor
       
    51 	*/
       
    52 	~MulCoverFlowItemElement();
       
    53 	
       
    54 public: // From IAlfWidgetEventHandler
       
    55 
       
    56     bool accept( CAlfWidgetControl& aControl, const TAlfEvent& aEvent ) const;
       
    57     
       
    58     void setActiveStates( unsigned int aStates );
       
    59     
       
    60     AlfEventStatus offerEvent( CAlfWidgetControl& aControl, const TAlfEvent& aEvent );
       
    61     
       
    62     IAlfInterfaceBase* makeInterface( const IfId& aType );
       
    63 
       
    64     void setEventHandlerData( const AlfWidgetEventHandlerInitData& aData );
       
    65 	  
       
    66 	AlfWidgetEventHandlerInitData* eventHandlerData();
       
    67 	
       
    68 	  AlfEventHandlerType eventHandlerType() ;
       
    69 
       
    70     AlfEventHandlerExecutionPhase eventExecutionPhase() ;
       
    71 
       
    72     
       
    73 public: // new methods 
       
    74 	
       
    75 	CAlfVisual* CreateIconStructure(CAlfLayout* aParentLayout, const UString& aTemplateId);  
       
    76     
       
    77     void DoSetImage(IAlfVariantType* data, CAlfImageVisual* aImgVisual);
       
    78 	      	
       
    79 			
       
    80 
       
    81 private:
       
    82 
       
    83    /**
       
    84  	* gets the handle to the visual template.
       
    85  	*/
       
    86   	MulVisualTemplate* VisualTemplate()
       
    87 		{
       
    88 		return static_cast<MulVisualTemplate*>(getVisualTemplate());
       
    89 		}
       
    90 private: // Member data
       
    91 	
       
    92     std::vector<CAlfVisual*> mRecycleVisualArray;        //stores sizes and positions of all items 
       
    93 	bool mVisualRecycled;
       
    94 	int mNumVisualsRecycled;
       
    95 	CAlfFlowLayout* mIconFlow;	
       
    96 	};
       
    97 	
       
    98 	} // namespace ends here
       
    99 	
       
   100 #endif /*MULCOVERFLOWITEMELEMENT_H_*/