logsui/AppSrc/CLogsBaseControlContainer.cpp
changeset 0 e686773b3f54
child 21 9da50d567e3c
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002 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 *     Logs Application view control container superclass
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <AknIconArray.h>
       
    22 #include <gulicon.h>    // CGulIcon
       
    23 #include <barsread.h>   // resource reader
       
    24 #include <akntitle.h>   // Title
       
    25 #include <aknnavide.h>  // CAknNavigationDecorator
       
    26 #include <AknsConstants.h>
       
    27 #include <AknsUtils.h>
       
    28 #include <data_caging_path_literals.hrh>  //KDC_APP_BITMAP_DIR and KDC_SHARED_LIB_DIR
       
    29 #include <akncontext.h>  
       
    30 #include <AknDef.h>   //KEikDynamicLayoutVariantSwitch
       
    31 #include <StringLoader.h>
       
    32 #include <Logs.rsg>
       
    33 
       
    34 #include "CLogsBaseControlContainer.h"
       
    35 #include "MLogsKeyProcessor.h"
       
    36 
       
    37 #include "LogsConstants.hrh"    // Global constants.
       
    38 
       
    39 #include "MLogsNaviDecoratorWrapper.h"
       
    40 
       
    41 // EXTERNAL DATA STRUCTURES
       
    42 
       
    43 // EXTERNAL FUNCTION PROTOTYPES  
       
    44 
       
    45 // CONSTANTS
       
    46 
       
    47 // MACROS
       
    48 
       
    49 // LOCAL CONSTANTS AND MACROS
       
    50 
       
    51 // MODULE DATA STRUCTURES
       
    52 
       
    53 // LOCAL FUNCTION PROTOTYPES
       
    54 
       
    55 // ==================== LOCAL FUNCTIONS ====================
       
    56 
       
    57 // ================= MEMBER FUNCTIONS =======================
       
    58 
       
    59 // ----------------------------------------------------------------------------
       
    60 // CLogsBaseControlContainer::CLogsBaseControlContainer
       
    61 // ----------------------------------------------------------------------------
       
    62 //
       
    63 CLogsBaseControlContainer::CLogsBaseControlContainer( 
       
    64     MLogsKeyProcessor* aKeyProcessor ):
       
    65     iKeyProcessor( aKeyProcessor )
       
    66     {
       
    67     }
       
    68 
       
    69 // ----------------------------------------------------------------------------
       
    70 // CLogsBaseControlContainer::CLogsBaseControlContainer
       
    71 // ----------------------------------------------------------------------------
       
    72 //
       
    73 CLogsBaseControlContainer::CLogsBaseControlContainer()
       
    74     {
       
    75     }
       
    76    
       
    77 // ----------------------------------------------------------------------------
       
    78 // CLogsBaseControlContainer::~CLogsBaseControlContainer
       
    79 // ----------------------------------------------------------------------------
       
    80 //
       
    81 CLogsBaseControlContainer::~CLogsBaseControlContainer()
       
    82     {
       
    83 	//delete iLongTapDetector; 
       
    84     }
       
    85  
       
    86 // ----------------------------------------------------------------------------
       
    87 // CLogsBaseControlContainer::BaseConstructL
       
    88 // ----------------------------------------------------------------------------
       
    89 //
       
    90 void CLogsBaseControlContainer::BaseConstructL()
       
    91     {
       
    92     CreateWindowL();    
       
    93     
       
    94 	//iLongTapDetector = CAknLongTapDetector::NewL( this ); 
       
    95     }
       
    96     
       
    97 // ----------------------------------------------------------------------------
       
    98 // CLogsBaseControlContainer::MakeTitleL
       
    99 //
       
   100 // Makes the title of the view
       
   101 // ----------------------------------------------------------------------------
       
   102 //
       
   103 void CLogsBaseControlContainer::MakeTitleL( TInt aResourceText )
       
   104     {
       
   105     TResourceReader reader;
       
   106     iCoeEnv->CreateResourceReaderLC( reader, aResourceText );
       
   107     CAknTitlePane* title = static_cast<CAknTitlePane*>( StatusPane()->
       
   108                             ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
       
   109     title->SetFromResourceL( reader );
       
   110     CleanupStack::PopAndDestroy();  // reader
       
   111     }
       
   112     
       
   113 // ----------------------------------------------------------------------------
       
   114 // CLogsBaseControlContainer::MakeTitleL
       
   115 // ----------------------------------------------------------------------------
       
   116 //
       
   117 void CLogsBaseControlContainer::MakeTitleL( const TDesC& aText )
       
   118     {
       
   119     CAknTitlePane* title = static_cast<CAknTitlePane*>( StatusPane()->
       
   120                             ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
       
   121     title->SetTextL( aText );
       
   122     }
       
   123 
       
   124 // ----------------------------------------------------------------------------
       
   125 // CLogsBaseControlContainer::SetTitlePaneTextToDefaultL
       
   126 // ----------------------------------------------------------------------------
       
   127 //
       
   128 void CLogsBaseControlContainer::SetTitlePaneTextToDefaultL(TLogsViewIds aViewId)
       
   129     {
       
   130     //  Well handle the Logs recent calls views and the Log view here.
       
   131     switch( aViewId )
       
   132         {
       
   133         case EStmMissedListViewId:
       
   134             MakeTitleL( R_STM_TITLE_TEXT_MISSED );                       
       
   135             break;
       
   136 
       
   137         case EStmReceivedListViewId:
       
   138             MakeTitleL( R_STM_TITLE_TEXT_RECEIVED );
       
   139             break;
       
   140 
       
   141         case EStmDialledListViewId:
       
   142             MakeTitleL( R_STM_TITLE_TEXT_DIALLED );
       
   143             break;
       
   144             
       
   145         case ELogEventListViewId:    
       
   146             MakeTitleL( R_LOGS_TITLE_TEXT );
       
   147             break;
       
   148             
       
   149         default:
       
   150             {
       
   151             // not needed for other views.
       
   152             break;
       
   153             }
       
   154         }
       
   155     }
       
   156 
       
   157 
       
   158 
       
   159 // ----------------------------------------------------------------------------
       
   160 // CLogsBaseControlContainer::SetContextPanePictureToDefaultL
       
   161 //    
       
   162 // Restore original Logs icon back to Context Pane
       
   163 // ----------------------------------------------------------------------------
       
   164 //
       
   165 void CLogsBaseControlContainer::SetContextPanePictureToDefaultL()
       
   166     {
       
   167     CCoeControl* ctrl  = StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidContext ) );
       
   168     CAknContextPane* ctx = static_cast<CAknContextPane*>( ctrl );
       
   169     ctx->SetPictureToDefaultL();
       
   170     }
       
   171 
       
   172 // ----------------------------------------------------------------------------
       
   173 // CLogsBaseControlContainer::StatusPane
       
   174 // ----------------------------------------------------------------------------
       
   175 //
       
   176 CEikStatusPane* CLogsBaseControlContainer::StatusPane()
       
   177     {
       
   178     return iEikonEnv->AppUiFactory()->StatusPane();
       
   179     }
       
   180 
       
   181 // ----------------------------------------------------------------------------
       
   182 // CLogsBaseControlContainer::NaviPaneL
       
   183 // ----------------------------------------------------------------------------
       
   184 //
       
   185 CAknNavigationControlContainer* CLogsBaseControlContainer::NaviPaneL()
       
   186     {
       
   187     return static_cast<CAknNavigationControlContainer*>( StatusPane()->
       
   188                     ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) );
       
   189     }
       
   190 
       
   191 // ----------------------------------------------------------------------------
       
   192 // CLogsBaseControlContainer::NavigationTabGroupL
       
   193 //
       
   194 // Creates navigation tab group 
       
   195 // ----------------------------------------------------------------------------
       
   196 //
       
   197 CAknNavigationDecorator* CLogsBaseControlContainer::NavigationTabGroupL( TInt aResource, 
       
   198                                                                          MLogsNaviDecoratorWrapper*  aNaviDecoratorWrapper )
       
   199     {
       
   200     CAknNavigationDecorator* naviDecorator = NULL;
       
   201     naviDecorator = aNaviDecoratorWrapper->GetNaviDecoratorL(NaviPaneL(),
       
   202                                                              iKeyProcessor->TabObserver(),
       
   203                                                              aResource);                                                         
       
   204     return naviDecorator;
       
   205     }
       
   206 
       
   207 // ----------------------------------------------------------------------------
       
   208 // CLogsBaseControlContainer::OfferKeyEventL
       
   209 //
       
   210 // Called by framework (CCoeControlStack) when a key press happens. This function offers the key press 
       
   211 // further to subclass for processing.
       
   212 // ----------------------------------------------------------------------------
       
   213 //
       
   214 TKeyResponse CLogsBaseControlContainer::OfferKeyEventL( 
       
   215     const TKeyEvent& aKeyEvent,
       
   216     TEventCode aType )
       
   217     {
       
   218     CAknNavigationDecorator* decoratedTabGroup = NULL;
       
   219     decoratedTabGroup = NaviPaneL()->Top();
       
   220     TKeyResponse keyResponse = EKeyWasNotConsumed;
       
   221 
       
   222     //Check first is this keypress intended for changing the view using left/right key
       
   223     if (decoratedTabGroup && 
       
   224         decoratedTabGroup->ControlType() == CAknNavigationDecorator::ETabGroup)
       
   225         {
       
   226         keyResponse = decoratedTabGroup->DecoratedControl()->OfferKeyEventL( aKeyEvent, aType );
       
   227         }
       
   228 
       
   229     //If not, then offer this to subclass for possible processing (e.g. press of Send key to make a call)
       
   230     if( (keyResponse == EKeyWasNotConsumed) && iKeyProcessor )
       
   231         {
       
   232         if( iKeyProcessor->ProcessKeyEventL( aKeyEvent, aType ) )
       
   233             {
       
   234             return EKeyWasConsumed;
       
   235             }
       
   236         }
       
   237 
       
   238     return ComponentControl( 0 )->OfferKeyEventL( aKeyEvent, aType );
       
   239     }
       
   240 
       
   241 
       
   242 // *** Long tap detection disabled ***
       
   243 // ----------------------------------------------------------------------------
       
   244 // CLogsBaseControlContainer::HandleLongTapEventL
       
   245 //
       
   246 // Default callback function for the Avkon CAknLongTapDetector object.
       
   247 // Pointer events are passed to the long tap detector (see HandlePointerEventL below)
       
   248 // and the callback is initiated when it detects a long tap. 
       
   249 // 
       
   250 // ----------------------------------------------------------------------------
       
   251 //void CLogsBaseControlContainer::HandleLongTapEventL( const TPoint& /* aPenEventLocation */, 
       
   252 //                            	  					 const TPoint& /* aPenEventScreenLocation */ )
       
   253 //{
       
   254 // By default do nothing. Subclasses override this if special functionality is needed.
       
   255 // }
       
   256 
       
   257 // ----------------------------------------------------------------------------
       
   258 // CLogsBaseControlContainer::ListBox
       
   259 //
       
   260 // Default implementation returns NULL. 
       
   261 // ----------------------------------------------------------------------------
       
   262 //
       
   263 CEikListBox* CLogsBaseControlContainer::ListBox()
       
   264     {
       
   265   	return NULL;
       
   266     }
       
   267 
       
   268 // *** Pointer event handling disabled ****
       
   269 // Touch support implemented in CLogsBaseView::HandleListBoxEventL instead.
       
   270 //
       
   271 // In case long tap event handling is needed in Logs, we need to catch only them
       
   272 // here and just forward the pointer events to the listbox instances. 
       
   273 // 
       
   274 // In case the long tap functionality is needed in just some specific view. 
       
   275 // implement HandlePointerEventL in that view only.
       
   276 // 
       
   277 //----------------------------------------------------------------------------
       
   278 // CLogsBaseControlContainer::HandlePointerEventL
       
   279 //
       
   280 // Called by framework (CCoeControlStack) when a pointer event happens (touch ui).
       
   281 // ----------------------------------------------------------------------------
       
   282 //
       
   283 	/*
       
   284 void CLogsBaseControlContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent)
       
   285 	{
       
   286 	
       
   287 	if (!iLongTapDetector)
       
   288 		{
       
   289 		iLongTapDetector = CAknLongTapDetector::NewL( this );
       
   290 		}
       
   291 		
       
   292 	if (AknLayoutUtils::PenEnabled())
       
   293 		{
       
   294 		// Get a reference to the correct listbox
       
   295 		CEikListBox* listbox = ListBox(); // calls the actual subclass implementation
       
   296 		
       
   297     	// Pass event to the LongTapDetector
       
   298     	// Long tap detector not needed in Logs at the moment
       
   299     	// For possible future needs we just comment out the line below 
       
   300 	  	//iLongTapDetector->PointerEventL( aPointerEvent ); 
       
   301 	  	
       
   302 		switch (aPointerEvent.iType)
       
   303 			{
       
   304 			case TPointerEvent::EButton1Down:
       
   305 				// Get the index of the current item (note: before the possible focus change)
       
   306 				iLastIndex = listbox->CurrentItemIndex();
       
   307  				// Pass event to the listbox - handles selection and moves focus 
       
   308  				// to correct item 
       
   309 				listbox->HandlePointerEventL(aPointerEvent);
       
   310 				break;
       
   311 			
       
   312 			case TPointerEvent::EDrag:
       
   313 				// Pass EDrag to the listbox to handle scrolling
       
   314 				listbox->HandlePointerEventL(aPointerEvent);
       
   315 				// If dragging resulted on focus change, set iDrag true
       
   316 				if ( iLastIndex != listbox->CurrentItemIndex())
       
   317 				    {
       
   318 				    iDrag = ETrue;
       
   319 				    }			    
       
   320 				break;
       
   321 				
       
   322 			case TPointerEvent::EButton1Up:	
       
   323 			    // If current view wants a single tap to perform the 
       
   324 			    // same as double tap. Currently this is needed in Logs
       
   325 			    // Detail view where there is no focus and a single tap
       
   326 			    // opens contex sensitive menu
       
   327                 iKeyProcessor->FocusChangedL();			    
       
   328                 
       
   329 			    if (iSingleTapActivates)
       
   330 			        {
       
   331 			        iKeyProcessor->ProcessPointerEventL(iLastIndex);
       
   332 			        }
       
   333 
       
   334 				// Check if the current focused item was tapped (second tap)
       
   335 				// and call the views ProcessPointerEventL  
       
   336 				else if (iLastIndex == listbox->CurrentItemIndex() && iDrag == EFalse)
       
   337 					{
       
   338 					iKeyProcessor->ProcessPointerEventL(iLastIndex);
       
   339 					}
       
   340 				// If dragging happened, we don't call the event processor, but just 
       
   341 			    else if ( iDrag )
       
   342 			        {
       
   343 			        iLastIndex = listbox->CurrentItemIndex();
       
   344 			        iDrag = EFalse;
       
   345 			        }
       
   346 				break;
       
   347 
       
   348 			default:
       
   349 				break;
       
   350 		
       
   351 			}	
       
   352 				
       
   353 		CCoeControl::HandlePointerEventL(aPointerEvent);
       
   354 		}
       
   355 	}*/
       
   356 		
       
   357 // ----------------------------------------------------------------------------
       
   358 // CLogsBaseControlContainer::HandleControlEventL
       
   359 //
       
   360 // Dummy HandleControlEventL
       
   361 // ----------------------------------------------------------------------------
       
   362 //
       
   363 void CLogsBaseControlContainer::HandleControlEventL(
       
   364     CCoeControl* /*aControl*/,
       
   365     TCoeEvent /*aEventType*/ )
       
   366     {
       
   367     }
       
   368 
       
   369 // ----------------------------------------------------------------------------
       
   370 // CLogsBaseControlContainer::CountComponentControls
       
   371 //
       
   372 // Returns the count of child controls
       
   373 // ----------------------------------------------------------------------------
       
   374 //
       
   375 TInt CLogsBaseControlContainer::CountComponentControls() const
       
   376     {
       
   377     return 1;
       
   378     }
       
   379 
       
   380 // ----------------------------------------------------------------------------
       
   381 // CLogsBaseControlContainer::AddColorIconL
       
   382 //
       
   383 // Adds color icon based on default path to the icon file.
       
   384 // Used for D-column icons to fix error JPYO-76PDP9.
       
   385 // ----------------------------------------------------------------------------
       
   386 //
       
   387 void CLogsBaseControlContainer::AddColorIconL(
       
   388     CAknIconArray* aIcons,
       
   389     const TDesC& aIconFile,   //File name without path
       
   390     TAknsItemID aSkinnedIcon,
       
   391     TInt aIconGraphicsIndex,
       
   392     TInt aIconGraphicsMaskIndex )
       
   393     {
       
   394     // Set up filenames for Logs and Avkon bitmaps
       
   395     TFileName iconFileWithPath;
       
   396     iconFileWithPath += KLogsIconFileDrive;
       
   397 
       
   398     iconFileWithPath += KDC_APP_BITMAP_DIR;          //Directory in new secure builds 
       
   399 
       
   400     iconFileWithPath += aIconFile;  
       
   401 
       
   402     MAknsSkinInstance* skin = AknsUtils::SkinInstance();  //AknsUtils.h
       
   403     CFbsBitmap* bitmap;
       
   404     CFbsBitmap* mask;
       
   405     AknsUtils::CreateColorIconL( skin, aSkinnedIcon,
       
   406                                 KAknsIIDQsnIconColors,EAknsCIQsnIconColorsCG13,
       
   407                                 bitmap, mask, 
       
   408                                 iconFileWithPath, aIconGraphicsIndex, 
       
   409                                 aIconGraphicsMaskIndex, KRgbBlack  );
       
   410     CleanupStack::PushL( bitmap );  //Ownership here
       
   411     CleanupStack::PushL( mask );    //Ownership here
       
   412 
       
   413     // Append it to icons array
       
   414     CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
       
   415     CleanupStack::Pop( 2 );         // mask, bitmap. icon has now ownership
       
   416     CleanupStack::PushL( icon );
       
   417     aIcons->AppendL( icon );
       
   418     CleanupStack::Pop( ); // icon
       
   419     }
       
   420     
       
   421 // ----------------------------------------------------------------------------
       
   422 // CLogsBaseControlContainer::AddIconL
       
   423 //
       
   424 // Adds icon based on default path to the icon file
       
   425 // ----------------------------------------------------------------------------
       
   426 //
       
   427 void CLogsBaseControlContainer::AddIconL(
       
   428     CAknIconArray* aIcons,
       
   429     const TDesC& aIconFile,   //File name without path
       
   430     TAknsItemID aSkinnedIcon,
       
   431     TInt aIconGraphicsIndex,
       
   432     TInt aIconGraphicsMaskIndex )
       
   433     {
       
   434     // Set up filenames for Logs and Avkon bitmaps
       
   435     TFileName iconFileWithPath;
       
   436     iconFileWithPath += KLogsIconFileDrive;
       
   437 
       
   438     iconFileWithPath += KDC_APP_BITMAP_DIR;          //Directory in new secure builds 
       
   439 
       
   440     iconFileWithPath += aIconFile;  
       
   441 
       
   442     AddIconWithPathL(   aIcons,
       
   443                 iconFileWithPath,
       
   444                 aSkinnedIcon,
       
   445                 aIconGraphicsIndex,
       
   446                 aIconGraphicsMaskIndex );
       
   447     }
       
   448 
       
   449 // ----------------------------------------------------------------------------
       
   450 // CLogsBaseControlContainer::AddIconWithPathL
       
   451 //
       
   452 // Adds icon based on full path to the icon file
       
   453 // ----------------------------------------------------------------------------
       
   454 //
       
   455 void CLogsBaseControlContainer::AddIconWithPathL(
       
   456     CAknIconArray* aIcons,
       
   457     const TDesC& aIconFileWithPath,   //File name with full path
       
   458     TAknsItemID aSkinnedIcon,
       
   459     TInt aIconGraphicsIndex,
       
   460     TInt aIconGraphicsMaskIndex )
       
   461     {
       
   462 
       
   463     MAknsSkinInstance* skin = AknsUtils::SkinInstance();  //AknsUtils.h
       
   464     CFbsBitmap* bitmap;
       
   465     CFbsBitmap* mask;
       
   466     AknsUtils::CreateIconL( skin, aSkinnedIcon, bitmap, mask, 
       
   467                             aIconFileWithPath, aIconGraphicsIndex, 
       
   468                             aIconGraphicsMaskIndex );
       
   469     CleanupStack::PushL( bitmap );  //Ownership here
       
   470     CleanupStack::PushL( mask );    //Ownership here
       
   471 
       
   472     // Append it to icons array
       
   473     CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
       
   474     CleanupStack::Pop( 2 );         // mask, bitmap. icon has now ownership
       
   475     CleanupStack::PushL( icon );
       
   476     aIcons->AppendL( icon );
       
   477     CleanupStack::Pop( ); // icon
       
   478     }
       
   479 
       
   480 // ----------------------------------------------------------------------------
       
   481 // CLogsBaseControlContainer::MakeListBoxLineL
       
   482 //
       
   483 // Makes views one line with the given information
       
   484 // ----------------------------------------------------------------------------
       
   485 //
       
   486 void CLogsBaseControlContainer::MakeListBoxLineL(
       
   487     CDesCArrayFlat* aItems,
       
   488     const TDesC& aText,
       
   489     TInt aResourceText,
       
   490     const TDesC& aSecondLineText )
       
   491     {
       
   492     // Place where to put text to display
       
   493     HBufC* textBuf = HBufC::NewLC( KLogsBuff128 ); 
       
   494 
       
   495     // temporary place for the resource texts
       
   496     HBufC* textFromResourceFile;
       
   497 
       
   498     textBuf->Des().Format( aText );  // First icon & tab
       
   499     textFromResourceFile = iCoeEnv->AllocReadResourceLC( aResourceText );
       
   500     textBuf->Des().AppendFormat( *textFromResourceFile );
       
   501     textBuf->Des().AppendFormat( KTab );
       
   502     textBuf->Des().AppendFormat( aSecondLineText );
       
   503 
       
   504     aItems->AppendL( *textBuf );
       
   505     CleanupStack::PopAndDestroy( 2 );  // textFromResourceFile. textBuf
       
   506     }
       
   507 
       
   508 // ----------------------------------------------------------------------------
       
   509 // CLogsBaseControlContainer::MakeEmptyTextListBoxL
       
   510 // ----------------------------------------------------------------------------
       
   511 //
       
   512 void CLogsBaseControlContainer::MakeEmptyTextListBoxL(
       
   513     CEikListBox* aListBox,
       
   514     TInt aResourceText )
       
   515     {
       
   516     if( aResourceText == KErrNotFound )
       
   517         {
       
   518         //When reader deleted / not active, don't show any misleading texts when
       
   519         //list is empty
       
   520         aListBox->View()->SetListEmptyTextL( KNullDesC );            
       
   521         }
       
   522     else if (aResourceText == R_QTN_LOGS_LOGGING_OFF)    
       
   523         {
       
   524         HBufC* loggingOffText;
       
   525         loggingOffText = MakeNoLogTextLC();
       
   526         // If log duration is set to "no log", show informative text
       
   527         aListBox->View()->SetListEmptyTextL( *loggingOffText );
       
   528         CleanupStack::Pop(); // loggingOffText.
       
   529         delete loggingOffText;
       
   530         }   
       
   531     else
       
   532         {
       
   533         HBufC* textFromResourceFile;
       
   534         textFromResourceFile = iCoeEnv->AllocReadResourceLC( aResourceText );
       
   535         // Set the view's listbox empty text.
       
   536         aListBox->View()->SetListEmptyTextL( *textFromResourceFile );
       
   537         CleanupStack::PopAndDestroy();  // textFromResourceFile.        
       
   538         }
       
   539 
       
   540     //Set rect to draw just a smaller part of screen only.    
       
   541     // TRect rect;
       
   542     // AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect );
       
   543     // SetRect( rect );
       
   544     // DrawNow();  //This contributes to flickering in certain cases and seems to be unnecessary too
       
   545     }
       
   546 
       
   547 // ----------------------------------------------------------------------------
       
   548 // CLogsBaseControlContainer::MakeNoLogTextL
       
   549 // ----------------------------------------------------------------------------
       
   550 //
       
   551 HBufC* CLogsBaseControlContainer::MakeNoLogTextLC(void)
       
   552     {
       
   553     HBufC* text = NULL;  
       
   554     
       
   555     // Read primary text        
       
   556     text = StringLoader::LoadLC( R_QTN_LOGS_LOGGING_OFF );
       
   557 
       
   558     // Append secondary text           
       
   559     _LIT( KNewline, "\n" );
       
   560     HBufC* secondaryText = StringLoader::LoadLC( R_QTN_LOGS_LOGGING_OFF_SECONDARY );
       
   561     TInt newLength = text->Length()
       
   562                    + KNewline().Length()
       
   563                    + secondaryText->Length();
       
   564     text = text->ReAllocL( newLength );
       
   565     TPtr ptr = text->Des();
       
   566     ptr.Append( KNewline );
       
   567     ptr.Append( *secondaryText );
       
   568     
       
   569     CleanupStack::PopAndDestroy( secondaryText );
       
   570     
       
   571     return text;
       
   572     }
       
   573          
       
   574 // ----------------------------------------------------------------------------
       
   575 // CLogsBaseControlContainer::MakeScrollArrowsL
       
   576 // ----------------------------------------------------------------------------
       
   577 //
       
   578 void CLogsBaseControlContainer::MakeScrollArrowsL( CEikListBox* aListBox )
       
   579     {
       
   580     // functions for scrollbars
       
   581     CEikScrollBarFrame* sBFrame = aListBox->CreateScrollBarFrameL( ETrue );
       
   582     sBFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,    //no horisontal scrollbar
       
   583                                       CEikScrollBarFrame::EAuto ); //vertical
       
   584     }
       
   585 
       
   586 // ----------------------------------------------------------------------------
       
   587 // CLogsBaseControlContainer::HandleResourceChange
       
   588 // ----------------------------------------------------------------------------
       
   589 //
       
   590 void CLogsBaseControlContainer::HandleResourceChange( TInt aType )
       
   591     {
       
   592 	CCoeControl::HandleResourceChange(aType);    
       
   593 
       
   594     if( aType == KAknsMessageSkinChange )
       
   595         {
       
   596         //Basically there in this case should already be container controls loaded that
       
   597         //are first released in subclass's implementation of AddControlContainerIconsL. So we
       
   598         //should have the same memory available. However, if we would run out of memory, there's 
       
   599         //not so much we could do. So we'll just trap the possible leave.
       
   600         TInt err;
       
   601         TRAP( err, AddControlContainerIconsL() );
       
   602         if( err ) 
       
   603             {
       
   604             CCoeEnv::Static()->HandleError( err );
       
   605             }
       
   606             
       
   607         Window().Invalidate();
       
   608         }
       
   609 
       
   610     //Handle change in layout orientation
       
   611     if (aType == KEikDynamicLayoutVariantSwitch)
       
   612         {
       
   613 
       
   614         //TRect rect = iAvkonAppUi->ClientRect();
       
   615         // The line above provides too big rectangle in the bottom causing cba's overdrawn by blank area.
       
   616         // Correct way to do this is below.
       
   617         TRect mainPaneRect;
       
   618         AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
       
   619         SetRect(mainPaneRect);
       
   620 		DrawNow();
       
   621 		}
       
   622     }
       
   623 
       
   624 // ----------------------------------------------------------------------------
       
   625 // CLogsBaseControlContainer::AddControlContainerIconsL
       
   626 // ----------------------------------------------------------------------------
       
   627 //
       
   628 void CLogsBaseControlContainer::AddControlContainerIconsL()
       
   629     {
       
   630     return;
       
   631     }
       
   632 
       
   633 //  End of File