// -----------------------------------------------------------------------------
// CMultiViewsView1::Id()
// Returns View's ID.
// -----------------------------------------------------------------------------
//
TUid CMultiViewsView1::Id() const
{
return TUid::Uid( EMultiViewsView1Id );
}
// -----------------------------------------------------------------------------
// CMultiViewsView1::DoActivateL()
// Activate an MultiView1
// -----------------------------------------------------------------------------
//
void CMultiViewsView1::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/)
{
if (!iContainer)
{
iContainer = new (ELeave) CKeyCaptureContainer;
iContainer->SetMopParent(this);
iContainer->ConstructL( ClientRect() );
AppUi()->AddToStackL( *this, iContainer );
}
}
// -----------------------------------------------------------------------------
// CMultiViewsView1::DoDeactivate()
// DeActivate an MultiView1
// -----------------------------------------------------------------------------
//
void CMultiViewsView1::DoDeactivate()
{
if ( iContainer )
{
// Remove View1's container form controllStack
AppUi()->RemoveFromStack( iContainer );
delete iContainer;
iContainer = NULL;
}
}
// -----------------------------------------------------------------------------
// CMultiViewsView1::HandleCommandL()
// Takes care of Command handling.
// -----------------------------------------------------------------------------
//
void CMultiViewsView1::HandleCommandL( TInt aCommand )
{
if ( aCommand == EMultiViewsSwitchToView2 )
{
AppUi()->ActivateLocalViewL( TUid::Uid( EMultiViewsView2Id ) );
}
else
{
AppUi()->HandleCommandL( aCommand );
}
}
// -----------------------------------------------------------------------------
// CMultiViewsView1::HandleSizeChange()
// Called by HandleResourceChangeL() from CMultiViewsAppUi when layout is
// changed.
// -----------------------------------------------------------------------------
//
void CMultiViewsView1::HandleSizeChange( TInt aType )
{
if( iContainer )
{
iContainer->HandleResourceChange( aType );
if ( aType==KEikDynamicLayoutVariantSwitch )
{
TRect rect;
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
iContainer->SetRect(rect);
}
}
}