photosgallery/viewframework/layouts/inc/glxlayoutinfo.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 base classes
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __GLXLAYOUTINFO_H__
       
    22 #define __GLXLAYOUTINFO_H__
       
    23 
       
    24 #include <e32std.h>
       
    25 #include <alf/alftimedvalue.h>
       
    26 // FORWARD DECLARATIONS
       
    27 class CAlfVisual;
       
    28 class TAlfTimedValue ;
       
    29 /**
       
    30  * TGlxScreenInfo
       
    31  * This class contains information about the screen, the layout may utilize these when laying out the visuals
       
    32  */
       
    33  //@TODO : This class has to removed. 
       
    34  //The views get the screen info from - iScreenSize, TGlxLayoutInfo
       
    35 NONSHARABLE_CLASS( TGlxScreenInfo )
       
    36 	{
       
    37 	public:
       
    38 
       
    39 		/**
       
    40 		 * Contructor, resets the variables
       
    41 		 */
       
    42 		IMPORT_C TGlxScreenInfo();
       
    43 
       
    44 	public:
       
    45 
       
    46 		/**
       
    47 		 * Width of the display
       
    48 		 */
       
    49 		TInt iWidth;
       
    50 		
       
    51 		/**
       
    52 		 * Height of the display
       
    53 		 */
       
    54 		TInt iHeight;
       
    55 
       
    56 		/**
       
    57 		 * Orientation of the display
       
    58 		 */
       
    59 		enum TOrientation { EPortrait, ELandscape } iOrientation;
       
    60 
       
    61 	};
       
    62 
       
    63 /**
       
    64  * TGlxLayoutInfo.
       
    65  * This class contains the fields that the layouts can modify in order to 
       
    66  * get the visuals drawn the way they want.
       
    67  */
       
    68 NONSHARABLE_CLASS( TGlxLayoutInfo )
       
    69 	{
       
    70 	
       
    71 	public:
       
    72 
       
    73 		/**
       
    74 		 * Mapped index, use this to get the index relative to focus
       
    75 		 */
       
    76 		TReal32 iMappedIndex;
       
    77 		/**
       
    78 		 * Display size
       
    79 		 */
       
    80 		TSize iScreenSize;
       
    81 		/**
       
    82 		 * Visual size
       
    83 		 */
       
    84 		TSize iVisualSize;
       
    85 		/**
       
    86 		 * Index of the visual
       
    87 		 */
       
    88 		inline TInt Index() const;
       
    89 		/**
       
    90 		 * The visual that the layout is targeted to
       
    91 		 */
       
    92 		inline CAlfVisual& Visual();
       
    93 
       
    94 	protected:
       
    95 
       
    96 		/**
       
    97 		 * Constructor, resets the state
       
    98 		 * @param the visual
       
    99 		 */
       
   100 		TGlxLayoutInfo( CAlfVisual* aVisual );
       
   101 
       
   102 		/// Own: the index
       
   103 		TInt iIndex;
       
   104 
       
   105 		/// Ref: the visual
       
   106 		CAlfVisual* iVisual;
       
   107 
       
   108 	};
       
   109 
       
   110 /**
       
   111  * TGlxLayoutInfoResetter
       
   112  * Modifiable version of the layout info
       
   113  * get the visuals drawn the way they want.
       
   114  */
       
   115 NONSHARABLE_CLASS( TGlxLayoutInfoResetter ) : public TGlxLayoutInfo
       
   116 	{
       
   117 	public:
       
   118 	
       
   119 		/**
       
   120 		 * Constructor, resets the state
       
   121 		 * This one sets the visual as NULL, use SetVisual to
       
   122 		 * update the visual
       
   123 		 */
       
   124 		IMPORT_C TGlxLayoutInfoResetter();
       
   125 
       
   126 		/**
       
   127 		 * Constructor, resets the state
       
   128 		 * @param the target visual
       
   129 		 */
       
   130 		IMPORT_C TGlxLayoutInfoResetter( CAlfVisual* aVisual );
       
   131 
       
   132 		/**
       
   133 		 * Set the visual
       
   134 		 * @param the target visual
       
   135 		 */
       
   136 		IMPORT_C void SetVisual( CAlfVisual* aVisual );
       
   137 
       
   138 		/**
       
   139 		 * Set the screen size
       
   140 		 * @param the screen size
       
   141 		 */
       
   142 		IMPORT_C void SetScreenSize( TSize aSize );
       
   143 		/* Reset, Sets the index and cleas all values.
       
   144 		 * iIndex and iMappedIndex are set to aIndex, 
       
   145 		 * other values are set to 0, except iTextureBottomRight
       
   146 		 * which is set to (1,1)
       
   147 		 * @param aIndex, the index for this item
       
   148 		 */
       
   149 		IMPORT_C void Reset( TInt aIndex );
       
   150 
       
   151 	};
       
   152 
       
   153 #include "glxlayoutinfo.inl"
       
   154 	
       
   155 #endif // __GLXLAYOUTINFO_H__
       
   156