voicerecorder/RecViewSrc/CVRRecViewActivationContainer.cpp
branchRCL_3
changeset 21 c6bafb5162d8
parent 0 845549f293a7
equal deleted inserted replaced
20:072a5fa0c63b 21:c6bafb5162d8
       
     1 /*
       
     2 * Copyright (c) 2002 - 2006 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 *     An empty control that is displayed until application is fully
       
    16 *	  constructed
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include <AknDef.h> // For layout change event definitions
       
    24 #include <AknsUtils.h>
       
    25 #include <AknsDrawUtils.h>
       
    26 #include <AknsBasicBackgroundControlContext.h>
       
    27 
       
    28 #include "CVRRecViewActivationContainer.h"
       
    29 
       
    30 
       
    31 // ================= MEMBER FUNCTIONS ========================================
       
    32 
       
    33 // ---------------------------------------------------------------------------
       
    34 // CVRRecViewActivationContainer::CVRRecViewActivationContainer
       
    35 //
       
    36 // ---------------------------------------------------------------------------
       
    37 //
       
    38 CVRRecViewActivationContainer::CVRRecViewActivationContainer()
       
    39 	{
       
    40 	}
       
    41 
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // CVRRecViewActivationContainer::~CVRRecViewActivationContainer
       
    45 //
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 CVRRecViewActivationContainer::~CVRRecViewActivationContainer()
       
    49 	{
       
    50 	delete iBackgroundSkinContext;	
       
    51 	}
       
    52 
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 // CVRRecViewActivationContainer::ConstructL
       
    56 //
       
    57 // ---------------------------------------------------------------------------
       
    58 //
       
    59 void CVRRecViewActivationContainer::ConstructL( const TRect& aRect )
       
    60 	{
       
    61 	CreateWindowL();
       
    62 
       
    63 	// Get the skin instance
       
    64 	iSkinInstance = AknsUtils::SkinInstance();
       
    65 
       
    66 	// Create background control context for skinning the background
       
    67 	iBackgroundSkinContext = CAknsBasicBackgroundControlContext::NewL( 
       
    68 			KAknsIIDQsnBgAreaMain, aRect, ETrue );
       
    69 
       
    70     SetRect( aRect );
       
    71 	} 
       
    72 
       
    73 
       
    74 // ---------------------------------------------------------------------------
       
    75 // CVRRecViewActivationContainer::HandleResourceChange
       
    76 //
       
    77 // ---------------------------------------------------------------------------
       
    78 //
       
    79 void CVRRecViewActivationContainer::HandleResourceChange(TInt /*aType*/)
       
    80 	{
       
    81 	}
       
    82 
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 // CVRRecViewActivationContainer::CountComponentControls
       
    86 //
       
    87 // ---------------------------------------------------------------------------
       
    88 //
       
    89 TInt CVRRecViewActivationContainer::CountComponentControls() const
       
    90 	{
       
    91 	return 0;
       
    92 	}
       
    93 
       
    94 
       
    95 // ---------------------------------------------------------------------------
       
    96 // CVRRecViewActivationContainer::ComponentControl
       
    97 //
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 CCoeControl* CVRRecViewActivationContainer::ComponentControl( 
       
   101 													TInt /*aIndex*/ ) const
       
   102 	{
       
   103 	return NULL;
       
   104 	}
       
   105 
       
   106 
       
   107 
       
   108 // ---------------------------------------------------------------------------
       
   109 // CVRRecViewActivationContainer::OfferKeyEventL
       
   110 //
       
   111 // ---------------------------------------------------------------------------
       
   112 //
       
   113 TKeyResponse CVRRecViewActivationContainer::OfferKeyEventL( 
       
   114 		const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/ )
       
   115 	{
       
   116 	return EKeyWasNotConsumed;
       
   117 	}
       
   118 
       
   119 
       
   120 // ---------------------------------------------------------------------------
       
   121 // CVRRecViewActivationContainer::SizeChanged
       
   122 //
       
   123 // ---------------------------------------------------------------------------
       
   124 //
       
   125 void CVRRecViewActivationContainer::SizeChanged()
       
   126 	{
       
   127 	TRect bgRect;
       
   128 	AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, bgRect);
       
   129 	iBackgroundSkinContext->SetRect( bgRect );		
       
   130 	}
       
   131 
       
   132 
       
   133 // ---------------------------------------------------------------------------
       
   134 // CVRRecViewActivationContainer::Draw
       
   135 //
       
   136 // ---------------------------------------------------------------------------
       
   137 //
       
   138 void CVRRecViewActivationContainer::Draw( const TRect& /*aRect*/ ) const
       
   139 	{
       
   140 	CWindowGc& gc = SystemGc();
       
   141 
       
   142 	// Fill the background with the background bitmap from the skin
       
   143 	// Note: if the skin doesn't define a background the area is simply
       
   144 	// cleared (which is OK for us).
       
   145 	AknsDrawUtils::Background( iSkinInstance, iBackgroundSkinContext,
       
   146 			this, gc, Rect() );
       
   147 
       
   148 	}
       
   149 
       
   150 
       
   151 // ---------------------------------------------------------------------------
       
   152 // CVRRecViewActivationContainer::MopSupplyObject
       
   153 //
       
   154 // ---------------------------------------------------------------------------
       
   155 //
       
   156 TTypeUid::Ptr CVRRecViewActivationContainer::MopSupplyObject(TTypeUid aId)
       
   157 	{
       
   158 	
       
   159 	if ( aId.iUid == MAknsControlContext::ETypeId )
       
   160 		{
       
   161 		// Return the control context for the childs
       
   162 		return MAknsControlContext::SupplyMopObject( aId, 
       
   163 													 iBackgroundSkinContext );
       
   164 		
       
   165 		}
       
   166 	return CCoeControl::MopSupplyObject( aId );
       
   167 	}
       
   168