internetradio2.0/uisrc/irstationinfocontainer.cpp
changeset 0 09774dfdd46b
equal deleted inserted replaced
-1:000000000000 0:09774dfdd46b
       
     1 /*
       
     2 * Copyright (c) 2007-2010 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:  Container class for the detail view
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /* ---------------------------------------------------------------------------
       
    20 *  Version history:
       
    21 *  Template version:
       
    22 *  <ccm_history>
       
    23 *
       
    24 *  Version: 4, Fri Aug 1 16:17:00 2008 by Rohit
       
    25 *  Ref:
       
    26 *  Fixed bug - Once StationInfo view is opened for logo station, on listen
       
    27 *  StationInfo view was shown above NowPlayingView toolbar
       
    28 *
       
    29 *  Version: 3, Thu Jul 3 16:30:00 2008 by Rohit
       
    30 *  Ref:
       
    31 *  Codescanner fixes
       
    32 *
       
    33 *  Version: 2, Thu May 22 19:20:00 2008 by Rohit
       
    34 *  Ref:
       
    35 *  Implemented StationInfo landscape view. Adjusted line spacings per UI spec.
       
    36 *
       
    37 *  Version: 1, Wed Apr 30 16:15:00 2008 by Rohit
       
    38 *  Ref:
       
    39 *  Created. Implemented StationInfo potrait view
       
    40 *
       
    41 *  </ccm_history>
       
    42 * ============================================================================
       
    43 */
       
    44 
       
    45 // INCLUDE FILES
       
    46 
       
    47 #include <s32std.h>
       
    48 #include <eikenv.h>
       
    49 #include <eikapp.H>
       
    50 #include <eikappui.H>
       
    51 #include <stringloader.h>
       
    52 #include <aknutils.h>                     		// AknLayoutUtils
       
    53 /* no need to change to lower case */
       
    54 #include <AknsBasicBackgroundControlContext.h> 	// CAknsBasicBackgroundControlContext
       
    55 #include <aknsskininstance.h> 					// MAknsSkinInstance
       
    56 #include <aknsdrawutils.h>                		// AknsDrawUtils
       
    57 #include <eikrted.h>                      		// CEikRichTextEditor
       
    58 #include <txtrich.h>                      		// CRichText
       
    59 #include <internetradio.mbg>
       
    60 #include <internetradio.rsg>
       
    61 
       
    62 #include "irdebug.h"
       
    63 #include "irstationinfocontainer.h"
       
    64 #include "irstationinfoview.h"   		           		 
       
    65 #include "irisdspreset.h"
       
    66 #include "irchannelserverurl.h"
       
    67 #include "irui.h"
       
    68 #include "irimageconverter.h"
       
    69 #include "irstationinfopicture.h"
       
    70 
       
    71 
       
    72 // CONSTANT DECLARATIONS
       
    73 _LIT(Kspace," ");
       
    74 _LIT(KHttp,"http://");
       
    75 const TInt KZero    = 0;
       
    76 const TInt KOne     = 1;
       
    77 const TInt KTwo    	= 2;
       
    78 const TInt KBufferSize	= 128;
       
    79 #define KSI_USERDEFINED 0 	// Indicates that the station is of type user defined
       
    80 #define KSI_ISDS_DEFINED 1
       
    81 const TInt KHttpLength 					= 7;
       
    82 
       
    83 const TInt KLINES_COUNT 				= 50;
       
    84 const TInt KTEXT_LIMIT  				= 3000;
       
    85 
       
    86 const TInt KLOGO_WIDTH  				= 200;
       
    87 const TInt KLOGO_HEIGHT  				= 200;
       
    88 
       
    89 const TInt KRICHTEXT_ORIGIN  			= 0;
       
    90 const TInt KRICHTEXT_LENGTH  			= 0;
       
    91 
       
    92 const TInt KPARA_LINE_SPACING  			= 25;	// twips
       
    93 const TInt KPARA_SPACING  				= 45;	// twips
       
    94 
       
    95 const TInt KLEFT_MARGIN_POTRAIT     	= 20;	// twips
       
    96 const TInt KRIGHT_MARGIN_POTRAIT    	= 10;	// twips
       
    97 
       
    98 const TInt KLEFT_MARGIN_LANDSCAPE_LOGO   = 0;	// twips
       
    99 const TInt KLEFT_MARGIN_LANDSCAPE_NOLOGO = 10;	// twips
       
   100 const TInt KLEFT_LOGO_MARGIN_LANDSCAPE   = 20;	// twips
       
   101 const TInt KRIGHT_MARGIN_LANDSCAPE  = 10;		// twips
       
   102 
       
   103 const TInt KHEADINGTEXT_HEIGHT_DECREMENT = -5;	// twips
       
   104 const TInt KNORMALTEXT_HEIGHT_DECREMENT  = 5;	// twips
       
   105 
       
   106 
       
   107 // ============================ MEMBER FUNCTIONS ===============================
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // CIRStationInfoContainer::CIRStationInfoContainer
       
   111 // C++ default constructor can NOT contain any code, that might leave.
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 CIRStationInfoContainer::CIRStationInfoContainer( CIRStationInfoView* aStationInfoView )
       
   115   : iBgContext( NULL ),
       
   116     iEditorLogo( NULL ),
       
   117     iEditor( NULL ),
       
   118     iBitmap(NULL), iBitmapMask(NULL),
       
   119     iStationInfoView( aStationInfoView ),
       
   120     iConverter(NULL), iError(KErrNone),
       
   121     iImageDrawn( EFalse )
       
   122     {
       
   123     IRLOG_DEBUG( "CIRStationInfoContainer::CIRStationInfoContainer" );
       
   124     }
       
   125 
       
   126 // -----------------------------------------------------------------------------
       
   127 // CIRStationInfoContainer::ConstructL
       
   128 // Symbian 2nd phase constructor can leave.
       
   129 // -----------------------------------------------------------------------------
       
   130 //
       
   131 void CIRStationInfoContainer::ConstructL( const TRect& aRect )
       
   132     {
       
   133     IRLOG_DEBUG( "CIRStationInfoContainer::ConstructL - Entering" );
       
   134     CreateWindowL();
       
   135     SetRect( aRect );
       
   136 
       
   137     // background context for mop object
       
   138     iBgContext = CAknsBasicBackgroundControlContext::NewL(
       
   139         KAknsIIDQsnBgAreaMain, Rect(), EFalse );
       
   140 
       
   141    	iEditor = CreateEditorL();
       
   142    	iEditorLogo = CreateEditorL();
       
   143 	iEditorLogo->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,
       
   144 															CEikScrollBarFrame::EOff );
       
   145 	iConverter = CIRImageConverter::NewL();
       
   146 	iConverter->EnableAnimations( ETrue );
       
   147 	iConverter->SetObserver( this );
       
   148 
       
   149     IRLOG_DEBUG( "CIRStationInfoContainer::ConstructL - Exiting" );
       
   150     }
       
   151 
       
   152 
       
   153 // -----------------------------------------------------------------------------
       
   154 // CIRStationInfoContainer::CreateEditorL
       
   155 // Instantiates RichTextEditor
       
   156 // -----------------------------------------------------------------------------
       
   157 //
       
   158 CEikRichTextEditor* CIRStationInfoContainer::CreateEditorL()
       
   159     {
       
   160     IRLOG_DEBUG( "CIRStationInfoContainer::CreateEditorL - Entering" );
       
   161     CEikRichTextEditor* editor = new (ELeave) CEikRichTextEditor;
       
   162     CleanupStack::PushL( editor );
       
   163 
       
   164     editor->SetContainerWindowL(*this);
       
   165     editor->ConstructL(this, KLINES_COUNT, KTEXT_LIMIT, CEikEdwin::EReadOnly );
       
   166 
       
   167     editor->RichText()->Reset();
       
   168 
       
   169     // create vertical scrollbar
       
   170     editor->CreateScrollBarFrameL();
       
   171     editor->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,
       
   172     												   CEikScrollBarFrame::EAuto );
       
   173 	editor->ActivateL();
       
   174     CleanupStack::Pop(editor); // editor
       
   175 
       
   176     IRLOG_DEBUG( "CIRStationInfoContainer::CreateEditorL - Exiting" );
       
   177     return editor;
       
   178     }
       
   179 
       
   180 
       
   181 // -----------------------------------------------------------------------------
       
   182 // CIRStationInfoContainer::NewL
       
   183 // Two-phased constructor.
       
   184 // -----------------------------------------------------------------------------
       
   185 //
       
   186 CIRStationInfoContainer* CIRStationInfoContainer::NewL( const TRect& aRect,
       
   187 														CIRStationInfoView* aView )
       
   188     {
       
   189     IRLOG_DEBUG( "CIRStationInfoContainer::NewL - Entering" );
       
   190     CIRStationInfoContainer* self = new ( ELeave ) CIRStationInfoContainer( aView);
       
   191     CleanupStack::PushL( self );
       
   192     self->ConstructL( aRect );
       
   193     CleanupStack::Pop( self );
       
   194 
       
   195 	IRLOG_DEBUG( "CIRStationInfoContainer::NewL - Exiting" );
       
   196     return self;
       
   197     }
       
   198 
       
   199 // -----------------------------------------------------------------------------
       
   200 // CIRStationInfoContainer::~CIRStationInfoContainer
       
   201 // Destructor.
       
   202 // -----------------------------------------------------------------------------
       
   203 //
       
   204 CIRStationInfoContainer::~CIRStationInfoContainer()
       
   205     {
       
   206     IRLOG_DEBUG( "CIRStationInfoContainer::~CIRStationInfoContainer - Entering" );
       
   207 	if (iBgContext)
       
   208 		{
       
   209 	 	delete iBgContext;
       
   210 	 	iBgContext = NULL;
       
   211 		}
       
   212 	if (iEditor)
       
   213 		{
       
   214 	    iEditor->RichText()->Reset();
       
   215 	   	delete iEditor;
       
   216     	iEditor = NULL;
       
   217 		}
       
   218 	if (iEditorLogo)
       
   219 		{
       
   220    	    iEditorLogo->RichText()->Reset();
       
   221 	   	delete iEditorLogo;
       
   222     	iEditorLogo = NULL;
       
   223 		}
       
   224 	if( iBitmap )
       
   225 		{
       
   226 		delete iBitmap;
       
   227 		iBitmap = NULL;
       
   228 		}
       
   229 	if( iBitmapMask )
       
   230 		{
       
   231 		delete iBitmapMask;
       
   232 		iBitmapMask = NULL;
       
   233 		}
       
   234 	if( iConverter )
       
   235 		{
       
   236 		delete iConverter;
       
   237 		iConverter = NULL;
       
   238 		}
       
   239 	iStationInfoView = NULL;	// not owned
       
   240 	IRLOG_DEBUG( "CIRStationInfoContainer::~CIRStationInfoContainer - Exiting" );
       
   241     }
       
   242 
       
   243 // -----------------------------------------------------------------------------
       
   244 // CIRStationInfoContainer::CountComponentControls
       
   245 // From base class CCoeControl
       
   246 // Returns number of controls contained in a compound control
       
   247 // -----------------------------------------------------------------------------
       
   248 //
       
   249 TInt CIRStationInfoContainer::CountComponentControls() const
       
   250     {
       
   251     IRLOG_DEBUG( "CIRStationInfoContainer::CountComponentControls" );
       
   252     return iEditor ? 2 : 0;
       
   253     }
       
   254 
       
   255 // -----------------------------------------------------------------------------
       
   256 // CIRStationInfoContainer::ComponentControl
       
   257 // From base class CCoeControl
       
   258 // Returns an indexed component of a compound control
       
   259 // -----------------------------------------------------------------------------
       
   260 //
       
   261 CCoeControl* CIRStationInfoContainer::ComponentControl( TInt aIndex ) const
       
   262     {
       
   263     IRLOG_DEBUG( "CIRStationInfoContainer::ComponentControl - Entering" );
       
   264 
       
   265     CCoeControl* ctl = NULL;
       
   266 
       
   267     switch(aIndex)
       
   268 	    {
       
   269     	case 0:
       
   270 	    	ctl = iEditor;
       
   271 	    	break;
       
   272 	    case 1:
       
   273 	    	ctl = iEditorLogo;
       
   274 	    	break;
       
   275 	    default:
       
   276 	    	break;
       
   277     	}
       
   278     IRLOG_DEBUG( "CIRStationInfoContainer::ComponentControl - Exiting" );
       
   279     return ctl;
       
   280     }
       
   281 
       
   282 // -----------------------------------------------------------------------------
       
   283 // CIRStationInfoContainer::OfferKeyEventL
       
   284 // From base class CCoeControl
       
   285 // Handles key events
       
   286 // -----------------------------------------------------------------------------
       
   287 //
       
   288 TKeyResponse CIRStationInfoContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   289 													  TEventCode aType )
       
   290     {
       
   291     IRLOG_DEBUG( "CIRStationInfoContainer::OfferKeyEventL" );
       
   292 
       
   293 	TKeyResponse res = EKeyWasNotConsumed;
       
   294 
       
   295     if (aType == EEventKey)
       
   296     {
       
   297         if (aKeyEvent.iCode == EKeyDownArrow)
       
   298         {
       
   299             iEditor->MoveCursorL (TCursorPosition::EFPageDown, EFalse);
       
   300             res = EKeyWasConsumed;
       
   301         }
       
   302         else if (aKeyEvent.iCode == EKeyUpArrow)
       
   303         {
       
   304             iEditor->MoveCursorL (TCursorPosition::EFPageUp, EFalse);
       
   305             res = EKeyWasConsumed;
       
   306         }
       
   307         else
       
   308         {
       
   309             res = iEditor->OfferKeyEventL(aKeyEvent, aType);
       
   310         }
       
   311     }
       
   312     return res;
       
   313     }
       
   314 
       
   315 // -----------------------------------------------------------------------------
       
   316 // CIRStationInfoContainer::MopSupplyObject
       
   317 // From base class CCoeControl
       
   318 // Retrieves an object of the same type as that encapsulated in aId.
       
   319 // -----------------------------------------------------------------------------
       
   320 //
       
   321 TTypeUid::Ptr CIRStationInfoContainer::MopSupplyObject( TTypeUid aId )
       
   322     {
       
   323     IRLOG_DEBUG( "CIRStationInfoContainer::MopSupplyObject - Entering" );
       
   324     if ( aId.iUid == MAknsControlContext::ETypeId && iBgContext )
       
   325         {
       
   326         return MAknsControlContext::SupplyMopObject( aId, iBgContext );
       
   327         }
       
   328 
       
   329     IRLOG_DEBUG( "CIRStationInfoContainer::MopSupplyObject - Exiting" );
       
   330     return CCoeControl::MopSupplyObject( aId );
       
   331     }
       
   332 
       
   333 // -----------------------------------------------------------------------------
       
   334 // CIRStationInfoContainer::SizeChanged
       
   335 // From base class CCoeControl
       
   336 // Responds to changes to the size and position of the contents of this control.
       
   337 // -----------------------------------------------------------------------------
       
   338 //
       
   339 void CIRStationInfoContainer::SizeChanged()
       
   340     {
       
   341     IRLOG_DEBUG( "CIRStationInfoContainer::SizeChanged - Entering" );
       
   342     if( !iEditor )
       
   343 	    {
       
   344 		IRLOG_DEBUG( "CIRStationInfoContainer::SizeChanged - Exiting" );
       
   345 	    return;
       
   346 	    }
       
   347 	if ( IsStationSupportsLogo() && !iBitmap)	// logo supported but not downloaded yet
       
   348 		{
       
   349 		IRLOG_DEBUG( "CIRStationInfoContainer::SizeChanged - Exiting" );
       
   350 		return;
       
   351 		}
       
   352 
       
   353 	if( iClientRect != Rect() )
       
   354 		{
       
   355 		TRAPD( err, ReloadStationInformationL() );
       
   356 		if(err != KErrNone)
       
   357 			{
       
   358 			IRLOG_WARNING( "CIRStationInfoContainer::SizeChanged - ReloadStationInformationL() failed" );
       
   359 			}
       
   360 		}
       
   361 	IRLOG_DEBUG( "CIRStationInfoContainer::SizeChanged - Exiting" );
       
   362     }
       
   363 
       
   364 // -----------------------------------------------------------------------------
       
   365 // CIRStationInfoContainer::Draw
       
   366 // From base class CCoeControl
       
   367 // Draws the control.
       
   368 // -----------------------------------------------------------------------------
       
   369 //
       
   370 void CIRStationInfoContainer::Draw( const TRect& /*aRect*/ ) const
       
   371     {
       
   372     IRLOG_DEBUG( "CIRStationInfoContainer::Draw - Entering" );
       
   373 	SystemGc();
       
   374 
       
   375     // draw background from skin
       
   376     AknsUtils::SkinInstance();				// PC Lint #529 Fix
       
   377     AknsDrawUtils::ControlContext( this );	// PC Lint #529 Fix
       
   378     IRLOG_DEBUG( "CIRStationInfoContainer::Draw - Exiting" );
       
   379     }
       
   380 
       
   381 // ---------------------------------------------------------------------------
       
   382 // CIRStationInfoContainer::StartConvertStationLogoL()
       
   383 // Issues logo scaling request
       
   384 // ---------------------------------------------------------------------------
       
   385 //
       
   386 void CIRStationInfoContainer::StartConvertStationLogoL( )
       
   387 	{
       
   388 	IRLOG_DEBUG( "CIRStationInfoContainer::StartConvertStationLogoL - Entering" );
       
   389 	if ( IsStationSupportsLogo() )
       
   390 		{
       
   391 		iConverter->SetDataL( iStationInfoView->iStationPreset->GetLogoData() );
       
   392 		if(iError==KErrNone)
       
   393 			{
       
   394 			TInt channelId = iStationInfoView->iStationPreset->GetId();
       
   395 			iConverter->StartL( TSize(KLOGO_WIDTH, KLOGO_HEIGHT), channelId );
       
   396 			}
       
   397 		}
       
   398 	IRLOG_DEBUG( "CIRStationInfoContainer::StartConvertStationLogoL - Exiting" );
       
   399 	}
       
   400 
       
   401 
       
   402 // ---------------------------------------------------------------------------
       
   403 // CIRStationInfoContainer::HandleImageConversionEventL()
       
   404 // From MIRImageConverterObserver
       
   405 // Invoked after image scaling is completed.
       
   406 // ---------------------------------------------------------------------------
       
   407 //
       
   408 void CIRStationInfoContainer::HandleImageConversionEventL(
       
   409 	MIRImageConverterObserver::TIRImageConversionEvent /*aEvent*/,TInt /*aId*/,TInt aError)
       
   410 	{
       
   411 	IRLOG_DEBUG( "CIRStationInfoContainer::HandleImageConversionEventL - Entering" );
       
   412 	// Retreive scaled bitmaps
       
   413 	iError=aError;
       
   414 	if(iError!=KErrNone)
       
   415 		{
       
   416 		return;
       
   417 		}
       
   418 
       
   419 	iConverter->TransferBitmapOwnership( iBitmap, iBitmapMask );
       
   420 
       
   421 	TRect rectParent = Rect();
       
   422 	if( !iBitmap && !iBitmapMask )
       
   423 		{
       
   424 		IRLOG_WARNING("CIRStationInfoContainer::HandleImageConversionEventL- LogoScaling failed");
       
   425 		}
       
   426 	
       
   427 	else if( iClientRect != rectParent )
       
   428 		{
       
   429 		ReloadStationInformationL();
       
   430 		}	
       
   431 
       
   432 	// Potrait view with logo
       
   433 	else if( rectParent.Height() >= rectParent.Width() )
       
   434 		{
       
   435 		DisplayStationLogoL( iEditor, EFalse );
       
   436 		iEditorLogo->DrawNow();
       
   437 
       
   438 		TPoint	point1( rectParent.iTl.iX, rectParent.iTl.iY );
       
   439 		TRect scrollBarRect = iEditor->ScrollBarFrame()->VerticalScrollBar()->Rect();
       
   440 		iEditor->SetExtent( point1, TSize( rectParent.Width() - scrollBarRect.Width(),
       
   441 							rectParent.Height() ) );
       
   442 
       
   443 		iEditor->DrawDeferred();
       
   444 		}
       
   445 	// Landscape view with logo
       
   446 	else
       
   447 		{
       
   448 		DisplayStationLogoL( iEditorLogo, ETrue );
       
   449 
       
   450 	    TPoint	point1( rectParent.iTl.iX, rectParent.iTl.iY );
       
   451 	    TInt	width1 = rectParent.Width()/2, height1 = rectParent.Height();
       
   452 	    iEditorLogo->SetExtent( point1, TSize( width1, height1 ) );
       
   453 
       
   454 	    iEditorLogo->DrawDeferred();
       
   455 	    iEditor->DrawDeferred();
       
   456 		}
       
   457 
       
   458 	IRLOG_DEBUG( "CIRStationInfoContainer::HandleImageConversionEventL - Exiting" );
       
   459 	}
       
   460 
       
   461 // ---------------------------------------------------------------------------
       
   462 // CIRStationInfoContainer::ReloadStationInformationL()
       
   463 // Renders the logo and text in the view as per the current resolution
       
   464 // ---------------------------------------------------------------------------
       
   465 //
       
   466 void CIRStationInfoContainer::ReloadStationInformationL()
       
   467 	{
       
   468 	IRLOG_DEBUG( "CIRStationInfoContainer::ReloadStationInformationL - Entering" );
       
   469 
       
   470 	// save current size to avoid SizeChanged multiple refreshes (optimize perf.)
       
   471 	iClientRect = Rect();
       
   472 
       
   473 	iEditor->RichText()->Reset();
       
   474     CreateRichTextDataL();
       
   475     iImageDrawn = EFalse;
       
   476 
       
   477 	//
       
   478 	// Potrait view with/without logo
       
   479 	//
       
   480 	TRect   rectParent = Rect();
       
   481 	if( rectParent.Height() >= rectParent.Width() )
       
   482 		{
       
   483 		DisplayStationLogoL( iEditor, EFalse );
       
   484 		iEditorLogo->DrawNow();
       
   485 		iEditor->RichText()->InsertL( iEditor->RichText()->DocumentLength(),
       
   486 									  CEditableText::EParagraphDelimiter);
       
   487 		DisplayStationInfoL( EFalse );
       
   488 
       
   489 	    iEditor->DrawDeferred();
       
   490 
       
   491 		TPoint	point1( rectParent.iTl.iX, rectParent.iTl.iY );
       
   492 		TRect scrollBarRect = iEditor->ScrollBarFrame()->VerticalScrollBar()->Rect();
       
   493 		iEditor->SetExtent( point1, TSize( rectParent.Width() - scrollBarRect.Width(),
       
   494 							rectParent.Height() ) );
       
   495 		}
       
   496 
       
   497 	//
       
   498 	// Landscape view without logo
       
   499 	//
       
   500 	else if( !IsStationSupportsLogo() )
       
   501 		{
       
   502 		iEditorLogo->MakeVisible( EFalse );
       
   503 		iEditorLogo->DrawNow();
       
   504 
       
   505 		DisplayStationInfoL( ETrue );
       
   506 
       
   507 		TPoint	point1( rectParent.iTl.iX, rectParent.iTl.iY );
       
   508 		TRect scrollBarRect = iEditor->ScrollBarFrame()->VerticalScrollBar()->Rect();
       
   509 		iEditor->SetExtent( point1, TSize( rectParent.Width() - scrollBarRect.Width(),
       
   510 							rectParent.Height() ) );
       
   511 
       
   512 	    iEditor->DrawDeferred();
       
   513 		}
       
   514 
       
   515 	//
       
   516 	// Landscape view with logo
       
   517 	//
       
   518 	else
       
   519 		{
       
   520 		DisplayStationLogoL( iEditorLogo, ETrue );
       
   521 		DisplayStationInfoL( ETrue );
       
   522 
       
   523 	    TPoint	point1( rectParent.iTl.iX, rectParent.iTl.iY );
       
   524 	    TInt	width1 = rectParent.Width()/2, height1 = rectParent.Height();
       
   525 	    iEditorLogo->SetExtent( point1, TSize( width1, height1 ) );
       
   526 
       
   527 	    TPoint	point2( rectParent.iTl.iX+width1, rectParent.iTl.iY );
       
   528 	    TInt	width2 = rectParent.Width()/2, height2 = rectParent.Height();
       
   529         TRect scrollBarRect = iEditor->ScrollBarFrame()->VerticalScrollBar()->Rect();
       
   530         iEditor->SetExtent( point2, TSize( width2 - scrollBarRect.Width(), height2 ) );
       
   531 
       
   532 	    iEditor->DrawDeferred();
       
   533 	    iEditorLogo->DrawDeferred();
       
   534 		}
       
   535 
       
   536     ActivateL();
       
   537 	iEditor->SetCursorPosL(KZero, EFalse );
       
   538 
       
   539 	IRLOG_DEBUG( "CIRStationInfoContainer::ReloadStationInformationL - Exiting" );
       
   540 	}
       
   541 
       
   542 // ---------------------------------------------------------------------------
       
   543 // CIRStationInfoContainer::DisplayStationLogoL
       
   544 // Renders the logo in the view as per the current resolution
       
   545 // ---------------------------------------------------------------------------
       
   546 //
       
   547 void CIRStationInfoContainer::DisplayStationLogoL( CEikRichTextEditor* aEditor,
       
   548 												   TBool aIsLandscape )
       
   549 	{
       
   550 	IRLOG_DEBUG( "CIRStationInfoContainer::DisplayStationLogoL - Entering" );
       
   551 	if( iBitmap || iBitmapMask )
       
   552 		{
       
   553 		//
       
   554 		// Horizontally Center Align logo
       
   555 		//
       
   556 	    TParaFormatMask paraFormatMask;
       
   557 	    CParaFormat *paraFormat = CParaFormat::NewL();
       
   558 	    CleanupStack::PushL( paraFormat );
       
   559 
       
   560 	    CRichText* richTextLogo = aEditor->RichText();
       
   561 	    richTextLogo->GetParaFormatL( paraFormat, paraFormatMask, 0, 0 );
       
   562 	    paraFormatMask.SetAll();
       
   563 		if( aIsLandscape )
       
   564 			{
       
   565 			paraFormat->iLeftMarginInTwips = KLEFT_LOGO_MARGIN_LANDSCAPE;
       
   566 			}
       
   567 		paraFormat->iHorizontalAlignment = CParaFormat::ECenterAlign;
       
   568 	    richTextLogo->ApplyParaFormatL(paraFormat, paraFormatMask, 0, 0 );
       
   569 	    CleanupStack::PopAndDestroy( paraFormat );
       
   570 
       
   571 		// Vertical center logo
       
   572 		//
       
   573 		if( aIsLandscape )
       
   574 			{
       
   575 			TCharFormat charFormatLogo;
       
   576 			TCharFormatMask formatMask;
       
   577 			richTextLogo->GetCharFormat( charFormatLogo, formatMask, 0, 0);
       
   578 			formatMask.SetAll();
       
   579 
       
   580 		    charFormatLogo.iFontPresentation.iPictureAlignment
       
   581 		    	= TFontPresentation::EAlignCentered;
       
   582 
       
   583 		    TInt heightPixels = aEditor->TextLayout()->BandHeight();
       
   584 			charFormatLogo.iFontSpec.iHeight = heightPixels;
       
   585 
       
   586 			richTextLogo->SetInsertCharFormatL(charFormatLogo, formatMask,
       
   587 											   richTextLogo->DocumentLength());
       
   588 			}
       
   589 
       
   590 		// remove existing frame if any
       
   591 		if( aIsLandscape )
       
   592 			{
       
   593 			iEditorLogo->MakeVisible( ETrue );
       
   594 			iEditorLogo->RichText()->Reset();
       
   595 			}
       
   596 		else if( !iImageDrawn )
       
   597 			{
       
   598 			iEditorLogo->MakeVisible( EFalse );
       
   599 			iEditorLogo->RichText()->Reset();
       
   600 			iImageDrawn = ETrue;
       
   601 			}
       
   602 		else
       
   603 			{
       
   604 			iEditorLogo->MakeVisible( EFalse );
       
   605 			iEditorLogo->RichText()->Reset();
       
   606 			richTextLogo->DeleteL( KZero, KTwo );
       
   607 			}
       
   608 
       
   609 		// Display scaled station logo
       
   610 		//
       
   611 		CIRStationInfoPicture* picture = new(ELeave) CIRStationInfoPicture
       
   612 										 ( SystemGc(), *iBitmap, *iBitmapMask );
       
   613 		CleanupStack::PushL(picture);
       
   614 		TPictureHeader picHeader;
       
   615 		picHeader.iPicture = TSwizzle<CPicture>( picture );
       
   616 		richTextLogo->InsertL( KZero, CEditableText::ELineBreak);
       
   617 		richTextLogo->InsertL( KOne, picHeader);
       
   618 		CleanupStack::Pop( picture ); 	// RichTextEditor owns the picture
       
   619 		
       
   620 		if( aIsLandscape )
       
   621 			{
       
   622 			richTextLogo->CancelInsertCharFormat();
       
   623 			}
       
   624 		}
       
   625 	IRLOG_DEBUG( "CIRStationInfoContainer::DisplayStationLogoL - Exiting" );
       
   626 	}
       
   627 
       
   628 // ---------------------------------------------------------------------------
       
   629 // CIRStationInfoContainer::DisplayStationInfoL
       
   630 // Reads station info from preset and renders the text in the view
       
   631 // ---------------------------------------------------------------------------
       
   632 //
       
   633 void CIRStationInfoContainer::DisplayStationInfoL( TBool aIsLandscape )
       
   634 	{
       
   635 	IRLOG_DEBUG( "CIRStationInfoContainer::DisplayStationInfoL - Entering" );
       
   636 	CRichText* richText = iEditor->RichText();
       
   637 
       
   638 	// Horizontally Left Align
       
   639 	//
       
   640     TParaFormatMask paraFormatMask;
       
   641     CParaFormat *paraFormat = CParaFormat::NewL();
       
   642     CleanupStack::PushL( paraFormat );
       
   643 
       
   644     richText->GetParaFormatL( paraFormat, paraFormatMask, KRICHTEXT_ORIGIN, KRICHTEXT_LENGTH );
       
   645     paraFormatMask.SetAll();
       
   646 
       
   647 	paraFormat->iLineSpacingInTwips = KPARA_LINE_SPACING;
       
   648 	paraFormat->iSpaceAfterInTwips = KPARA_SPACING;
       
   649 	if( aIsLandscape && IsStationSupportsLogo() )		// Landscape with logo
       
   650 		{
       
   651 		paraFormat->iLeftMarginInTwips = KLEFT_MARGIN_LANDSCAPE_LOGO;
       
   652 		paraFormat->iRightMarginInTwips = KRIGHT_MARGIN_LANDSCAPE;
       
   653 		}
       
   654 	else if( aIsLandscape && !IsStationSupportsLogo() )	// Landscape without logo
       
   655 		{
       
   656 		paraFormat->iLeftMarginInTwips = KLEFT_MARGIN_LANDSCAPE_NOLOGO;
       
   657 		paraFormat->iRightMarginInTwips = KRIGHT_MARGIN_LANDSCAPE;
       
   658 		}
       
   659 	else // Potrait
       
   660 		{
       
   661 		paraFormat->iLeftMarginInTwips = KLEFT_MARGIN_POTRAIT;
       
   662 		paraFormat->iRightMarginInTwips = KRIGHT_MARGIN_POTRAIT;
       
   663 		}
       
   664 	paraFormat->iHorizontalAlignment = CParaFormat::ELeftAlign;
       
   665 	paraFormat->iKeepTogether = ETrue;
       
   666     richText->ApplyParaFormatL(paraFormat, paraFormatMask,
       
   667     						   richText->DocumentLength(), KRICHTEXT_LENGTH );
       
   668     CleanupStack::PopAndDestroy( paraFormat );
       
   669 
       
   670 	// charFormats for bold & bigger headings
       
   671 	//
       
   672 	TCharFormat cfOriginal;
       
   673 	TCharFormatMask formatMask;
       
   674 	richText->GetCharFormat( cfOriginal, formatMask, KRICHTEXT_ORIGIN, KRICHTEXT_LENGTH);
       
   675 	formatMask.SetAll();
       
   676 
       
   677     TCharFormat cfHeading = cfOriginal;
       
   678     cfHeading.iFontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
       
   679     cfHeading.iFontSpec.iHeight -= KHEADINGTEXT_HEIGHT_DECREMENT;
       
   680 
       
   681     TCharFormat cfMedium = cfOriginal;
       
   682     cfMedium.iFontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
       
   683     cfMedium.iFontSpec.iHeight -= KNORMALTEXT_HEIGHT_DECREMENT;
       
   684 
       
   685     TCharFormat cfNormal = cfOriginal;
       
   686     cfNormal.iFontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightNormal);
       
   687     cfNormal.iFontSpec.iHeight -= KNORMALTEXT_HEIGHT_DECREMENT;
       
   688 
       
   689 	//
       
   690 	// Read labels
       
   691 	//
       
   692     HBufC* stationNameLabel = StringLoader::LoadLC( R_IRAPP_STATIONINFO_NAME );
       
   693     HBufC* stationDescLabel = StringLoader::LoadLC( R_IRAPP_STATIONINFO_DESCRIPTION );
       
   694     HBufC* stationGenreLabel = StringLoader::LoadLC( R_IRAPP_STATIONINFO_GENRE );
       
   695     HBufC* stationLanguageLabel = StringLoader::LoadLC( R_IRAPP_STATIONINFO_LANGUAGE );
       
   696     HBufC* stationCountryLabel = StringLoader::LoadLC( R_IRAPP_STATIONINFO_COUNTRY );
       
   697     HBufC* stationTypeLabel = StringLoader::LoadLC( R_IRAPP_STATIONINFO_TYPE );
       
   698     HBufC* stationStreamLabel = StringLoader::LoadLC( R_IRAPP_STATIONINFO_STREAM );
       
   699     HBufC* stationTypeManual = StringLoader::LoadLC( R_IRAPP_STATIONINFO_TYPEMANUAL );
       
   700     HBufC* stationTypeIsds = StringLoader::LoadLC( R_IRAPP_STATIONINFO_TYPEISDS );
       
   701 
       
   702 	//
       
   703 	// Retrieve Station Information
       
   704 	//
       
   705 	CIRIsdsPreset* stationPreset = iStationInfoView->iStationPreset;
       
   706 	const TDesC&  stationName 		= stationPreset->GetName();
       
   707 	const TDesC&  stationDescription = stationPreset->GetDescription();
       
   708 	const TDesC&  stationGenre 		= stationPreset->GetGenreName();
       
   709 	const TDesC&  stationLang 		= stationPreset->GetLangName();
       
   710 	const TDesC&  stationCountry 	= stationPreset->GetCountryName();
       
   711 	TInt 		  stationType 		= stationPreset->GetChannelType();
       
   712 
       
   713 	// Add station name
       
   714 	richText->SetInsertCharFormatL(cfHeading, formatMask, richText->DocumentLength());
       
   715 	richText->InsertL( richText->DocumentLength(), *stationNameLabel);
       
   716 	richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   717 	richText->SetInsertCharFormatL(cfNormal, formatMask, richText->DocumentLength());
       
   718 
       
   719 	if( stationName.Length() )
       
   720 		{
       
   721 		richText->InsertL( richText->DocumentLength(), stationName);
       
   722 		}
       
   723 	else
       
   724 		{
       
   725 		HBufC* stationUnnamed = StringLoader::LoadLC( R_IRAPP_STATIONINFO_UNNAMED );
       
   726 		richText->InsertL( richText->DocumentLength(), *stationUnnamed);
       
   727 		CleanupStack::PopAndDestroy(stationUnnamed);
       
   728 		}
       
   729 	richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   730 
       
   731 	// Add station description
       
   732 	if( stationDescription.Length() )
       
   733 		{
       
   734 		richText->SetInsertCharFormatL(cfHeading, formatMask, richText->DocumentLength());
       
   735 		richText->InsertL( richText->DocumentLength(), *stationDescLabel);
       
   736 		richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   737 		richText->SetInsertCharFormatL(cfNormal, formatMask, richText->DocumentLength());
       
   738 		richText->InsertL( richText->DocumentLength(), stationDescription);
       
   739 		richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   740 		}
       
   741 
       
   742 	// Add station genre
       
   743 	if( stationGenre.Length() )
       
   744 		{
       
   745 		richText->SetInsertCharFormatL(cfHeading, formatMask, richText->DocumentLength());
       
   746 		richText->InsertL( richText->DocumentLength(), *stationGenreLabel);
       
   747 		richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   748 		richText->SetInsertCharFormatL(cfNormal, formatMask, richText->DocumentLength());
       
   749 		richText->InsertL( richText->DocumentLength(), stationGenre);
       
   750 		richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   751 		}
       
   752 
       
   753 	// Add station language
       
   754 	if( stationLang.Length() )
       
   755 		{
       
   756 		richText->SetInsertCharFormatL(cfHeading, formatMask, richText->DocumentLength());
       
   757 		richText->InsertL( richText->DocumentLength(), *stationLanguageLabel);
       
   758 		richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   759 		richText->SetInsertCharFormatL(cfNormal, formatMask, richText->DocumentLength());
       
   760 		richText->InsertL( richText->DocumentLength(), stationLang);
       
   761 		richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   762 		}
       
   763 
       
   764 	// Add station country
       
   765 	if( stationCountry.Length() )
       
   766 		{
       
   767 		richText->SetInsertCharFormatL(cfHeading, formatMask, richText->DocumentLength());
       
   768 		richText->InsertL( richText->DocumentLength(), *stationCountryLabel);
       
   769 		richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   770 		richText->SetInsertCharFormatL(cfNormal, formatMask, richText->DocumentLength());
       
   771 		richText->InsertL( richText->DocumentLength(), stationCountry);
       
   772 		richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   773 		}
       
   774 
       
   775 	// Station Type
       
   776 	richText->SetInsertCharFormatL(cfHeading, formatMask, richText->DocumentLength());
       
   777 	richText->InsertL( richText->DocumentLength(), *stationTypeLabel);
       
   778 	richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   779 
       
   780 	richText->SetInsertCharFormatL(cfNormal, formatMask, richText->DocumentLength());
       
   781 	if ( stationType == KSI_ISDS_DEFINED )
       
   782 		{
       
   783 		richText->InsertL( richText->DocumentLength(), *stationTypeIsds);
       
   784 		}
       
   785 	else
       
   786 		{
       
   787 		richText->InsertL( richText->DocumentLength(), *stationTypeManual);
       
   788 		}
       
   789 	richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   790 
       
   791 	//
       
   792 	// Station Bitrates and Urls
       
   793 	//
       
   794 	if( stationPreset->GetUrlCount() > KZero )
       
   795 		{
       
   796 		richText->SetInsertCharFormatL(cfHeading, formatMask, richText->DocumentLength());
       
   797 		richText->InsertL( richText->DocumentLength(), *stationStreamLabel);
       
   798 		richText->SetInsertCharFormatL(cfNormal, formatMask, richText->DocumentLength());
       
   799 		}
       
   800 
       
   801 	// for ISDS channels
       
   802 	RArray<TInt>	channelBitrates;
       
   803 	stationPreset->GetAvailableBitrates( channelBitrates );
       
   804 	CleanupClosePushL( channelBitrates );
       
   805 
       
   806 	for(TInt bitrateCounter = 0;
       
   807 		stationType == KSI_ISDS_DEFINED && bitrateCounter < channelBitrates.Count();
       
   808 		++bitrateCounter)
       
   809 		{
       
   810 		HBufC *bitrateText = StringLoader::LoadLC(
       
   811 				R_IRAPP_STATIONINFO_BITRATE, channelBitrates[bitrateCounter] );
       
   812 		TBuf<KBufferSize> bitRate;
       
   813 		bitRate.Append(*bitrateText);
       
   814 		CleanupStack::PopAndDestroy(bitrateText);
       
   815 		bitRate.Append(Kspace);
       
   816 
       
   817 		richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   818 		richText->InsertL( richText->DocumentLength(), bitRate );
       
   819 
       
   820 		CDesCArrayFlat* pUrlsForBitrate = stationPreset->
       
   821 										GetExactUrlForBitrateL( channelBitrates[bitrateCounter] );
       
   822 		CleanupStack::PushL( pUrlsForBitrate );
       
   823 
       
   824 		for(TInt urlCounter = 0; urlCounter < pUrlsForBitrate->Count(); ++urlCounter)
       
   825 			{
       
   826 			HBufC* url = (*pUrlsForBitrate)[urlCounter].AllocLC();
       
   827 
       
   828 			TInt index =url->Des().Find(KHttp);
       
   829 			if(index!=KErrNotFound)
       
   830 				{
       
   831 				url->Des().Delete(index,KHttpLength);
       
   832 				}
       
   833 
       
   834 			richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   835 			richText->InsertL( richText->DocumentLength(), *url );
       
   836 
       
   837 			CleanupStack::PopAndDestroy(url);
       
   838 			}
       
   839 		CleanupStack::PopAndDestroy( pUrlsForBitrate );
       
   840 		}
       
   841 	CleanupStack::PopAndDestroy( &channelBitrates );
       
   842 
       
   843 	// for User Defined channel
       
   844 	if( stationType == KSI_USERDEFINED && stationPreset->GetUrlCount() > 0 )
       
   845 		{
       
   846 		richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   847 
       
   848 		HBufC* url = stationPreset->GetChannelUrlAtL(0).AllocLC();
       
   849 
       
   850 		TInt index =url->Des().Find(KHttp);
       
   851 		if(index!=KErrNotFound)
       
   852 			{
       
   853 			url->Des().Delete(index,KHttpLength);
       
   854 			}
       
   855 		richText->InsertL( richText->DocumentLength(), *url );
       
   856 		CleanupStack::PopAndDestroy(url);
       
   857 		}
       
   858 
       
   859 	// Cleanup String labels
       
   860     CleanupStack::PopAndDestroy(stationTypeIsds);
       
   861     CleanupStack::PopAndDestroy(stationTypeManual);
       
   862 	CleanupStack::PopAndDestroy(stationStreamLabel);
       
   863     CleanupStack::PopAndDestroy(stationTypeLabel);
       
   864     CleanupStack::PopAndDestroy(stationCountryLabel);
       
   865     CleanupStack::PopAndDestroy(stationLanguageLabel);
       
   866     CleanupStack::PopAndDestroy(stationGenreLabel);
       
   867     CleanupStack::PopAndDestroy(stationDescLabel);
       
   868     CleanupStack::PopAndDestroy(stationNameLabel);
       
   869 
       
   870 	richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   871 
       
   872 	TRect   rectParent = Rect();
       
   873 	if ( IsStationSupportsLogo() && rectParent.Height() >= rectParent.Width() )
       
   874 		{
       
   875 		richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   876 		richText->InsertL( richText->DocumentLength(), CEditableText::ELineBreak);
       
   877 		richText->InsertL( richText->DocumentLength(), CEditableText::ELineBreak);
       
   878 		richText->InsertL( richText->DocumentLength(), CEditableText::ELineBreak);
       
   879 		richText->InsertL( richText->DocumentLength(), CEditableText::ELineBreak);
       
   880 		richText->InsertL( richText->DocumentLength(), CEditableText::ELineBreak);
       
   881 		richText->InsertL( richText->DocumentLength(), CEditableText::ELineBreak);
       
   882 		richText->InsertL( richText->DocumentLength(), CEditableText::EParagraphDelimiter);
       
   883 		}
       
   884 
       
   885 	richText->CancelInsertCharFormat();
       
   886 
       
   887     IRLOG_DEBUG( "CIRStationInfoContainer::DisplayStationInfoL - Exiting" );
       
   888 	}
       
   889 
       
   890 // ---------------------------------------------------------
       
   891 // CIRStationInfoContainer::CreateRichTextDataL
       
   892 // Initializes the rich text with font, color, anti-aliasing
       
   893 // ---------------------------------------------------------
       
   894 //
       
   895 void CIRStationInfoContainer::CreateRichTextDataL()
       
   896     {
       
   897     IRLOG_DEBUG( "CIRStationInfoContainer::CreateRichTextData - Entering" );
       
   898     TCharFormat charFormat;
       
   899     TCharFormatMask formatMask;
       
   900     iEditor->RichText()->GetCharFormat( charFormat, formatMask, 0, 0 );
       
   901 
       
   902 	TRgb textColor;
       
   903     TInt error = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), textColor,
       
   904         									KAknsIIDQsnTextColors,EAknsCIQsnTextColorsCG6 );
       
   905     if ( error != KErrNone )
       
   906         {
       
   907         textColor = KRgbBlack;
       
   908         }
       
   909 
       
   910     charFormat.iFontPresentation.iTextColor = textColor;
       
   911 	charFormat.iFontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
       
   912     formatMask.SetAll();
       
   913 
       
   914 	CCharFormatLayer* globalCharLayer = NULL;
       
   915     globalCharLayer = CCharFormatLayer::NewL( charFormat, formatMask );
       
   916     CleanupStack::PushL( globalCharLayer );
       
   917 
       
   918     iEditor->SetCharFormatLayer( globalCharLayer );
       
   919 
       
   920     CleanupStack::Pop(globalCharLayer);
       
   921     IRLOG_DEBUG( "CIRStationInfoContainer::CreateRichTextData - Exiting" );
       
   922     }
       
   923 
       
   924 
       
   925 // ----------------------------------------------------------------------------------------
       
   926 // CIRStationInfoContainer::HandleResourceChange
       
   927 // From base class CCoeControl
       
   928 // Handles a change to the control's resources like background drawing and S60 skin changes
       
   929 //
       
   930 // ----------------------------------------------------------------------------------------
       
   931 void CIRStationInfoContainer::HandleResourceChange( TInt aType )
       
   932     {
       
   933     IRLOG_DEBUG( "CIRStationInfoContainer::HandleResourceChange - Entering" );
       
   934     CCoeControl::HandleResourceChange( aType );
       
   935 
       
   936     if( aType == KEikDynamicLayoutVariantSwitch )
       
   937         {
       
   938 		TRect rect;
       
   939 		TBool bRes = AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
       
   940 		SetRect(rect);
       
   941 
       
   942         iEditor->HandleResourceChange( aType );
       
   943         iEditorLogo->HandleResourceChange( aType );
       
   944 
       
   945         if ( iBgContext )
       
   946             {
       
   947             iBgContext->SetRect( Rect() );
       
   948             }
       
   949         }
       
   950     else if( ( aType == KAknsMessageSkinChange ) && ( iBgContext ) )
       
   951         {
       
   952         TRAPD( ignore, iEditor->SetSkinBackgroundControlContextL( iBgContext ) );
       
   953         if( ignore )
       
   954             {
       
   955             ignore = KErrNone; //Prevent ARMV5 compilation varning
       
   956             }
       
   957 		TRAPD( err, ReloadStationInformationL() );
       
   958 		if(err != KErrNone)
       
   959 			{
       
   960 			IRLOG_WARNING( "CIRStationInfoContainer::SizeChanged - ReloadStationInformationL() failed" );
       
   961 			}
       
   962         }
       
   963     IRLOG_DEBUG( "CIRStationInfoContainer::HandleResourceChange - Exiting" );
       
   964     }
       
   965 
       
   966 // ----------------------------------------------------
       
   967 // CIRStationInfoContainer::IsStationSupportsLogo
       
   968 // Returns true if station logo available, else false.
       
   969 // ----------------------------------------------------
       
   970 //
       
   971 TBool CIRStationInfoContainer::IsStationSupportsLogo()
       
   972 {
       
   973 	IRLOG_DEBUG( "CIRStationInfoContainer::IsStationSupportsLogo" );
       
   974 	return ( iStationInfoView->iStationPreset
       
   975 			 && iStationInfoView->iStationPreset->GetImgUrl().Length() );
       
   976 }
       
   977 
       
   978 
       
   979 // ------------------------------------------------------------
       
   980 // CIRStationInfoContainer::IsISDSStation
       
   981 // Returns true if station is from ISDS, false if user-defined.
       
   982 // ------------------------------------------------------------
       
   983 //
       
   984 TBool CIRStationInfoContainer::IsISDSStation()
       
   985 {
       
   986 	IRLOG_DEBUG( "CIRStationInfoContainer::IsISDSStation " );
       
   987 	return ( iStationInfoView->iStationPreset->GetChannelType() == CIRIsdsPreset::EIsdsPreset );
       
   988 }