photosgallery/viewframework/layouts/inc/glxlayouthelper.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:    Layout to mapping function adapter class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef T_GLXLAYOUTHELPER_H
       
    22 #define T_GLXLAYOUTHELPER_H
       
    23 
       
    24 // INCLUDE DEPENDENCIES
       
    25 #include <e32std.h>
       
    26 #include <glxlayoutinfo.h>	// TGlxLayoutInfoResetter
       
    27 
       
    28 // FORWARD DECLARES
       
    29 class MGlxLayout;
       
    30 
       
    31 /**
       
    32  * TGlxLayoutHelper
       
    33  *  
       
    34  * Sets the layout values from MGlxLayout and TGlxLayoutInfo
       
    35  * to a CHuiVisual.
       
    36  *
       
    37  * @lib glxlayouts.lib
       
    38  */
       
    39 class TGlxLayoutHelper
       
    40 	{
       
    41 	public:
       
    42 
       
    43 		/**
       
    44 		 * Constructor
       
    45 		 * @param aVisual the visual to layout
       
    46 		 */
       
    47 		IMPORT_C TGlxLayoutHelper( CAlfVisual& aVisual );
       
    48 
       
    49 		/**
       
    50 		 * Destructor.
       
    51 		 */
       
    52 		IMPORT_C ~TGlxLayoutHelper();
       
    53 
       
    54 		/**
       
    55 		 * This method should be called when the layout needs to be updated
       
    56 		 * @param aIndex the current index for the visual this helper is mapped
       
    57 		 * @param aScreenSize the screen size, passed on to the layout
       
    58 		 */
       
    59 		IMPORT_C void LayoutVisual( TInt aIndex, TSize aScreenSize );
       
    60 		/**
       
    61          * This method should be called when the Panning (Drag)layout needs to be updated
       
    62          * @param aIndex the current index for the visual this helper is mapped
       
    63          * @param aScreenSize the screen size, passed on to the layout
       
    64          */
       
    65         IMPORT_C void LayoutPanVisual( TInt aIndex, TSize aScreenSize );
       
    66 		
       
    67 		/**
       
    68 		 * Sets the layout chain to this adapter.
       
    69 		 * @param aLayout layout to use
       
    70 		 */
       
    71 		IMPORT_C void SetLayout( MGlxLayout* aLayout );
       
    72 		/**
       
    73 		 * Gets the layout updated Size.
       
    74 		 */
       
    75 		IMPORT_C TSize GetUpdatedVisualSize( );
       
    76 		/**
       
    77          * Gets the layout information.
       
    78 		 */
       
    79         IMPORT_C TGlxLayoutInfo& GetUpdatedLayoutInfo( );
       
    80 
       
    81 	private:
       
    82 
       
    83 		/// Own: The layout info
       
    84 		TGlxLayoutInfoResetter iLayoutInfo;
       
    85 		/// Ref: The visual
       
    86 		CAlfVisual& iVisual;
       
    87 		/// Ref: The layout 
       
    88 		MGlxLayout* iLayout;
       
    89 
       
    90 	};
       
    91 	
       
    92 #endif // T_GLXLAYOUTHELPER_H
       
    93