internetradio2.0/uiinc/irnowplayingviewcontainer.h
changeset 0 09774dfdd46b
equal deleted inserted replaced
-1:000000000000 0:09774dfdd46b
       
     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:  Base Alfred control for the now playing view
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CIRNOWPLAYINGVIEWCONTAINER_H
       
    20 #define C_CIRNOWPLAYINGVIEWCONTAINER_H
       
    21 
       
    22 #include "internetradioconfigurationflags.hrh"
       
    23 
       
    24 #ifdef MUL_USE_COMMON_COMPONENTS
       
    25 
       
    26 #include <gesturecontrol.h>
       
    27 #include <gestureobserver.h>
       
    28 
       
    29 #else
       
    30 
       
    31 #include <alf/alfcontrol.h>
       
    32 
       
    33 #endif
       
    34 
       
    35 class CAlfEnv;	
       
    36 class CAlfAnchorLayout;
       
    37 class CAlfDeckLayout;
       
    38 class CAlfImageVisual;
       
    39 class CAlfTextVisual;
       
    40 class TAlfImage;
       
    41 class CIRStationInformationDisplay;
       
    42 class CIRStationLogoControl;
       
    43 class CIRNowPlayingView;
       
    44 class MTouchFeedback;
       
    45 class CIRRadioIdle;
       
    46 
       
    47 #ifdef MUL_USE_COMMON_COMPONENTS
       
    48 using namespace GestureHelper;
       
    49 #endif
       
    50 
       
    51 /**
       
    52  * Now playing container
       
    53  *
       
    54  * @since   S60 v3.2
       
    55  */
       
    56 #ifdef MUL_USE_COMMON_COMPONENTS
       
    57 class CIRNowPlayingViewContainer : public CGestureControl, public MGestureObserver
       
    58 #else
       
    59 class CIRNowPlayingViewContainer : public CAlfControl
       
    60 #endif
       
    61     {
       
    62 	public:
       
    63 	/**
       
    64 	* Two-phased constructor.
       
    65 	*
       
    66 	* Adds the control to the control group
       
    67 	*
       
    68 	* @param   aEnv    Alfred environment to use.
       
    69 	* @return  The created object. Ownership is not transferred.
       
    70 	*/
       
    71 	static CIRNowPlayingViewContainer* NewL( CAlfEnv& aEnv,CIRNowPlayingView* instance );
       
    72 
       
    73    	/* Two-phased constructor.
       
    74 	*
       
    75 	* Adds the control to the control group
       
    76 	*
       
    77 	* @param   aEnv    Alfred environment to use.
       
    78 	* @return  The created object. Ownership is not transferred.
       
    79 	*/
       
    80 	static CIRNowPlayingViewContainer* NewLC( CAlfEnv& aEnv,CIRNowPlayingView* aInstance );
       
    81 
       
    82 	/**
       
    83 	* Destructor.
       
    84 	*/
       
    85 	~CIRNowPlayingViewContainer();
       
    86 
       
    87 	/**
       
    88 	* Returns a reference to the station logo control.
       
    89 	*
       
    90 	* @return  Reference to the station logo control.
       
    91 	*/
       
    92 	CIRStationLogoControl& StationLogoControl();
       
    93 	
       
    94 	/**
       
    95      * Returns a reference to the radio idle control.
       
    96      * 
       
    97      * @return  Reference to the radio idle control.
       
    98      */ 
       
    99     CIRRadioIdle& RadioIdle();
       
   100 	/**
       
   101 	* Set the text in the visual.
       
   102 	*
       
   103 	* @param   aText   is the Bitrate Text
       
   104 	*/
       
   105 	void SetBitrateL( const TDesC& aText );
       
   106 	
       
   107 	/**
       
   108 	* Set the text in the visual.
       
   109 	*
       
   110 	* @param   aText   RDS text
       
   111 	*/
       
   112 
       
   113 	void SetByteCounterL( const TDesC& aText );
       
   114 	
       
   115 	/**
       
   116 	* StationInformationDisplay()
       
   117 	* reyurns the Instance of the StationInformationDisplay
       
   118 	*/
       
   119 	
       
   120 	CIRStationInformationDisplay& StationInformationDisplay();
       
   121 	
       
   122 	/**
       
   123 	* Layouts this control.
       
   124 	*
       
   125 	* TODO: Move this method to be private when CAlfControl is notified
       
   126 	* of portrait/landscape events.
       
   127 	*/
       
   128 	void LayoutControl();
       
   129 
       
   130 	
       
   131 	void SetLayoutAnchor( TInt aOrdinal, TInt aResourceId );
       
   132 	/**
       
   133      * Draw()
       
   134      * Function used to Draw the View
       
   135      */
       
   136 	void DrawViewL(TBool aLogoStatus) ;
       
   137 	// from base class MGestureObserver
       
   138 
       
   139 	#ifdef MUL_USE_COMMON_COMPONENTS
       
   140 	// from base class MGestureObserver
       
   141 	    void HandleGestureL( const MGestureEvent& aEvent );
       
   142 	#else
       
   143 	// from base class CAlfControl
       
   144 	    TBool OfferEventL( const TAlfEvent& aEvent );
       
   145 	#endif
       
   146 
       
   147 private: // Methods
       
   148 
       
   149 	/**
       
   150 	* Constructor.
       
   151 	*/
       
   152 	CIRNowPlayingViewContainer(CAlfEnv& aEnv);
       
   153 
       
   154 	/**
       
   155 	* Second-phase constructor.
       
   156 	*
       
   157 	* @param   aEnv    Alfred environment to use.
       
   158 	*/
       
   159 	void ConstructL(CIRNowPlayingView* instance);
       
   160 
       
   161 	/**
       
   162 	*TriggerCommandL.()
       
   163 	*
       
   164 	* triggering the Commands to the view
       
   165 	*/
       
   166 	void TriggerCommandL(TInt iCommandId);
       
   167     
       
   168     /**
       
   169 	* KeyHitL()
       
   170 	*
       
   171 	* used for handling Key Events
       
   172 	*/
       
   173 	TBool KeyHitL( TInt aScanCode);
       
   174     /**
       
   175      * Touch feedback.
       
   176      * Not owned.
       
   177      */
       
   178     MTouchFeedback* iFeedback;
       
   179 
       
   180 private: // Members
       
   181     
       
   182     /**
       
   183      * The Alfred environment
       
   184      */
       
   185     CAlfEnv& iAlfEnv;
       
   186 	
       
   187 	/**
       
   188 	* Logo control.
       
   189 	* Not owned.
       
   190 	*/
       
   191 	CIRStationLogoControl* iLogoControl;
       
   192 	
       
   193 	/**
       
   194 	* The base layout to which all controls are layouted.
       
   195 	* Not owned.
       
   196 	*/
       
   197 	CAlfAnchorLayout* iLayout;
       
   198 
       
   199 	/**
       
   200 	* Station information display.
       
   201 	* Not owned.
       
   202 	*/
       
   203 	CIRStationInformationDisplay* iStationInformationDisplay;
       
   204 
       
   205 	/**
       
   206 	* RDS text visual.
       
   207 	* Not owned.
       
   208 	*/
       
   209 	CAlfTextVisual* iBitrate;
       
   210 
       
   211 	/**
       
   212 	* RDS text visual.
       
   213 	* Not owned.
       
   214 	*/
       
   215 	
       
   216 	CAlfTextVisual* iByteCounter;
       
   217 
       
   218 
       
   219 	/**
       
   220 	* iNowPlayingView1
       
   221 	* Used for Handling KeyEvents
       
   222 	*/
       
   223 	CIRNowPlayingView* iNowPlayingView;
       
   224 	
       
   225 	/**
       
   226      * Radio Idle.
       
   227      * Owned.
       
   228      */
       
   229     CIRRadioIdle* iRadioIdle;
       
   230     };
       
   231 
       
   232 
       
   233 #endif // C_CIRNOWPLAYINGVIEWCONTAINER_H