# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1268401383 -7200 # Node ID f84a661cfc1d50d8d472e0031fef76273cf630e3 # Parent 07d1685f0cd411db81f47b829d196ca601496426 Revision: 201007 Kit: 201008 diff -r 07d1685f0cd4 -r f84a661cfc1d vtengines/videoteleng/Src/Media/CVtEngLocalVideo.cpp --- a/vtengines/videoteleng/Src/Media/CVtEngLocalVideo.cpp Fri Feb 19 22:53:04 2010 +0200 +++ b/vtengines/videoteleng/Src/Media/CVtEngLocalVideo.cpp Fri Mar 12 15:43:03 2010 +0200 @@ -1278,7 +1278,12 @@ aSource == KVtEngProviderCam2 || aSource == KVtEngProviderImage ) ) { - aSource = iDelayedSelect.DelayedSelectTarget(); + TVtEngProviderType delayedSelect( iDelayedSelect.DelayedSelectTarget() ); + if ( delayedSelect != KVtEngProviderNone && + delayedSelect != KVtEngProviderDefaultStillImage ) + { + aSource = delayedSelect; + } } if( IsProviderWaiting( aSource ) ) diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/data/videotelui.rss --- a/vtuis/videotelui/data/videotelui.rss Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/data/videotelui.rss Fri Mar 12 15:43:03 2010 +0200 @@ -1910,4 +1910,23 @@ }; } +// ----------------------------------------------------------------------------- +// +// r_videotelui_end_call_button +// End call button +// +// ----------------------------------------------------------------------------- +// +RESOURCE AVKON_BUTTON r_videotelui_end_call_button + { + flags = 0; + states = + { + AVKON_BUTTON_STATE + { + flags = 0; + txt = qtn_vt_button_end_call; + } + }; + } // End of File diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/group/bld.inf --- a/vtuis/videotelui/group/bld.inf Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/group/bld.inf Fri Mar 12 15:43:03 2010 +0200 @@ -63,7 +63,7 @@ -c8,8 qgn_indi_tb_microphone_mute -c8,8 qgn_indi_tb_microphone_unmute -c8,8 qgn_indi_tb_swap_images \ -c8,8 qgn_indi_tb_video -c8,8 qgn_indi_tb_video_disable -c8,8 qgn_indi_tb_zoom \ -c8,8 qgn_indi_cams_tb_capture -c8,8 qgn_indi_tb_ihf_on -c8,8 qgn_indi_tb_handset \ - -c8,8 qgn_indi_tb_bthf + -c8,8 qgn_indi_tb_bthf -c8,8 qgn_indi_button_end_active_call END START EXTENSION s60/mifconv diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/group/videotelui.mmp --- a/vtuis/videotelui/group/videotelui.mmp Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/group/videotelui.mmp Fri Mar 12 15:43:03 2010 +0200 @@ -53,6 +53,8 @@ SOURCE TVtUiCallParameters.cpp SOURCE CVtUiNumberEntryActivationControl.cpp SOURCE CVtUiBitmapManager.cpp +SOURCE CVtUiEndCallButton.cpp +SOURCE CVtUiEndCallButtonPane.cpp SOURCE tvtuiappstatebase.cpp SOURCE tvtuistatestarting.cpp diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/inc/CVtUiAppUi.h --- a/vtuis/videotelui/inc/CVtUiAppUi.h Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/inc/CVtUiAppUi.h Fri Mar 12 15:43:03 2010 +0200 @@ -57,6 +57,7 @@ class CVtUiVolumeControl; class CAknIncallBubble; class CVtUiRemoteVideoControl; +class CVtUiEndCallButtonPane; // CLASS DECLARATION @@ -195,6 +196,11 @@ * @param aZoomStep New zoom step to be set. */ void SetZoomFactorL( TInt aZoomStep ); + + /* + * Simulate key event + */ + void CmdSimulateKeyEvent( TInt aScanCode ); public: // Functions from base classes @@ -364,6 +370,12 @@ CVtUiRemoteVideoControl& RemoteVideoControl(); /** + * Gets reference to end call pane. + * @return reference to end call pane. + */ + CVtUiEndCallButtonPane& EndCallButtonPane(); + + /** * Switches viewfinder to main pane if it is currently in context * pane. */ diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/inc/CVtUiEndCallButton.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiEndCallButton.h Fri Mar 12 15:43:03 2010 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: End call button definition. +* +*/ + +#ifndef C_VTUIENDCALLBUTTON_H +#define C_VTUIENDCALLBUTTON_H + +// INCLUDES +#include +#include "videotelui.hrh" + +// CLASS DECLARATION + +/** + * CCVtUiEndCallButton + * + */ +class CVtUiEndCallButton : public CAknButton + { +public: + // Constructors and destructor + + /** + * Static construction method. + * @return Pointer to newly created instance of CVtUiEndCallButton. + */ + static CVtUiEndCallButton* NewL(); + + /** + * C++ destructor. + */ + ~CVtUiEndCallButton(); + + /** + * Constructs controls from a resource file. + * + * @param aReader The resource reader, with which to access the + * control's resource values. + */ + void ConstructFromResourceL( const TInt aResourceId ); + + /** + * The layout of text and the rectangle of icon setting method. + * @param aLayoutText The text layout. + * @param aIconRect The rectangle of icon to be set. + */ + void SetLayout( const TAknLayoutText aLayoutText, + const TRect aIconRect); + +protected: + //from base class CCoeControl + /** + * From CCoeControl. + * Draws the control. Called by window server. + */ + void Draw(const TRect& aRect) const; + + /** + * Handles a change to the control's resources. + * + * @param aType is a message UID value. + */ + void HandleResourceChange( TInt aType ); + +private: + + /** + * C++ constructor for the end call button. + */ + CVtUiEndCallButton(); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * Gets the correct text color. + * + * @param aPenColor the RGB colour value + */ + void GetTextColors( TRgb& aPenColor ) const; + + /** + * Loads icons from the resource + */ + void LoadButtonIcon( TVtUiBitmapId aIconId, TVtUiBitmapId aMaskId ); + + /** + * Draw text and icon according to the layout. + * + * @param aGc the window graphics context + */ + void LayoutIconAndText( CWindowGc& aGc ) const; + +private: + + /** + * Layout text + */ + TAknLayoutText iLayoutText; + + /** + * Rectangle of the icon of the button. + */ + TRect iIconRect; + }; + +#endif // C_VTUIENDCALLBUTTON_H diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/inc/CVtUiEndCallButtonPane.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiEndCallButtonPane.h Fri Mar 12 15:43:03 2010 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: End call button pane definition. +* +*/ + + +#ifndef C_VTUIENDCALLBUTTONPANE_H +#define C_VTUIENDCALLBUTTONPANE_H + +// INCLUDES + +// CLASS DECLARATION +class CVtUiEndCallButton; + +/** + * CCVtUiEndCallButtonPane + */ +class CVtUiEndCallButtonPane : public CCoeControl, + public MCoeControlObserver + { + public: // Constructors and destructor + + /** + * Static construction method. + * @param aRect The intialized rectangle of container window + * @return Pointer to newly created instance of CVtUiEndCallButtonPane. + */ + static CVtUiEndCallButtonPane* NewL( const TRect& aRect ); + + /** + * C++ destructor. + */ + ~CVtUiEndCallButtonPane(); + + public: //from base class CCoeControl + + /** + * From CCoeControl. + * Gets the number of controls contained in a compound control. + * @return The number of controls in the container + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl. + * Gets an indexed component of a compound control. + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * From CCoeControl. + * Draws the control. + */ + void Draw(const TRect& aRect) const; + + /** + * From CCoeControl. + * Responds to changes to the size and position of the + * contents of this control. + */ + void SizeChanged(); + + /** + * From CCoeControl. + * Retrieves an object of the same type as that encapsulated in aId. + */ + TTypeUid::Ptr MopSupplyObject(TTypeUid aId); + + public: //From MCoeControlObserver + + /** + * Handles an event from an observed control. + */ + void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); + + private: + + /** + * C++ constructor for the end call button container. + */ + CVtUiEndCallButtonPane(); + + /** + * Symbian 2nd phase constructor. + * + * @param aRect The intialized rectangle of container window + */ + void ConstructL( const TRect& aRect ); + + private: // New functions + /** + * Creating button from resource. + */ + void CreateButtonUsingResourceL(); + + /** + * Getting the button layout data for the text and icon. + */ + void GetButtonLayoutData(); + + private: + + /** + * Owned: End button + */ + CVtUiEndCallButton* iEndButton; + + /** + * Owned: background context. + */ + CAknsBasicBackgroundControlContext* iBgContext; + }; + +#endif // C_VTUIENDCALLBUTTONCONTAINER_H diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/inc/VtUiLayout.h --- a/vtuis/videotelui/inc/VtUiLayout.h Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/inc/VtUiLayout.h Fri Mar 12 15:43:03 2010 +0200 @@ -226,6 +226,13 @@ * EFalse otherwise. */ static TBool IsLandscapeOrientation(); + + /** + * Returns end call button pane layout. + * @param aLayout end call button pane layout. + */ + static void GetButtonPaneLayout( + TAknWindowLineLayout& aLayout ); }; diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/inc/features/prefs/cvtuiprefsettinglistbase.h --- a/vtuis/videotelui/inc/features/prefs/cvtuiprefsettinglistbase.h Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/inc/features/prefs/cvtuiprefsettinglistbase.h Fri Mar 12 15:43:03 2010 +0200 @@ -203,6 +203,12 @@ // Window position for context control TInt iRemoteVideoControlWindowPosition; + + // Window priority for context control + TInt iEndCallButtonPanePriority; + + // Window position for context control + TInt iEndCallButtonPanePosition; }; #endif // CVTUIPEFSETTINGLISTBASE_H diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/inc/videotelui.hrh --- a/vtuis/videotelui/inc/videotelui.hrh Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/inc/videotelui.hrh Fri Mar 12 15:43:03 2010 +0200 @@ -126,6 +126,10 @@ EVtUiBitmap_qgn_indi_call_video_blind_in, // Blind out icon. EVtUiBitmap_qgn_indi_call_video_blind_out, + // End call button icon + EVtUiBitmap_qgn_indi_button_end_active_call, + // End call button icon mask + EVtUiBitmap_qgn_indi_button_end_active_call_mask, // Earpiece icon. EVtUiBitmap_qgn_indi_earpiece, // Earpiece icon mask. diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/loc/videotelui.loc --- a/vtuis/videotelui/loc/videotelui.loc Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/loc/videotelui.loc Fri Mar 12 15:43:03 2010 +0200 @@ -393,4 +393,9 @@ // #define qtn_incal_softk_dialer "Dialer" +// d: End call button's text +// l: vidtel_button_pane_t1 +// r: 5.0 +// +#define qtn_vt_button_end_call "End Call" // End of File diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/src/CVtUiAppUi.cpp --- a/vtuis/videotelui/src/CVtUiAppUi.cpp Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/src/CVtUiAppUi.cpp Fri Mar 12 15:43:03 2010 +0200 @@ -34,6 +34,7 @@ #include "VtUiPanic.h" #include "CVtUiActivateBtHfDialog.h" #include "CVtUiRemoteVideoControl.h" +#include "CVtUiEndCallButtonPane.h" #include @@ -540,6 +541,12 @@ // Owned number entry activation control. CVtUiNumberEntryActivationControl* iNumberEntryActivation; + + // Owned button pane control + CVtUiEndCallButtonPane* iEndCallButtonPane; + + // ETrue if iButtonPane has been added to stack. + TBool iButtonPaneInStack; }; @@ -830,6 +837,8 @@ FeatureManager::InitializeLibL(); BaseConstructL( EAknEnableSkin | EAknEnableMSK ); + + iIsLandScapeOrientation = VtUiLayout::IsLandscapeOrientation(); iCba = Cba(); // Must be done before creating features @@ -3206,6 +3215,20 @@ __VTPRINTEXIT( "VtUi.SetZoomFactorL" ) } +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdSimulateKeyEvent +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdSimulateKeyEvent( TInt aScanCode ) + { + TRawEvent lEventDown; + lEventDown.Set( TRawEvent::EKeyDown, aScanCode ); + UserSvr::AddEvent( lEventDown ); + User::After( 100000 ); + TRawEvent lEventUp; + lEventUp.Set( TRawEvent::EKeyUp, aScanCode ); + UserSvr::AddEvent( lEventUp ); + } // ----------------------------------------------------------------------------- // CVtUiAppUi::CmdUpdateVolumeL @@ -3634,13 +3657,23 @@ break; case EVtUiAppUiAnsweredQuerySetupStill: - ActiveExecInitSetSourceL( MVtEngMedia::EMediaStillImage, aRequest ); + { + if ( iIsLandScapeOrientation == VtUiLayout::IsLandscapeOrientation() ) + { + ActiveExecInitSetSourceL( MVtEngMedia::EMediaStillImage, aRequest ); + } aNextState = EVtUiAppUiAnsweredQuerySetupStart; + } break; case EVtUiAppUiAnsweredQuerySetupNone: - ActiveExecInitSetSourceL( MVtEngMedia::EMediaNone, aRequest ); + { + if ( iIsLandScapeOrientation == VtUiLayout::IsLandscapeOrientation() ) + { + ActiveExecInitSetSourceL( MVtEngMedia::EMediaNone, aRequest ); + } aNextState = EVtUiAppUiAnsweredQuerySetupStart; + } break; case EVtUiAppUiAnsweredQuerySetupStart: @@ -3790,6 +3823,11 @@ ShowCameraInUseNoteL(); } + if ( iIsLandScapeOrientation != VtUiLayout::IsLandscapeOrientation() ) + { + (void) HandleLayoutChanged(); + } + if ( aState != EVtUiAppUiAnsweredQueryFinish ) { ChangeApplicationFocus( ETrue ); @@ -4553,6 +4591,17 @@ } // ----------------------------------------------------------------------------- +// CVtUiAppUi::EndCallButtonPane +// ----------------------------------------------------------------------------- +// +CVtUiEndCallButtonPane& CVtUiAppUi::EndCallButtonPane() + { + __VTPRINTENTER( "VtUi.EndCallButtonPane" ) + __VTPRINTEXIT( "VtUi.EndCallButtonPane" ) + return *iInstance->iEndCallButtonPane; + } + +// ----------------------------------------------------------------------------- // CVtUiAppUi::DoExit // ----------------------------------------------------------------------------- // @@ -6318,6 +6367,14 @@ iAppUi.AddToStackL( iContextControl ); iContextControlInStack = ETrue; + iEndCallButtonPane = CVtUiEndCallButtonPane::NewL( parent ); + + VtUiLayout::GetButtonPaneLayout( control ); + + AknLayoutUtils::LayoutControl( iEndCallButtonPane, parent, control ); + iAppUi.AddToStackL( iEndCallButtonPane ); + iButtonPaneInStack = ETrue; + iNaviPane = CVtUiNaviPane::NewL( *( iAppUi.NaviPaneL() ), @@ -6342,6 +6399,10 @@ AknLayoutUtils::LayoutControl( iNumberEntryActivation, parent, control ); VtUiLayout::GetFirstWindowBackgroundLayout( control ); AknLayoutUtils::LayoutControl( iContextControl, parent, control ); + + VtUiLayout::GetButtonPaneLayout( control ); + AknLayoutUtils::LayoutControl( iEndCallButtonPane, parent, control ); + if(iContextControl) iContextControl->LayoutRemoteVideo(); @@ -6413,12 +6474,17 @@ { iAppUi.RemoveFromStack( iRemoteVideoControl ); } + if( iEndCallButtonPane && iButtonPaneInStack ) + { + iAppUi.RemoveFromStack( iEndCallButtonPane ); + } delete iMainControl; delete iContextControl; delete iRemoteVideoControl; delete iNumberEntryActivation; delete iNaviPane; delete iBitmapManager; + delete iEndCallButtonPane; } // Implementation of CVtUiAppUi::CEventObserver diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/src/CVtUiContextControl.cpp --- a/vtuis/videotelui/src/CVtUiContextControl.cpp Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/src/CVtUiContextControl.cpp Fri Mar 12 15:43:03 2010 +0200 @@ -299,7 +299,11 @@ // Touch outside of volume popup, close volume popup if ( aEvent.Pointer()->iType == TPointerEvent::EButton1Down ) { - if ( aDestination == this ) + if ( iAppUi.IsDisplayingMenuOrDialog() ) + { + iOkToSwapOnButtonUp = EFalse; + } + else if ( aDestination == this ) { iOkToSwapOnButtonUp = !iUiStates.IsZoomModeOn() && !iUiStates.IsCaptureModeOn() && diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/src/CVtUiEndCallButton.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiEndCallButton.cpp Fri Mar 12 15:43:03 2010 +0200 @@ -0,0 +1,257 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Button of ending call. +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "CVtUiEndCallButton.h" +#include "VtUiLayout.h" + + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButton::CVtUiEndCallButton +// ----------------------------------------------------------------------------- +// +CVtUiEndCallButton::CVtUiEndCallButton(): CAknButton( 0 ) + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButton::NewL +// ----------------------------------------------------------------------------- +// +CVtUiEndCallButton* CVtUiEndCallButton::NewL() + { + CVtUiEndCallButton* self = new (ELeave) CVtUiEndCallButton(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); // self; + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButton::ConstructL +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButton::ConstructL() + { + CAknButton::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButton::~CVtUiEndCallButton +// ----------------------------------------------------------------------------- +// +CVtUiEndCallButton::~CVtUiEndCallButton() + { + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButton::ConstructFromResourceL +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButton::ConstructFromResourceL( const TInt aResourceId ) + { + CAknButton::ConstructFromResourceL( aResourceId ); + + // function button text color + SetTextColorIds( KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG65 ); + + // Customize icons + LoadButtonIcon( EVtUiBitmap_qgn_indi_button_end_active_call, + EVtUiBitmap_qgn_indi_button_end_active_call_mask ); + + if ( State()->Icon() ) + { + SetIconScaleMode( EAspectRatioPreserved ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButton::SetLayout +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButton::SetLayout( const TAknLayoutText aLayoutText, + const TRect aIconRect ) + { + iLayoutText = aLayoutText; + iIconRect = aIconRect; + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButton::Draw +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButton::Draw(const TRect& aRect) const + { + __VTPRINTENTER( "CCVtUiEndCallButton::Draw" ) + TAknLayoutRect centerLayout; + centerLayout.LayoutRect( aRect, + AknLayoutScalable_Avkon::toolbar_button_pane_g1().LayoutLine() ); + TRect innerRect = centerLayout.Rect(); + CWindowGc& gc = SystemGc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + TAknsItemID frameId = KAknsIIDQsnFrButtonNormalReject; + + if ( iButtonPressed ) + { + frameId = KAknsIIDQsnFrButtonPressedReject; + } + else if ( IsDimmed() ) + { + frameId = KAknsIIDQsnFrButtonInactiveReject; + } + + iBgContext->SetFrame( frameId ); + iBgContext->SetCenter( KAknsIIDQsnFrButtonCenterNormal ); + iBgContext->SetFrameRects( aRect, innerRect ); + + if ( !AknsDrawUtils::Background( skin, + iBgContext, + NULL, + gc, + aRect, + KAknsDrawParamNoClearUnderImage ) ) + { + gc.SetBrushColor( KRgbRed ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.DrawRect( aRect ); + } + + LayoutIconAndText( gc ); + __VTPRINTEXIT( "CCVtUiEndCallButton::Draw" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButton::HandleResourceChange +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButton::HandleResourceChange( TInt aType ) + { + __VTPRINTENTER( "CCVtUiEndCallButton::HandleResourceChange" ) + CAknButton::HandleResourceChange( aType ); + + if ( aType == KAknsMessageSkinChange ) + { + LoadButtonIcon( EVtUiBitmap_qgn_indi_button_end_active_call, + EVtUiBitmap_qgn_indi_button_end_active_call_mask ); + } + __VTPRINTEXIT( "CCVtUiEndCallButton::HandleResourceChange" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButton::GetTextColors +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButton::GetTextColors( TRgb& aPenColor ) const + { + __VTPRINTENTER( "CCVtUiEndCallButton::GetTextColors" ) + if ( IsDimmed() ) + { + aPenColor = iEikonEnv->ControlColor( EColorButtonTextDimmed, *this ); + } + else if ( iButtonPressed ) + { + aPenColor = iEikonEnv->ControlColor( EColorButtonTextPressed, *this ); + } + else + { + aPenColor = iEikonEnv->ControlColor( EColorButtonText, *this ); + } + __VTPRINTEXIT( "CCVtUiEndCallButton::GetTextColors" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButton::LoadButtonIcon +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButton::LoadButtonIcon( TVtUiBitmapId aIconId, TVtUiBitmapId aMaskId ) + { + __VTPRINTENTER( "CCVtUiEndCallButton::LoadButtonIcon" ) + CGulIcon* icon = NULL; + TFileName fileName; + TInt fileIndex; + TInt maskIndex; + TAknsItemID skinId = + VtUiLayout::MapBitmapToSkinId( aIconId ); + VtUiLayout::Resolve( aIconId, fileName, fileIndex ); + VtUiLayout::Resolve( aMaskId, fileName, maskIndex ); + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + icon = AknsUtils::CreateGulIconL( skin, + skinId, + fileName, + fileIndex, + maskIndex ); + + if ( icon ) + { + CAknButtonState* state = State(); + // State takes ownership of icon + state->SetIcon( icon ); + } + __VTPRINTEXIT( "CCVtUiEndCallButton::LoadButtonIcon" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButton::LayoutIconAndText +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButton::LayoutIconAndText( CWindowGc& aGc ) const + { + __VTPRINTENTER( "CCVtUiEndCallButton::LayoutIconAndText" ) + CAknButtonState* state = State(); + if ( !state || + !state->Icon() || + !state->Text().Length() ) + { + return; + } + TRgb penColor; + TRgb brushColor; + GetTextColors( penColor ); + + iLayoutText.DrawText( aGc, state->Text(), EFalse, penColor ); + + const CGulIcon* icon = GetCurrentIcon(); + + if ( icon ) + { + CFbsBitmap* buttonBmp = icon->Bitmap(); + CFbsBitmap* buttonMask = icon->Mask(); + + if( buttonBmp && buttonMask ) + { + aGc.BitBltMasked( iIconRect.iTl, buttonBmp, + iIconRect.Size(), buttonMask, EFalse ); + } + } + __VTPRINTEXIT( "CCVtUiEndCallButton::LayoutIconAndText" ) + } diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/src/CVtUiEndCallButtonPane.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiEndCallButtonPane.cpp Fri Mar 12 15:43:03 2010 +0200 @@ -0,0 +1,229 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The container pane of end button. +* +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "CVtUiEndCallButton.h" +#include "CVtUiEndCallButtonPane.h" +#include "videotelui.hrh" +#include "CVtUiAppUi.h" + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::CVtUiEndCallButtonPane +// ----------------------------------------------------------------------------- +// +CVtUiEndCallButtonPane::CVtUiEndCallButtonPane() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::NewL +// ----------------------------------------------------------------------------- +// +CVtUiEndCallButtonPane* CVtUiEndCallButtonPane::NewL( const TRect& aRect ) + { + CVtUiEndCallButtonPane* self = + new (ELeave) CVtUiEndCallButtonPane(); + CleanupStack::PushL(self); + self->ConstructL( aRect ); + CleanupStack::Pop(); // self; + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::ConstructL +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButtonPane::ConstructL( const TRect& aRect ) + { + __VTPRINTENTER( "CVtUiEndCallButtonPane.ConstructL" ) + // Create a window for this application view + CreateWindowL(); + + // Set the windows size + SetRect( aRect ); + + CreateButtonUsingResourceL(); + GetButtonLayoutData(); + + + iBgContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDQsnBgAreaMain, Rect(), ETrue ); + + // Activate the window, which makes it ready to be drawn + ActivateL(); + __VTPRINTEXIT( "CVtUiEndCallButtonPane.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::CVtUiEndCallButtonPane +// ----------------------------------------------------------------------------- +// +CVtUiEndCallButtonPane::~CVtUiEndCallButtonPane() + { + __VTPRINTENTER( "CVtUiEndCallButtonPane.~" ) + if ( iEndButton ) + { + delete iEndButton; + } + + if ( iBgContext ) + { + delete iBgContext; + } + __VTPRINTEXIT( "CVtUiEndCallButtonPane.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::CountComponentControls +// ----------------------------------------------------------------------------- +// +TInt CVtUiEndCallButtonPane::CountComponentControls() const + { + return iEndButton ? 1 : 0; + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::ComponentControl +// ----------------------------------------------------------------------------- +// +CCoeControl* CVtUiEndCallButtonPane::ComponentControl(TInt aIndex) const + { + return iEndButton; + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::Draw +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButtonPane::Draw(const TRect& aRect) const + { + __VTPRINTENTER( "CVtUiEndCallButtonPane.Draw" ) + CWindowGc& gc = SystemGc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, this, gc, Rect() ); + __VTPRINTEXIT( "CVtUiEndCallButtonPane.Draw" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::SizeChanged +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButtonPane::SizeChanged() + { + __VTPRINTENTER( "CVtUiEndCallButtonPane.SizeChanged" ) + if( iEndButton ) + { + GetButtonLayoutData(); + } + if( iBgContext ) + { + TRect bgRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, bgRect ); + iBgContext->SetRect( bgRect ); + } + __VTPRINTEXIT( "CVtUiEndCallButtonPane.SizeChanged" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::MopSupplyObject +// ----------------------------------------------------------------------------- +// +TTypeUid::Ptr CVtUiEndCallButtonPane::MopSupplyObject(TTypeUid aId) + { + __VTPRINTENTER( "CVtUiEndCallButtonPane.MopSupplyObject" ) + // Required during rendering of the background skin in Draw() + if (aId.iUid == MAknsControlContext::ETypeId) + { + __VTPRINTEXIT( "CVtUiEndCallButtonPane.MopSupplyObject.1" ) + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); + } + __VTPRINTEXIT( "CVtUiEndCallButtonPane.MopSupplyObject.2" ) + return CCoeControl::MopSupplyObject( aId ); + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::HandleControlEventL +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButtonPane::HandleControlEventL( CCoeControl* aControl, + TCoeEvent aEventType ) + { + __VTPRINTENTER( "CVtUiEndCallButtonPane.HandleControlEventL" ) + if ( aEventType != EEventStateChanged ) + { + __VTPRINTEXIT( "CVtUiEndCallButtonPane.HandleControlEventL" ) + return; + } + CVtUiAppUi* appUi = STATIC_CAST( CVtUiAppUi*, CCoeEnv::Static()->AppUi() ); + appUi->CmdSimulateKeyEvent( EStdKeyNo ); + __VTPRINTEXIT( "CVtUiEndCallButtonPane.HandleControlEventL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::CreateButtonUsingResourceL +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButtonPane::CreateButtonUsingResourceL() + { + __VTPRINTENTER( "CVtUiEndCallButtonPane.CreateButtonUsingResourceL" ) + iEndButton = CVtUiEndCallButton::NewL(); + iEndButton->ConstructFromResourceL( R_VIDEOTELUI_END_CALL_BUTTON ); + iEndButton->SetContainerWindowL( *this ); + iEndButton->SetRect( Rect() ); + iEndButton->SetObserver( this ); + iEndButton->MakeVisible( ETrue ); + iEndButton->ActivateL(); + __VTPRINTEXIT( "CVtUiEndCallButtonPane.CreateButtonUsingResourceL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::GetButtonLayoutData +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButtonPane::GetButtonLayoutData() + { + __VTPRINTENTER( "CVtUiEndCallButtonPane.GetButtonLayoutData" ) + AknLayoutUtils::LayoutControl( + iEndButton, + Rect(), + AknLayoutScalable_Apps::bg_button_pane_cp034( 0, 0, 0) ); + + + TAknLayoutText text; + text.LayoutText( Rect(), + AknLayoutScalable_Apps::vidtel_button_pane_t1( + 0 ).LayoutLine()); + + TAknLayoutRect icon; + icon.LayoutRect( Rect(), + AknLayoutScalable_Apps::vidtel_button_pane_g1( + 0 ).LayoutLine()); + + iEndButton->SetIconSize( icon.Rect().Size() ); + + iEndButton->SetLayout( text, icon.Rect() ); + __VTPRINTEXIT( "CVtUiEndCallButtonPane.GetButtonLayoutData" ) + } diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/src/CVtUiMainControl.cpp --- a/vtuis/videotelui/src/CVtUiMainControl.cpp Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/src/CVtUiMainControl.cpp Fri Mar 12 15:43:03 2010 +0200 @@ -104,11 +104,13 @@ { __VTPRINTENTER( "MainCtrl.HandleSizeChanged" ) const TRect mainPaneRect( Rect() ); + TRect screen; + VtUiLayout::GetApplicationParentRect( screen ); // blind icon and mask TAknWindowLineLayout blind; VtUiLayout::GetSecondWindowDisabledIconLayout( blind ); - iBlindLayout.LayoutRect( mainPaneRect, blind ); + iBlindLayout.LayoutRect( screen, blind ); const TSize blindSize( iBlindLayout.Rect().Size() ); BitmapManager().SetSize( iBlindId, blindSize ); BitmapManager().SetSize( iBlindMaskId, blindSize ); diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/src/VtUiLayout.cpp --- a/vtuis/videotelui/src/VtUiLayout.cpp Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/src/VtUiLayout.cpp Fri Mar 12 15:43:03 2010 +0200 @@ -107,11 +107,11 @@ { //aLayout = AppLayout::Uplink_video_image__large__Line_1(); TInt main_pane_variety( 0 ); - TInt vid_upl_variety( 14 ); + TInt vid_upl_variety( 18 ); if ( Layout_Meta_Data::IsLandscapeOrientation() ) { main_pane_variety = 4; - vid_upl_variety = 0; + vid_upl_variety = 17; } TAknWindowComponentLayout layout1 = @@ -137,11 +137,11 @@ TAknWindowLineLayout& aLayout ) { TInt main_pane_variety( 0 ); - TInt vid_upl_variety( 14 ); + TInt vid_upl_variety( 18 ); if ( Layout_Meta_Data::IsLandscapeOrientation() ) { main_pane_variety = 4; - vid_upl_variety = 0; + vid_upl_variety = 17; } TAknWindowComponentLayout layout1 = @@ -168,11 +168,11 @@ { //aLayout = AppLayout::Uplink_video_image__large__Line_3(); TInt main_pane_variety( 0 ); - TInt vid_upl_variety( 14 ); + TInt vid_upl_variety( 18 ); if ( Layout_Meta_Data::IsLandscapeOrientation() ) { main_pane_variety = 4; - vid_upl_variety = 0; + vid_upl_variety = 17; } TAknWindowComponentLayout layout1 = @@ -215,14 +215,8 @@ { if ( aIsToolbar ) { - // non touch - TInt varietyPr = 8; // portrait - TInt varietyLs = 10; // landscape - if ( AknLayoutUtils::PenEnabled() ) - { - varietyPr = 11; // portrait - varietyLs = 12; // landscape - } + TInt varietyPr = 27; // portrait + TInt varietyLs = 26; // landscape TInt varietyIndex = Layout_Meta_Data::IsLandscapeOrientation() ? varietyLs : varietyPr ; @@ -257,14 +251,8 @@ { if ( aIsToolbar ) { - // non touch - TInt varietyPr = 5; // portrait - TInt varietyLs = 7; // landscape - if ( AknLayoutUtils::PenEnabled() ) - { - varietyPr = 8; // portrait - varietyLs = 1; // landscape - } + TInt varietyPr = 24; // portrait + TInt varietyLs = 22; // landscape TInt varietyIndex = Layout_Meta_Data::IsLandscapeOrientation() ? varietyLs : varietyPr; @@ -288,7 +276,21 @@ void VtUiLayout::GetSecondWindowDisabledIconLayout( TAknWindowLineLayout& aLayout ) { - aLayout = AppLayout::Downlink_video_image_Line_3(); + TInt blind_icon_variety( 4 ); + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + blind_icon_variety = 3; + } + + TAknWindowComponentLayout layout2 = + AknLayoutScalable_Apps::main_video_tele_pane(); + TAknWindowComponentLayout layout4 = + AknLayoutScalable_Apps:: + call_video_g2( blind_icon_variety ); + + aLayout = + DoCompose( layout2 , layout4 ).LayoutLine(); + } // ----------------------------------------------------------------------------- @@ -309,8 +311,8 @@ TAknTextComponentLayout layout2 = aFirstLine ? - AknLayoutScalable_Apps::call_video_pane_t1() : - AknLayoutScalable_Apps::call_video_pane_t2(); + AknLayoutScalable_Apps::call_video_pane_t1(2) : + AknLayoutScalable_Apps::call_video_pane_t2(2); aLayout = TAknWindowComponentLayout::ComposeText( @@ -325,11 +327,11 @@ TAknTextComponentLayout l2; if ( !line ) { - l2 = AknLayoutScalable_Apps::call_video_pane_t1( 1 ); + l2 = AknLayoutScalable_Apps::call_video_pane_t1( 3 ); } else { - l2 = AknLayoutScalable_Apps::call_video_pane_t2( 1 ); + l2 = AknLayoutScalable_Apps::call_video_pane_t2( 3 ); } aLayout = TAknWindowComponentLayout::ComposeText( l1, l2 ); } @@ -534,6 +536,11 @@ case EVtUiBitmap_qgn_prop_sub_current_mask: skinId = KAknsIIDQgnPropSubCurrent; break; + + case EVtUiBitmap_qgn_indi_button_end_active_call: + case EVtUiBitmap_qgn_indi_button_end_active_call_mask: + skinId = KAknsIIDQgnIndiButtonEndCall; + break; default: // Default value is OK. @@ -665,6 +672,13 @@ file = EVtUiAvkonBitmapFile; index = EMbmAvkonQgn_prop_sub_current_mask; break; + case EVtUiBitmap_qgn_indi_button_end_active_call: + index = EMbmVideoteluiQgn_indi_button_end_active_call; + break; + + case EVtUiBitmap_qgn_indi_button_end_active_call_mask: + index = EMbmVideoteluiQgn_indi_button_end_active_call_mask; + break; default: VtUiPanic::Panic( EVtUiPanicInvalidBitmapId ); @@ -697,4 +711,26 @@ return Layout_Meta_Data::IsLandscapeOrientation(); } +// ----------------------------------------------------------------------------- +// VtUiLayout::GetButtonPaneLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetButtonPaneLayout( TAknWindowLineLayout& aLayout ) + { +// TInt main_pane_variety = IsLandscapeOrientation() ? 1 : 2; + TInt main_pane_variety( 0 ); + TInt vid_btn_variety( 2 ); + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + main_pane_variety = 4; + vid_btn_variety = 1; + } + + + TAknWindowComponentLayout layout1 = AknLayoutScalable_Apps::main_pane( main_pane_variety ); + + TAknWindowComponentLayout layout2 = AknLayoutScalable_Apps::vidtel_button_pane( vid_btn_variety ); + + aLayout = DoCompose( layout1, layout2 ).LayoutLine(); + } // End of File diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/src/features/dialer/cvtuidialercontainer.cpp --- a/vtuis/videotelui/src/features/dialer/cvtuidialercontainer.cpp Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/src/features/dialer/cvtuidialercontainer.cpp Fri Mar 12 15:43:03 2010 +0200 @@ -109,6 +109,9 @@ default: break; } + + CCoeControl::HandleResourceChange( aType ); + __VTPRINTEXIT( "DialContainer.HandleResourceChangeL" ) } @@ -384,7 +387,7 @@ else { // Portrait: main pane with status pane off, control pane on - mainPaneLL = AknLayoutScalable_Apps::main_pane( 12 ).LayoutLine(); + mainPaneLL = AknLayoutScalable_Apps::main_pane( 9 ).LayoutLine(); } TRect appWinRect; diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/src/features/prefs/cvtuiprefsettinglistbase.cpp --- a/vtuis/videotelui/src/features/prefs/cvtuiprefsettinglistbase.cpp Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/src/features/prefs/cvtuiprefsettinglistbase.cpp Fri Mar 12 15:43:03 2010 +0200 @@ -30,6 +30,7 @@ #include "CVtUiRemoteVideoControl.h" #include "cvtuifeaturemanager.h" #include "VtUiLayout.h" +#include "CVtUiEndCallButtonPane.h" #include @@ -168,6 +169,12 @@ iRemoteVideoControlWindowPosition = iAppUi.RemoteVideoControl().DrawableWindow()->OrdinalPosition(); + // Get end call button pane priority and position + iEndCallButtonPanePriority = + iAppUi.EndCallButtonPane().DrawableWindow()->OrdinalPriority(); + iEndCallButtonPanePosition = + iAppUi.EndCallButtonPane().DrawableWindow()->OrdinalPosition(); + // Rise context control's window priority othwerwise setting page will be // drawn partially over the context control window. iAppUi.ContextControl().DrawableWindow()->SetOrdinalPosition( @@ -178,6 +185,12 @@ iAppUi.RemoteVideoControl().DrawableWindow()->SetOrdinalPosition( iRemoteVideoControlWindowPosition, iRemoteVideoControlWindowPriority + 2 ); + + // Rise end call button pane priority othwerwise setting page + // will be drawn partially over the context control window. + iAppUi.EndCallButtonPane().DrawableWindow()->SetOrdinalPosition( + iEndCallButtonPanePosition, + iEndCallButtonPanePriority + 1 ); // Creates setting page CreateSettingPageL(); @@ -204,6 +217,11 @@ keyEvent.iCode = EKeyEscape; iSettingPage->OfferKeyEventL( keyEvent, EEventKey ); } + + // Set end call button pane priority and position back to + // orginal value. + iAppUi.EndCallButtonPane().DrawableWindow()->SetOrdinalPosition( + iEndCallButtonPanePosition, iEndCallButtonPanePriority ); // Set remote video control's window priority and position back to // orginal value. diff -r 07d1685f0cd4 -r f84a661cfc1d vtuis/videotelui/src/features/prefs/cvtuitransparentsettingpage.cpp --- a/vtuis/videotelui/src/features/prefs/cvtuitransparentsettingpage.cpp Fri Feb 19 22:53:04 2010 +0200 +++ b/vtuis/videotelui/src/features/prefs/cvtuitransparentsettingpage.cpp Fri Mar 12 15:43:03 2010 +0200 @@ -85,13 +85,13 @@ void CVtUiTransparentSettingPage::GetTheLayoutData() { // Varieties - TInt labelVariety = 0; - TInt listboxVariety = 0; + TInt labelVariety = 6; + TInt listboxVariety = 6; if ( Layout_Meta_Data::IsLandscapeOrientation() ) { - labelVariety = 1; - listboxVariety = 1; + labelVariety = 5; + listboxVariety = 5; } // Rect for label and shadow text