uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuiteepgcontrol.h
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __ALFPERFAPPSUITEEPGCONTROL_H__
       
    19 #define __ALFPERFAPPSUITEEPGCONTROL_H__
       
    20 
       
    21 // INCLUDES
       
    22 #include <alf/alfcontrol.h>
       
    23 #include "alfperfappsuiteflags.h"
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CAlfLayout;
       
    27 class CAlfPerfAppSuiteTestCaseScroll;
       
    28 
       
    29 // CLASS DECLARATIONS
       
    30 class TProgram
       
    31 	{
       
    32 	public:
       
    33 		/**
       
    34 		 * C++ constructor.
       
    35 		 */		
       
    36 		TProgram();
       
    37 		
       
    38 		/**
       
    39 		 * C++ constructor.
       
    40 		 * @param aName Name of the program.
       
    41 		 * @param aStart Start time of the program.
       
    42 		 * @param aEnd End time of the program.
       
    43 		 */		
       
    44 		TProgram( const TDesC& aName, const TDesC& aStart, const TDesC& aEnd );
       
    45 		
       
    46 	public:
       
    47 		
       
    48 		/**
       
    49 		 * Calculates the duration of the program.
       
    50 		 * @return duration of the program.
       
    51 		 */
       
    52 		TInt DurationInMinutes();
       
    53 		
       
    54 	public:
       
    55 		/**
       
    56 		 * Name of the program.
       
    57 		 */
       
    58 		TBuf<100> iName;
       
    59 		
       
    60 		/**
       
    61 		 * Start time.
       
    62 		 */
       
    63 		TTime iStart;
       
    64 		
       
    65 		/**
       
    66 		 * End time.
       
    67 		 */
       
    68 		TTime iEnd;
       
    69 	};
       
    70 
       
    71 class CAlfPerfAppSuiteEPGControl : public CAlfControl, public MAlfTextureLoadingCompletedObserver
       
    72     {
       
    73 	private: // Enums
       
    74 		
       
    75 		/**
       
    76 		 * Textstyles used in EGP.
       
    77 		 */
       
    78 		enum TTextStyle
       
    79 			{
       
    80 			ETextStyleTitle = 0,
       
    81 			ETextStyleTime,
       
    82 			ETextStyleProgram,
       
    83 			ENumberOfTextStyles
       
    84 			};
       
    85 	
       
    86 	public: // Construction and desctruction
       
    87 		
       
    88 		/**
       
    89 		 * C++ constuctor.
       
    90 		 * @param aScrollControl is used as observer
       
    91 		 */ 
       
    92 		CAlfPerfAppSuiteEPGControl(CAlfPerfAppSuiteTestCaseScroll* aScrollControl);
       
    93 		
       
    94 		/**
       
    95 		 * Destructor.
       
    96 		 */
       
    97 		~CAlfPerfAppSuiteEPGControl();
       
    98 		
       
    99 		/**
       
   100 		 * Second-phase constructor.
       
   101 		 * @param aEnv Alf environment.
       
   102 		 * @param aVisibleArea Visible screen area.
       
   103 		 * @param aParentLayout Parent layout.
       
   104 		 */		
       
   105 	    virtual void ConstructL( 
       
   106 	        CAlfEnv& aEnv, 
       
   107 	        const TSize& aVisibleArea,
       
   108 	        CAlfLayout* aParentLayout );
       
   109 	    
       
   110 	private: // New functions
       
   111 #ifdef ENABLE_TEXTSTYLES		
       
   112 		void CreateTextStylesL();
       
   113 #endif
       
   114 		void AddRowL( 
       
   115 				CAlfLayout* aParentLayout,
       
   116 				TAlfImage& aChannelImage,
       
   117 				RArray<TProgram>& aPrograms,
       
   118 				const TTime& aTimeWindowStart,
       
   119 				const TTime& aTimeWindowEnd,
       
   120 				TInt aTextStyle,
       
   121 				TBool aSetBorders = ETrue
       
   122 				);
       
   123 		
       
   124 		void AddProgramsL( 
       
   125 				CAlfLayout* aParentLayout,
       
   126 				RArray<TProgram>& aPrograms,
       
   127 				const TTime& aTimeWindowStart,
       
   128 				const TTime& aTimeWindowEnd,
       
   129 				TInt aTextStyle,
       
   130 				TBool aSetBorders
       
   131 				);		
       
   132 	   
       
   133 	    // From base class MAlfTextureLoadingCompletedObserver
       
   134 	    void TextureLoadingCompleted(
       
   135 	            CAlfTexture& aTexture,
       
   136 	            TInt aTextureId,
       
   137 	            TInt aErrorCode );
       
   138 	    
       
   139 	private:
       
   140 		TSize iVisibleArea;
       
   141 
       
   142 		/**
       
   143 		 * count of the number of loaded textures
       
   144 		 */
       
   145 		TInt iLoadedImages;
       
   146 		
       
   147 		/**
       
   148 		 * Used for callback.
       
   149 		 * Not owned.
       
   150 		 */
       
   151 		CAlfPerfAppSuiteTestCaseScroll* iScrollControl;
       
   152 		
       
   153 #ifdef ENABLE_TEXTSTYLES		
       
   154 		RArray<TInt> iTextStyles;
       
   155 #endif
       
   156     };
       
   157 
       
   158 #endif // __ALFPERFAPPSUITEEPGCONTROL_H__
       
   159 
       
   160 // end of file