// ----------------------------------------------------------------------------
// CStatusPaneHandler::GetTitleL
// 
// ----------------------------------------------------------------------------
//
TBool CStatusPaneHandler::GetTitleL( CAknAppUi* aAppUi, TDes& aTitle )
    {
    aTitle = KNullDesC;

    CEikStatusPane* statusPane = aAppUi->StatusPane();
    if (statusPane && statusPane->PaneCapabilities( TUid::Uid( EEikStatusPaneUidTitle ) ).IsPresent() )
        {
        CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
            ( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
        if ( titlePane->Text() ) 
            {
            StrCopy( aTitle, *titlePane->Text() );
            return ETrue;
            }
        }

    return EFalse;
    }
void CFileSelectDialog::SetTitle()
	{
	
		TUid titlePaneUid;
		titlePaneUid.iUid = EEikStatusPaneUidTitle;
		TVwsViewId ViewID;CEikonEnv::Static()->AppUi()->GetActiveViewId(ViewID);
		CEikStatusPane* statusPane =((CAknAppUi*)CEikonEnv::Static()->AppUi())->StatusPane();		CEikStatusPaneBase::TPaneCapabilities subPane = statusPane->PaneCapabilities(titlePaneUid);
		if ( subPane.IsPresent() && subPane.IsAppOwned() )
			{
			CAknTitlePane* titlePane =(CAknTitlePane*) statusPane->ControlL(titlePaneUid);
			iOldTitle = *titlePane->Text();
			titlePane->SetTextL(iTitle);
			}
		
	}
// ----------------------------------------------------------------------------
// CStatusPaneHandler::SetTitleL
// 
// ----------------------------------------------------------------------------
//
TBool CStatusPaneHandler::SetTitleL( CAknAppUi* aAppUi, const TDesC& aTitle )
    {
    CEikStatusPane* statusPane = aAppUi->StatusPane();
    if ( statusPane && statusPane->PaneCapabilities( TUid::Uid( EEikStatusPaneUidTitle ) ).IsPresent() )
        {
        CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
            ( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
        if ( titlePane->Text() ) 
            {
            titlePane->SetTextL( aTitle );
            return ETrue;
            }
        }
    return EFalse;
    }
// --------------------------------------------------------------------------
// CUPnPVideoPlayerDlg::PreLayoutDynInitL();
// called by framework before dialog is shown
// --------------------------------------------------------------------------
//
void CUPnPVideoPlayerDlg::PreLayoutDynInitL()
{
    __LOG( "CUPnPVideoPlayerDlg::PreLayoutDynInitL" );


    // Browse dialog title text
    TUid titlePaneUid;
    titlePaneUid.iUid = EEikStatusPaneUidTitle;
    CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
    CEikStatusPaneBase::TPaneCapabilities titlesubPane =
        statusPane->PaneCapabilities( titlePaneUid );


    if( titlesubPane.IsPresent() &&
            titlesubPane.IsAppOwned() )
    {
        CAknTitlePane* titlePane =
            (CAknTitlePane*) statusPane->ControlL( titlePaneUid );
        // Take backup of title text
        iOriginalTitleText->Des().Copy( *titlePane->Text() );

        HBufC *tmpbuf = UpnpString::ToUnicodeL( iItem->Title() );
        CleanupStack::PushL( tmpbuf );
        titlePane->SetTextL( *tmpbuf );
        CleanupStack::PopAndDestroy();
    }


    // Start to observe the rendering session
    iRendSession.RemoveObserver();
    iRendSession.SetObserver( *this );

    PreparePlayBackL();

    StartWaitNoteL();

    /*
    // Temporally commented out. Will be uncommented when UpnpAvController
    // provides cancel functionaly fot SetUri action (Upnp Fw 2.5)
        if( iExitCode == EEikBidCancel )
            {
            // Cancel the SetUri
            //iRendSession.Cancel();
            // Send Stop
            TRAP_IGNORE( iRendSession.StopL() );
            ClearTitleL();
            iExitCode = KErrCancel;
            }
    */
    User::LeaveIfError( iExitCode );

    if ( !Layout_Meta_Data::IsLandscapeOrientation() )
    {
        iEikonEnv->AppUiFactory()->StatusPane()->SwitchLayoutL(
            R_AVKON_STATUS_PANE_LAYOUT_USUAL );
    }
    // Volume level to 0
    iCurrentVolume = KMiniumVolume;

    // try to get volume level from renderer
    TRAPD( err, iRendSession.GetVolumeL() );
    if( !err )
    {
        iAdjustingVolume = ETrue;
    }

    __LOG( "CUPnPVideoPlayerDlg::PreLayoutDynInitL End" );
}