# HG changeset patch # User Pat Downey # Date 1283340552 -3600 # Node ID 779871d1e4f4ad4f854fd015d2ae7be285db7efe # Parent f15ac8e65a02259ddcde606b9fb8f3b8409b987e Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035 diff -r f15ac8e65a02 -r 779871d1e4f4 group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/group/bld.inf Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2006 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: Telephony / videotelephony +* +*/ + + + +#include "../vtprotocolplugins/group/bld.inf" +#include "../vtengines/group/bld.inf" +#include "../vtuis/group/bld.inf" +#include "../videotelephony_plat/group/bld.inf" + +// End of File \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 layers.sysdef.xml --- a/layers.sysdef.xml Tue Aug 31 15:16:10 2010 +0300 +++ b/layers.sysdef.xml Wed Sep 01 12:29:12 2010 +0100 @@ -1,22 +1,21 @@ - ]> - + - + - - - - - - + + + + + diff -r f15ac8e65a02 -r 779871d1e4f4 lcvtplugin.pkg --- a/lcvtplugin.pkg Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -; Languages -; -&EN - -; Header -#{"lcvtplugin patch"}, (0xF0112235), 1, 0, 0, TYPE=PU - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -;Files -"\epoc32\release\armv5\udeb\lcvtengineplugin.dll" - "!:\sys\bin\lcvtengineplugin.dll" -"\epoc32\data\Z\Resource\Plugins\lcvtengineplugin.RSC"-"!:\resource\plugins\lcvtengineplugin.RSC" diff -r f15ac8e65a02 -r 779871d1e4f4 sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysdef_1_4_0.dtd Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r f15ac8e65a02 -r 779871d1e4f4 sysdef_1_5_1.dtd --- a/sysdef_1_5_1.dtd Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r f15ac8e65a02 -r 779871d1e4f4 videosource.pkg --- a/videosource.pkg Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -; -; 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: -; -; Languages -&EN - -; Header -#{"videosource"}, (0x101F8692), 1, 0, 0, TYPE=PU - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -;Files -"\epoc32\release\armv5\udeb\videosource.dll" - "!:\sys\bin\videosource.dll" diff -r f15ac8e65a02 -r 779871d1e4f4 videoteleng.pkg --- a/videoteleng.pkg Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -; Languages -; -&EN - -; Header -#{"videoteleng patch"}, (0x101F867F), 1, 0, 0, TYPE=PU - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -;Files -"\epoc32\release\armv5\udeb\videoteleng.dll" - "!:\sys\bin\videoteleng.dll" -"\epoc32\release\armv5\urel\cscallctrl.dll" - "!:\sys\bin\cscallctrl.dll" -"\epoc32\release\armv5\urel\vtlogger.dll" - "!:\sys\bin\vtlogger.dll" diff -r f15ac8e65a02 -r 779871d1e4f4 videotelephony.pro --- a/videotelephony.pro Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -# 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: -# -# - -TEMPLATE = subdirs -CONFIG += ordered - -symbian: { - //:BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " - :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"packetvideoengine/group/bld.inf\"" - :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"vtprotocols/group/bld.inf\"" - :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"vtprotocolplugins/group/bld.inf\"" - :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"vtengines/group/bld.inf\"" - :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"vtuis/lcvtplugin/group/bld.inf\"" - :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"videotelephony_plat/group/bld.inf\"" -} - -SUBDIRS += vtuis/lcvtindicatorplugin -SUBDIRS += vtuis/lcvtindicatorcontroller -SUBDIRS += vtuis/lcvtapp diff -r f15ac8e65a02 -r 779871d1e4f4 videotelephony_plat/group/bld.inf --- a/videotelephony_plat/group/bld.inf Tue Aug 31 15:16:10 2010 +0300 +++ b/videotelephony_plat/group/bld.inf Wed Sep 01 12:29:12 2010 +0100 @@ -18,4 +18,5 @@ +#include "../video_telephony_control_mediator_api/group/bld.inf" #include "../video_telephony_media_configuration_api/group/bld.inf" diff -r f15ac8e65a02 -r 779871d1e4f4 videotelephony_plat/video_telephony_control_mediator_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videotelephony_plat/video_telephony_control_mediator_api/group/bld.inf Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2008 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: File that exports the files belonging to +: Video Telephony Control Mediator API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/videotelcontrolmediatorapi.h APP_LAYER_PLATFORM_EXPORT_PATH( videotelcontrolmediatorapi.h) diff -r f15ac8e65a02 -r 779871d1e4f4 videotelephony_plat/video_telephony_control_mediator_api/inc/videotelcontrolmediatorapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videotelephony_plat/video_telephony_control_mediator_api/inc/videotelcontrolmediatorapi.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2008 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: Video Telephony specific message services sent from Phone +* Application to Video Telephony. +* +*/ + + +#ifndef VIDEOTELCONTROLMEDIATORAPI_H +#define VIDEOTELCONTROLMEDIATORAPI_H + +// INCLUDES +#include + +/** The category UID for the messages in this header file. */ +const TUid KCatPhoneToVideotelCommands = { 0x200159A1 }; + +/** Version number of this API */ +const TInt KPhoneToVideotelCmdVersionMajor( 1 ); +const TInt KPhoneToVideotelCmdVersionMinor( 0 ); +const TInt KPhoneToVideotelCmdVersionBuild( 0 ); + +/** package for passing dataport name to Video Telephony */ +typedef TPckgBuf TDataPortPackage; + +/** Video Telephony related commands. */ +enum TPhoneToVideotelCommands + { + /** + * Commands Video Telephony to enable microphone. + */ + EVtCmdUnmute = 0, + + /** + * Commands Video Telephony to disable microphone. + */ + EVtCmdMute, + + /** + * Commands Video Telephony to use dataport. Command paramemeter is + * TDataPortPackage. This should be called when dataport is loaned. + * When this is sent, dataport recovery is allowed only after + * 1) later issued EVtCmdShutdown response is received. + * 2) call is ended by network/peer (i.e. local phone doesn't do hangup) + * 3) EPhoneCmdEndActiveCall command is received (see Mediator Commands To + * Telephony API) + * Otherwise H.245 (VT) signalling may fail if call is released in two + * stage. + */ + EVtCmdUseDataport, + + EVtCmdReleaseDataport + }; + +#endif // VIDEOTELCONTROLMEDIATORAPI_H + diff -r f15ac8e65a02 -r 779871d1e4f4 videotelephony_plat/video_telephony_control_mediator_api/video_telephony_control_mediator_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videotelephony_plat/video_telephony_control_mediator_api/video_telephony_control_mediator_api.metaxml Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,17 @@ + + + Video Telephony Control Mediator API + An interface for exchanging video telephony related commands (e.g. call initiation and termination) and providing data synchronization (e.g. contact data and audio mute state) between Phone and Video Telephone applications. + c++ + vtengines + + + + + + + + no + no + + diff -r f15ac8e65a02 -r 779871d1e4f4 videotelui.pkg --- a/videotelui.pkg Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -; -; 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: -; -; Languages -&EN - -; Header -#{"videotelui"}, (0x101F8681), 1, 0, 0, TYPE=PU - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -;Files -"\epoc32\release\armv5\urel\videotelui.exe" - "!:\sys\bin\videotelui.exe" -"\epoc32\data\z\resource\apps\videotelui.rsc"-"!:\resource\apps\videotelui.rsc" -"\epoc32\data\z\private\10003a3f\import\apps\videotelui_reg.rsc"-"!:\private\10003a3f\import\apps\videotelui_reg.rsc" diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Inc/Audio/CVtEngAudioHandler.h --- a/vtengines/videoteleng/Inc/Audio/CVtEngAudioHandler.h Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Inc/Audio/CVtEngAudioHandler.h Wed Sep 01 12:29:12 2010 +0100 @@ -31,7 +31,7 @@ // new audio routing #include "TelephonyAudioRouting.h" #include "MTelephonyAudioRoutingObserver.h" -#include +#include #include // FORWARD DECLARATIONS diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Inc/Base/CVtEngAccessoryHandler.h --- a/vtengines/videoteleng/Inc/Base/CVtEngAccessoryHandler.h Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Inc/Base/CVtEngAccessoryHandler.h Wed Sep 01 12:29:12 2010 +0100 @@ -43,7 +43,7 @@ /** * Two-phased constructor. - ? @return instance of CVtEngAccessoryHandler + ¨* @return instance of CVtEngAccessoryHandler */ static CVtEngAccessoryHandler* NewL( ); diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Inc/Extensions/CVtEngExtensions.h --- a/vtengines/videoteleng/Inc/Extensions/CVtEngExtensions.h Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Inc/Extensions/CVtEngExtensions.h Wed Sep 01 12:29:12 2010 +0100 @@ -113,4 +113,4 @@ }; -#endif //CVTENGEXTENSIONS_H \ No newline at end of file +#endif //CVTENGEXTENSIONS_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Inc/Media/CVtEngDrawNGA.h --- a/vtengines/videoteleng/Inc/Media/CVtEngDrawNGA.h Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Inc/Media/CVtEngDrawNGA.h Wed Sep 01 12:29:12 2010 +0100 @@ -243,16 +243,7 @@ /** * Create surface implementation */ - void DoCreateSurfaceL(); - - /** - *clearing a surface buffer to given colour - */ - void ClearSurfacebuffer( - TUint8* aStartAddr, - TInt aOffset, - const RSurfaceManager::TSurfaceInfoV01 aInfo, - TRgb &aColor ); + void DoCreateSurfaceL(); static TInt SurfaceBuffer0Ready(TAny* aAny); diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Inc/Media/CVtEngLocalVideo.h --- a/vtengines/videoteleng/Inc/Media/CVtEngLocalVideo.h Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Inc/Media/CVtEngLocalVideo.h Wed Sep 01 12:29:12 2010 +0100 @@ -32,23 +32,11 @@ #include "CVTEngPubSubsListener.h" #include "mvtengcamerapreferencesobserver.h" -#include "graphics/surfacemanager.h" -#include "graphics/surface.h" -#include "graphics/surfaceupdateclient.h" - // FORWARD DECLARATIONS class CVSDataProvider; class CVtEngMediaHandler; class CVtEngCameraPreferences; - -// LOCAL CONSTANTS -// Default source width. -static const TInt KVtEngLocalVideoDefaultWidth = 176; - -// Default source height. -static const TInt KVtEngLocalVideoDefaultHeight = 144; - // CLASS DECLARATION /** @@ -189,13 +177,6 @@ */ void SetViewFinderParameters( const TVtEngRenderingOptionsDP& aDP ); - - /** - * Sets NGA configuration for view finder. - * @param aNGA NGA configuration - */ - void SetViewFinderParameters( const TVtEngRenderingOptionsNGA &aNGA ); - /** * Sets default still image. */ @@ -559,8 +540,6 @@ ERefreshing }; - private: // inner classes - /** * Provider information. */ @@ -1031,81 +1010,6 @@ }; - // class for NGA rendering viewfinder bitmap. - NONSHARABLE_CLASS( CVtEngVFBitmapNGARender ) : public CActive - { - - public: // constructor and destructor - - /** - * Two-phased constructor. - * @param aObserver call back interface to Display Sink - * @return instance of CVtEngDrawDSA - */ - static CVtEngVFBitmapNGARender * NewL(); - - // Destructor. - ~CVtEngVFBitmapNGARender(); - - public: // New mothod - - // update the buffer for bitmap, also activate this AO - TInt UpdateBitmapL( CFbsBitmap& aFrame ); - - // Initialize surface and set it to the background - TInt AttachSurfaceL( RWsSession *aWs, RWindow *aWindow ); - - private: // constructors - - // C++ constructor. - CVtEngVFBitmapNGARender(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL( ); - - private: // From CActive. - - /* - * @see CActive::RunL - */ - virtual void RunL(); - - /** - * @see CActive::DoCancel() - */ - virtual void DoCancel(); - - private: // enumerations - - enum { EVtEngVFMaxBuffers = 1 }; - - private: // Data - - RSurfaceManager iSurfaceManager; - RSurfaceUpdateSession iSurfaceUpdateSession; - - //Surface pixel format - const TUidPixelFormat iSurfaceFormat; - - RChunk* iSurfaceChunk; - - TUint8* iBuffer; - - //NGA surface id - TSurfaceId iSurfaceId; - - RWsSession *iWs; - RWindow *iWindow; - - //NGA surface has created - TBool iSurfaceCreated; - - TTimeStamp iTimeStamp; - - }; - private: /** @@ -1564,10 +1468,6 @@ // Number of cameras in the device TInt iNumSupportedCameras; - - CVtEngVFBitmapNGARender *iNGARender; - RWindow *iWindow; - RWsSession *iWs; }; #endif // CVTENGLOCALVIDEO_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Inc/Media/TVtEngRenderConfigNGA.inl --- a/vtengines/videoteleng/Inc/Media/TVtEngRenderConfigNGA.inl Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Inc/Media/TVtEngRenderConfigNGA.inl Wed Sep 01 12:29:12 2010 +0100 @@ -40,8 +40,8 @@ iType = ENgaRender; iWsSession = &aOptions.iWs; //iWsSreenDevice = &aOptions.iWsSD; - //iWindow = &aOptions.iWindow; - //iObserver = aOptions.iObserver; + // iWindow = &aOptions.iWindow; + iObserver = aOptions.iObserver; //iRect = aOptions.iRect; //iClipRect = aOptions.iClipRect; //iOffset = aOptions.iOffset; diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Inc/Media/TVtEngRenderingNGA.h --- a/vtengines/videoteleng/Inc/Media/TVtEngRenderingNGA.h Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Inc/Media/TVtEngRenderingNGA.h Wed Sep 01 12:29:12 2010 +0100 @@ -42,6 +42,7 @@ * C++ constructor */ inline TVtEngRenderingOptionsNGA( + MVtEngFrameObserver& aObserver, RWindow& aWindow, RWsSession& aWs ); /** @@ -59,6 +60,9 @@ RWindow& iWindow; RWsSession& iWs; + + // Frame observer + MVtEngFrameObserver* iObserver; }; #include diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Inc/Media/TVtEngRenderingNGA.inl --- a/vtengines/videoteleng/Inc/Media/TVtEngRenderingNGA.inl Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Inc/Media/TVtEngRenderingNGA.inl Wed Sep 01 12:29:12 2010 +0100 @@ -24,9 +24,11 @@ // ----------------------------------------------------------------------------- // inline TVtEngRenderingOptionsNGA::TVtEngRenderingOptionsNGA( + MVtEngFrameObserver& aObserver, RWindow& aWindow, RWsSession& aWs) : iWindow( aWindow ), - iWs( aWs ) + iWs( aWs ), + iObserver( &aObserver ) { } @@ -38,7 +40,8 @@ inline TVtEngRenderingOptionsNGA::TVtEngRenderingOptionsNGA( const TVtEngRenderingOptionsNGA& aOptions ) : iWindow( aOptions.iWindow ), - iWs( aOptions.iWs) + iWs( aOptions.iWs), + iObserver( aOptions.iObserver ) { } // End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Inc/Session/MVtEngSessionInfo.h --- a/vtengines/videoteleng/Inc/Session/MVtEngSessionInfo.h Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Inc/Session/MVtEngSessionInfo.h Wed Sep 01 12:29:12 2010 +0100 @@ -85,12 +85,8 @@ }; enum { KCallNameLength = 50 }; - enum { KCallNumberLength = 50 }; typedef TBuf TCallName; - - typedef TBuf TCallNumber; - /** * CLI data related to a call */ @@ -103,8 +99,6 @@ // indicates if voice call can be made to peer TBool iVoiceCallPossible; - - TCallNumber iCallNumber; }; /** diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Logger/Group/bld.inf --- a/vtengines/videoteleng/Logger/Group/bld.inf Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Logger/Group/bld.inf Wed Sep 01 12:29:12 2010 +0100 @@ -23,7 +23,7 @@ PRJ_EXPORTS ../inc/cvtlogger.h |../../../inc/cvtlogger.h -../inc/vtlogger.hrh |../../../inc/vtlogger.hrh +../inc/VtLogger.hrh |../../../inc/VtLogger.hrh PRJ_MMPFILES ../Group/vtlogger.mmp diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Src/Audio/CVtEngAudioHandler.cpp --- a/vtengines/videoteleng/Src/Audio/CVtEngAudioHandler.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Src/Audio/CVtEngAudioHandler.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -33,7 +33,7 @@ // CONSTANTS // For DevSound initialization -//const TInt KVtEngUidControlHwDevice = 0x10206593; +const TInt KVtEngUidControlHwDevice = 0x10206593; // ============================ MEMBER FUNCTIONS =============================== @@ -55,7 +55,7 @@ // void CVtEngAudioHandler::ConstructL() { - __VTPRINT( DEBUG_CONSTRUCT | DEBUG_AUDIO, "AH.ConstructL<" ) + __VTPRINT( DEBUG_CONSTRUCT | DEBUG_AUDIO, "AH.ConstructL" ) iAccHandler = &CVtEngUtility::AccessoryHandler(); iAccHandler->RegisterObserverL( this ); @@ -67,7 +67,7 @@ __VTPRINT2( DEBUG_AUDIO, "AH.iAccMode %d", ( TInt )iAccMode.iAccessoryMode ) UpdateCurrentVolume(); - __VTPRINT( DEBUG_CONSTRUCT | DEBUG_AUDIO, "AH.ConstructL>") + __VTPRINT( DEBUG_CONSTRUCT | DEBUG_AUDIO, "AH.ConstructL<") } // ----------------------------------------------------------------------------- diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Src/Base/CVtEngDeviceLockMonitor.cpp --- a/vtengines/videoteleng/Src/Base/CVtEngDeviceLockMonitor.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Src/Base/CVtEngDeviceLockMonitor.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -58,20 +58,20 @@ TInt state = EAutolockStatusUninitialized; - // Get autolock state - TInt err = iAutolockListener->Get( state ); + // Get autolock state + TInt err = iAutolockListener->Get( state ); - __VTPRINT2( DEBUG_GEN, "LockMonitor Get err: %d", err ); - __VTPRINT2( DEBUG_GEN, "LockMonitor state: %d", state ); - - if( err == KErrNone ) + __VTPRINT2( DEBUG_GEN, "LockMonitor Get err: %d", err ); + __VTPRINT2( DEBUG_GEN, "LockMonitor state: %d", state ); + + // Recognize the uninitialized state as autolock on, or the VT will be wrongly shown when startup & lock is on. + if( err == KErrNone ) { const TInt event = - ( state <= EAutolockOff ) ? + ( state == EAutolockOff ) ? KVtEngDeviceLockOff : KVtEngDeviceLockOn; - CVtEngEventManager::NotifyEvent( event ); - } - + CVtEngEventManager::NotifyEvent( event ); + } __VTPRINTEXIT( "LockMonitor.NotifyState" ) } diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Src/Base/CVtEngSettings.cpp --- a/vtengines/videoteleng/Src/Base/CVtEngSettings.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Src/Base/CVtEngSettings.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -24,8 +24,8 @@ #include "VtEngUtils.h" #include "VtEngPanic.h" #include -#include -#include +#include +#include #include #include #include @@ -897,7 +897,6 @@ iCLI.iName = aCLI.iName; iCLI.iVoiceCallPossible = aCLI.iVoiceCallPossible; iCLI.iValid = ETrue; - iCLI.iCallNumber = aCLI.iCallNumber; __VTPRINT2( DEBUG_GEN, "iVoiceCallPossible=%d,", iCLI.iVoiceCallPossible ) __VTPRINTEXIT( "Settings.SetCLI" ) } @@ -912,7 +911,6 @@ aCLI.iCallId = iCLI.iCallId; aCLI.iVoiceCallPossible = iCLI.iVoiceCallPossible; aCLI.iName = iCLI.iName; - aCLI.iCallNumber = iCLI.iCallNumber; return iCLI.iValid; } diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Src/Base/cvtengmdtrmessagelistener.cpp --- a/vtengines/videoteleng/Src/Base/cvtengmdtrmessagelistener.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Src/Base/cvtengmdtrmessagelistener.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -160,7 +160,6 @@ cli.iCallId = data.iCallId; cli.iName = data.iDisplayText.Left( cli.iName.MaxLength() ); cli.iVoiceCallPossible = data.iVoiceCallPossible; - cli.iCallNumber = data.iPhoneNumText.Left( cli.iCallNumber.MaxLength() ); settings.SetCLI( cli ); // ready == call is answered (allows setting app to foreground) diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Src/Media/CVtEngDrawNGA.cpp --- a/vtengines/videoteleng/Src/Media/CVtEngDrawNGA.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Src/Media/CVtEngDrawNGA.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -110,10 +110,7 @@ { iConfig.iRemoteWindow->RemoveBackgroundSurface(ETrue); iConfig.iWsSession->UnregisterSurface(0, iSurfaceId); - if ( iSurfaceChunk != NULL ) - { - iSurfaceChunk->Close(); - } + iSurfaceChunk->Close(); delete iSurfaceChunk; iSurfaceChunk = NULL; iSurfaceManager->CloseSurface(iSurfaceId); @@ -121,13 +118,10 @@ iSurfaceUpdateSession.Close(); /* Close the surface manager handle */ - if ( iSurfaceManager != NULL ) - { - iSurfaceManager->Close(); - } + iSurfaceManager->Close(); delete iSurfaceManager; - iSurfaceManager = NULL; + iSurfaceManager = 0; } for ( TInt i = KVtEngMaxSurfaceBuffers-1; i >= 0 ; i-- ) @@ -146,7 +140,6 @@ iSurfaceBuffer1.UnSet(); } delete iBufferWaiter; - iBufferWaiter = NULL; iWaitingBuffers.Reset(); __VTPRINTEXIT( "RVD(NGA).~" ) @@ -440,12 +433,8 @@ iSurfaceManager->GetBufferOffset(iSurfaceId, 1, offset); iSurfaceBuffer1.Set(iSurfaceChunk->Base() + offset, 1 ); - iConfig.iWsSession->RegisterSurface(0, iSurfaceId); - TSurfaceConfiguration surfaceConfig; - surfaceConfig.SetSurfaceId( iSurfaceId ); - surfaceConfig.SetOrientation( CFbsBitGc::EGraphicsOrientationRotated270); - iConfig.iRemoteWindow->SetBackgroundSurface( surfaceConfig, ETrue ); - //iConfig.iRemoteWindow->SetBackgroundSurface(iSurfaceId); + iConfig.iWsSession->RegisterSurface(0, iSurfaceId); + iConfig.iRemoteWindow->SetBackgroundSurface(iSurfaceId); iCallBackTable[0] = new(ELeave) CActiveCallBack( TCallBack(SurfaceBuffer0Ready, this), @@ -750,35 +739,20 @@ User::LeaveIfError(err); // Get the info from the surfaceManager - RSurfaceManager::TInfoBuf infoBuf; - err = iSurfaceManager->SurfaceInfo( iSurfaceId, infoBuf ); - User::LeaveIfError(err); - RSurfaceManager::TSurfaceInfoV01 info = infoBuf(); - - __VTPRINT2( DEBUG_MEDIA, "chunk size=%d", iSurfaceChunk->Size() ) - - TRgb color( 0, 0, 0 ); - + RSurfaceManager::TInfoBuf info; + err = iSurfaceManager->SurfaceInfo(iSurfaceId, info); + User::LeaveIfError(err); + TInt offset; - - iSurfaceManager->GetBufferOffset( iSurfaceId, 0, offset ); - __VTPRINT2( DEBUG_MEDIA, "offset0=%d", offset ) - ClearSurfacebuffer( iSurfaceChunk->Base(), offset, info, color ); + iSurfaceManager->GetBufferOffset(iSurfaceId, 0, offset); iSurfaceBuffer0.Set(iSurfaceChunk->Base() + offset, 0 ); - - iSurfaceManager->GetBufferOffset( iSurfaceId, 1, offset ); - __VTPRINT2( DEBUG_MEDIA, "offset1=%d", offset ) - ClearSurfacebuffer( iSurfaceChunk->Base(), offset, info, color ); + iSurfaceManager->GetBufferOffset(iSurfaceId, 1, offset); iSurfaceBuffer1.Set(iSurfaceChunk->Base() + offset, 1 ); } iConfig.iWsSession->RegisterSurface(0, iSurfaceId); - TSurfaceConfiguration surfaceConfig; - surfaceConfig.SetSurfaceId( iSurfaceId ); - surfaceConfig.SetOrientation( CFbsBitGc::EGraphicsOrientationRotated270); - iConfig.iRemoteWindow->SetBackgroundSurface( surfaceConfig, ETrue ); - //iConfig.iRemoteWindow->SetBackgroundSurface(iSurfaceId); - + iConfig.iRemoteWindow->SetBackgroundSurface(iSurfaceId); + iConfig.iRemoteWindow->BeginRedraw(); iConfig.iRemoteWindow->EndRedraw(); @@ -797,54 +771,6 @@ ClearFlag( EInitializePostingSurfaceCalled ); __VTPRINTEXIT( "RVD(NGA).DoCreateSurfaceL" ) } - -// ----------------------------------------------------------------------------- -// CVtEngDrawNGA::ClearSurface -// clearing a surface buffer to given colour -// ----------------------------------------------------------------------------- -// -void CVtEngDrawNGA::ClearSurfacebuffer( - TUint8* aStartAddr, - TInt aOffset, - const RSurfaceManager::TSurfaceInfoV01 aInfo, - TRgb &aColor ) -{ - TUint8 red = aColor.Red(); - TUint8 green = aColor.Green(); - TUint8 blue = aColor.Blue(); - - // formulae borrowed from http://msdn.microsoft.com/en-us/library/ms893078.aspx - TUint8 yval = ( ( 66 * (TInt32)red + 129 * (TInt32)green + 25 * (TInt32)blue + 128) >> 8) + 16; - TUint8 uval = ( ( -38 * (TInt32)red - 74 * (TInt32)green + 112 * (TInt32)blue + 128) >> 8) + 128; - TUint8 vval = ( ( 112 * (TInt32)red - 94 * (TInt32)green - 18 * (TInt32)blue + 128) >> 8) + 128; - - TInt i = 0; - - aStartAddr += aOffset; - - while ( i < (aInfo.iSize.iHeight*aInfo.iSize.iWidth) ) - { - *aStartAddr = yval; - aStartAddr++; - i++; - } - i=0; - - while ( i < ((aInfo.iSize.iHeight*aInfo.iSize.iWidth)>>2) ) - { - *aStartAddr = uval; - aStartAddr++; - i++; - } - i=0; - - while ( i < ((aInfo.iSize.iHeight*aInfo.iSize.iWidth)>>2) ) - { - *aStartAddr = vval; - aStartAddr++; - i++; - } -} // ----------------------------------------------------------------------------- // CVtEngDrawNGA::DoUpdateSinkParamsL diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Src/Media/CVtEngLocalVideo.cpp --- a/vtengines/videoteleng/Src/Media/CVtEngLocalVideo.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Src/Media/CVtEngLocalVideo.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -33,10 +33,6 @@ #include #include #include -#include -#include -#include -#include #include "CVtEngCameraPreferences.h" @@ -98,8 +94,6 @@ iAsyncCallBack = new ( ELeave ) CAsyncCallBack( TCallBack( CallBackFunc, this ), EPriorityStandard ); - iNGARender = CVtEngVFBitmapNGARender::NewL(); - TInt indexMobile( KErrNotFound ); iShareImage = CVtEngShareImage::NewL( *this ); iSourceController = CVSController::NewL( this ); @@ -374,9 +368,6 @@ delete iSourceController; DeleteAudioSource(); delete iShareImage; - - delete iNGARender; - __VTPRINTEXIT( "LocVid.~" ) } @@ -842,11 +833,8 @@ if ( iActiveProvider && iActiveProvider->iType != KVtEngProviderNone ) { -#if 0 TRAP_IGNORE( iOptions.iObserver->vtHandleFrameL( MVtEngFrameObserver::ELocalVideoFrame, &aFrame ) ); -#endif - iNGARender->UpdateBitmapL( aFrame ); } __VTPRINTEXIT( "LocVid.vsViewFinderFrameReady" ) } @@ -1122,34 +1110,6 @@ } // ----------------------------------------------------------------------------- -// CVtEngLocalVideo::SetViewFinderParameters -// Configures parameters for rendering with NGA. -// ----------------------------------------------------------------------------- -// -void CVtEngLocalVideo::SetViewFinderParameters( - const TVtEngRenderingOptionsNGA &aNGA ) - { - __VTPRINTENTER( "LocVid.SetVFParamsNGA" ) - - // Before setting the params, stop VF - if( ViewFinderStarted() ) - { - StopViewFinder(); - } - - iOptions.iSize.SetSize( KVtEngLocalVideoDefaultWidth, - KVtEngLocalVideoDefaultHeight ); - - iWindow = &aNGA.iWindow; - iWs = &aNGA.iWs; - - iRenderingMethod = EWindowServer; - - iNGARender->AttachSurfaceL( iWs, iWindow ); - __VTPRINTEXIT( "LocVid.SetVFParamsNGA" ) - } - -// ----------------------------------------------------------------------------- // CVtEngLocalVideo::SetDefaultStillImageL // Sets default still image. // ----------------------------------------------------------------------------- @@ -1924,10 +1884,8 @@ iActiveProvider->iProvider && iActiveProvider->iProvider->ViewFinderActive() ) { -#if 0 TRAP_IGNORE( iOptions.iObserver->vtHandleFrameL( MVtEngFrameObserver::ELocalVideoFrame, NULL ) ); -#endif iActiveProvider->iProvider->StopViewFinder(); __VTPRINT( DEBUG_MEDIA, "LocVideo.stopVF Stopped" ) if ( IsFlag( EFlagAutomaticSwitchCallback ) || @@ -4542,224 +4500,6 @@ } // ----------------------------------------------------------------------------- -// CVtEngLocalVideo::CVtEngVFBitmapNGARender::NewL -// ----------------------------------------------------------------------------- -// -CVtEngLocalVideo::CVtEngVFBitmapNGARender * -CVtEngLocalVideo::CVtEngVFBitmapNGARender::NewL() - { - CVtEngVFBitmapNGARender* self - = new ( ELeave ) CVtEngVFBitmapNGARender(); - CleanupStack::PushL( self ); - self->ConstructL( ); - CleanupStack::Pop(); - return self; - } - -// ----------------------------------------------------------------------------- -// CVtEngLocalVideo::CVtEngVFBitmapNGARender::~CVtEngVFBitmapNGARender -// ----------------------------------------------------------------------------- -// -CVtEngLocalVideo::CVtEngVFBitmapNGARender::~CVtEngVFBitmapNGARender() - { - __VTPRINTENTER( "LocVid.NGARender.~" ) - Cancel(); - - if ( iSurfaceCreated ) - { - iWindow->RemoveBackgroundSurface(ETrue); - iWs->UnregisterSurface(0, iSurfaceId); - - iSurfaceManager.CloseSurface(iSurfaceId); - iSurfaceChunk->Close(); - delete iSurfaceChunk; - iSurfaceChunk = NULL; - - iSurfaceManager.Close(); - - iSurfaceUpdateSession.CancelAllUpdateNotifications(); - iSurfaceUpdateSession.Close(); - } - - __VTPRINTEXIT( "LocVid.NGARender.~" ) - } - -// ----------------------------------------------------------------------------- -// CVtEngLocalVideo::CVtEngVFBitmapNGARender::UpdateBitmap -// ----------------------------------------------------------------------------- -// -TInt CVtEngLocalVideo::CVtEngVFBitmapNGARender::UpdateBitmapL( CFbsBitmap& aFrame ) - { - __VTPRINTENTER( "LocVid.NGARender.UpdateBitmapL" ) - // do nothing if we're already active, the newer bitmap will be ignored. - if ( IsActive() ) - { - __VTPRINTEXIT( "LocVid.NGARender.UpdateBitmapL 0" ) - return KErrNone; - } - else - { - if ( !iSurfaceCreated ) - { - User::Leave( KErrNotReady ); - } - aFrame.BeginDataAccess(); - __VTPRINT2( DEBUG_MEDIA, "LocVid.NGARender.bitmap size = %d", aFrame.DataSize() ); -#if 0 - memcpy( iBuffer, aFrame.DataAddress(), aFrame.DataSize() ); -#else - TInt size = aFrame.DataSize(); - TPtr8 ptrBuffer( iBuffer, size ); - ptrBuffer.Copy( reinterpret_cast(aFrame.DataAddress()), size ); -#endif - __VTPRINT( DEBUG_MEDIA, "LocVid.NGARender.bitmap step 1" ); - aFrame.EndDataAccess(); - __VTPRINT( DEBUG_MEDIA, "LocVid.NGARender.bitmap step 2" ); - iStatus = KRequestPending; - SetActive(); - __VTPRINT( DEBUG_MEDIA, "LocVid.NGARender.bitmap step 3" ); - iSurfaceUpdateSession.NotifyWhenDisplayed( iStatus, iTimeStamp ); - __VTPRINT( DEBUG_MEDIA, "LocVid.NGARender.bitmap step 4" ); - iSurfaceUpdateSession.SubmitUpdate( KAllScreens, iSurfaceId, 0, NULL ); - __VTPRINT( DEBUG_MEDIA, "LocVid.NGARender.bitmap step 5" ); - - __VTPRINTEXIT( "LocVid.NGARender.UpdateBitmapL 1" ) - - return KErrNone; - } - } - -// ----------------------------------------------------------------------------- -// CVtEngLocalVideo::CVtEngVFBitmapNGARender::CreateSurfaceL -// ----------------------------------------------------------------------------- -// -TInt CVtEngLocalVideo::CVtEngVFBitmapNGARender::AttachSurfaceL( - RWsSession *aWs, - RWindow *aWindow ) - { - __VTPRINTENTER( "LocVid.NGARender.AttachSurfaceL" ) - - if ( aWs == NULL || aWindow == NULL ) - { - User::Leave( KErrArgument ); - } - - if(iSurfaceCreated) - return KErrNone; - - if ( !iSurfaceCreated ) - { - TInt err; - - err = iSurfaceUpdateSession.Connect(); - User::LeaveIfError(err); - - err = iSurfaceManager.Open(); - User::LeaveIfError(err); - - RSurfaceManager::TSurfaceCreationAttributesBuf attributes; - attributes().iPixelFormat = iSurfaceFormat; - attributes().iSize.SetSize( KVtEngLocalVideoDefaultWidth, - KVtEngLocalVideoDefaultHeight ); - attributes().iBuffers = EVtEngVFMaxBuffers; - attributes().iStride = attributes().iSize.iWidth*4; - attributes().iOffsetToFirstBuffer = 0; - attributes().iAlignment = 4; - attributes().iContiguous = EFalse; - attributes().iMappable = ETrue; - - err = iSurfaceManager.CreateSurface( attributes, iSurfaceId ); - User::LeaveIfError( err ); - - // Map to chunk - iSurfaceChunk = new RChunk(); - User::LeaveIfNull( iSurfaceChunk ); - err = iSurfaceManager.MapSurface( iSurfaceId, *iSurfaceChunk ); - User::LeaveIfError( err ); - - // Get the info from the surfaceManager - RSurfaceManager::TInfoBuf info; - err = iSurfaceManager.SurfaceInfo( iSurfaceId, info ); - User::LeaveIfError( err ); - - TInt offset; - iSurfaceManager.GetBufferOffset( iSurfaceId, 0, offset ); - iBuffer = iSurfaceChunk->Base() + offset; - - iSurfaceCreated = ETrue; - } - else - { - if ( iWs == NULL || iWindow == NULL ) - { - User::Leave( KErrGeneral ); - } - - iWindow->RemoveBackgroundSurface(ETrue); - iWs->UnregisterSurface(0, iSurfaceId); - - __VTPRINT( DEBUG_MEDIA, "LocVid.NGARender.Surface exists, detach first!" ) - } - - iWs = aWs; - iWindow = aWindow; - iWs->RegisterSurface( 0, iSurfaceId ); - - TSurfaceConfiguration surfaceConfig; - surfaceConfig.SetSurfaceId( iSurfaceId ); - surfaceConfig.SetOrientation( CFbsBitGc::EGraphicsOrientationRotated270); - iWindow->SetBackgroundSurface( surfaceConfig, ETrue ); - //iWindow->SetBackgroundSurface( iSurfaceId ); - - __VTPRINTEXIT( "LocVid.NGARender.AttachSurfaceL" ) - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CVtEngLocalVideo::CVtEngVFBitmapNGARender::~CVtEngVFBitmapNGARender -// ----------------------------------------------------------------------------- -// -CVtEngLocalVideo::CVtEngVFBitmapNGARender::CVtEngVFBitmapNGARender() - : CActive( CActive::EPriorityStandard ), - iSurfaceFormat( EUidPixelFormatXRGB_8888 ) - { - iSurfaceCreated = EFalse; - - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CVtEngLocalVideo::CVtEngVFBitmapNGARender::ConstructL -// ----------------------------------------------------------------------------- -// -void CVtEngLocalVideo::CVtEngVFBitmapNGARender::ConstructL( ) - { - __VTPRINTENTER( "LocVid.NGARender.ConstructL" ) - __VTPRINTEXIT( "LocVid.NGARender.ConstructL" ) - } - -// ----------------------------------------------------------------------------- -// CVtEngLocalVideo::CVtEngVFBitmapNGARender::RunL -// ----------------------------------------------------------------------------- -// -void CVtEngLocalVideo::CVtEngVFBitmapNGARender::RunL() - { - __VTPRINTENTER( "LocVid.NGARender.RunL" ) - __VTPRINTEXIT( "LocVid.NGARender.RunL" ) - } - -// ----------------------------------------------------------------------------- -// CVtEngLocalVideo::CVtEngVFBitmapNGARender::DoCancel -// ----------------------------------------------------------------------------- -// -void CVtEngLocalVideo::CVtEngVFBitmapNGARender::DoCancel() - { - __VTPRINTENTER( "LocVid.NGARender.DoCancel" ) - __VTPRINTEXIT( "LocVid.NGARender.DoCancel" ) - } - -// ----------------------------------------------------------------------------- // CVtEngLocalVideo::CreateCameraPreferencesL // ----------------------------------------------------------------------------- // diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp --- a/vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -82,7 +82,7 @@ const TInt KVtEngCharacterEndLine( 10 ); // Multiplex delay in milliseconds -//const TInt KVtEngMultiplexingDelay = 150; +const TInt KVtEngMultiplexingDelay = 150; // TradeOff values const TInt KVtEngTradeOffDetailMax = 9; @@ -802,10 +802,10 @@ break; case KVtEngPrepareViewFinder: { - const TPckgC& pckg = - static_cast< const TPckgC& > + const TPckgC& pckg = + static_cast< const TPckgC& > ( *aOperation.Parameters() ); - const TVtEngRenderingOptionsNGA &options = pckg(); + const TVtEngRenderingOptions& options = pckg(); iLocalVideo->SetViewFinderParameters( options ); } break; @@ -3891,19 +3891,21 @@ const TVtCommandResponse& aResponse ) { __VTPRINTENTER( "MH.EncExtCommandCompleted" ) - - __VTPRINT2( DEBUG_MEDIA, "MH.263 ComC type=%d", aResponse.iCmdType ) + const TInt type( aResponse.iCmdType ); + const TInt protoCmdId( aResponse.iCmdId ); + const TInt protoResponse( aResponse.iCmdStatus ); + __VTPRINT2( DEBUG_MEDIA, "MH.263 ComC type=%d", type ) __VTPRINT3( DEBUG_MEDIA, "MH.263 ComC cmdId=%d,response=%d", - aResponse.iCmdId, aResponse.iCmdStatus ) + protoCmdId, protoResponse ) // Find correct entry in iPendingOps based on TOperation because there can // be several entries with same Protocol cmd id since each Protocol interface has their // own id allocation and ids may overlap. TInt index( KErrNotFound ); TOperation completedOp = ENone; - if ( MatchResponseToPendingOps( aResponse.iCmdId, ESendIntraframe, &index ) || - MatchResponseToPendingOps( aResponse.iCmdId, ESetIFrameInterval, &index ) || - MatchResponseToPendingOps( aResponse.iCmdId, ESetVideoQuality, &index ) ) + if ( MatchResponseToPendingOps( protoCmdId, ESendIntraframe, &index ) || + MatchResponseToPendingOps( protoCmdId, ESetIFrameInterval, &index ) || + MatchResponseToPendingOps( protoCmdId, ESetVideoQuality, &index ) ) { // TOperation entries in are unique in the array... const TCmdOpPair pair = (*iPendingOps)[ index ]; @@ -3920,13 +3922,13 @@ __VTPRINT( DEBUG_MEDIA, "MH.EECC ESetVideoQuality" ) if( iPendingOp && ( iPendingOp->Command() == KVtEngSetVideoQuality ) ) { - CompleteOp( aResponse.iCmdStatus ); + CompleteOp( protoResponse ); } - if( aResponse.iCmdStatus == KErrNone ) + if( protoResponse == KErrNone ) { TVtEngVideoQuality::TVQSParams vqp; - if ( iVideoQuality.SettingSucceeded( aResponse.iCmdId, vqp ) ) + if ( iVideoQuality.SettingSucceeded( protoCmdId, vqp ) ) { __VTPRINT( DEBUG_MEDIA, "MH.EECC sending vq indication" ) AddOperation( ESendVTSTO, @@ -3942,7 +3944,7 @@ } else { - iVideoQuality.SettingFailed( aResponse.iCmdId ); + iVideoQuality.SettingFailed( protoCmdId ); } } if ( iProtoState == MVtProtocolCommand::EIdle ) @@ -3959,7 +3961,8 @@ void CVtEngMediaHandler::HandleVideoEncoderInformationalEventL( const TVtIndicationEvent& aEvent) { - __VTPRINT2( DEBUG_MEDIA, "MH.263 infoevent=%d", aEvent.iEventType ) + const TInt type( aEvent.iEventType ); + __VTPRINT2( DEBUG_MEDIA, "MH.263 infoevent=%d", type ) } // ----------------------------------------------------------------------------- @@ -3971,17 +3974,20 @@ const TVtCommandResponse& aResponse ) { __VTPRINTENTER( "MH.HandleH324MConfigCommandCompletedL" ) - - __VTPRINT2( DEBUG_MEDIA, "MH.HandleH324MConfigCommandCompletedL type=%d", aResponse.iCmdType ) - __VTPRINT3( DEBUG_MEDIA, "MH.HandleH324MConfigCommandCompletedL cmdId=%d,response=%d", aResponse.iCmdId, aResponse.iCmdStatus ) + const TInt protoCmdId( aResponse.iCmdId ); + const TInt protoResponse( aResponse.iCmdStatus ); + const TInt type( aResponse.iCmdType ); + + __VTPRINT2( DEBUG_MEDIA, "MH.HandleH324MConfigCommandCompletedL type=%d", type ) + __VTPRINT3( DEBUG_MEDIA, "MH.HandleH324MConfigCommandCompletedL cmdId=%d,response=%d", protoCmdId, protoResponse ) TInt index( KErrNotFound ); // Find correct entry in iPendingOps based on TOperation because there can // be several entries with same Protocol cmd id since each Protocol interface has their // own id allocation and ids may overlap. - if ( MatchResponseToPendingOps( aResponse.iCmdId, ESetVendorId, &index ) || - MatchResponseToPendingOps( aResponse.iCmdId, ESendVTSTO, &index ) || - MatchResponseToPendingOps( aResponse.iCmdId, ESetSupportedResolutions, &index ) || - MatchResponseToPendingOps( aResponse.iCmdId, ESetFastCsupOptions, &index ) ) + if ( MatchResponseToPendingOps( protoCmdId, ESetVendorId, &index ) || + MatchResponseToPendingOps( protoCmdId, ESendVTSTO, &index ) || + MatchResponseToPendingOps( protoCmdId, ESetSupportedResolutions, &index ) || + MatchResponseToPendingOps( protoCmdId, ESetFastCsupOptions, &index ) ) { // TOperation entries in are unique in the array... const TCmdOpPair pair = (*iPendingOps)[ index ]; @@ -3996,10 +4002,10 @@ // Check does the received command ID match to command ID that was received // from Protocol when DTMF was send. - if( stateManager->Handlers().Dtmf().CheckCommandId( aResponse.iCmdId ) ) + if( stateManager->Handlers().Dtmf().CheckCommandId( protoCmdId ) ) { __VTPRINT( DEBUG_MEDIA, "MH.Complete DTMF" ) - stateManager->Handlers().Dtmf().SendComplete( aResponse.iCmdStatus ); + stateManager->Handlers().Dtmf().SendComplete( protoResponse ); } } break; diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/vtmediatorplugin/inc/vtinternalmediatorapi.h --- a/vtengines/vtmediatorplugin/inc/vtinternalmediatorapi.h Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/vtmediatorplugin/inc/vtinternalmediatorapi.h Wed Sep 01 12:29:12 2010 +0100 @@ -41,8 +41,7 @@ struct TVtVideoTelephonyCallInformation { /** Max length of display text */ - enum { TDisplayTextMaxLength = 100 }; - enum { TPhoneNumMaxLength = 100 }; + enum { TDisplayTextMaxLength = 100 }; /** Display text type definition */ typedef TBuf TDisplayText; @@ -68,12 +67,6 @@ EDisplayTextValid = 0x01, EDataportValid = 0x02 }; - - /** Display text type definition */ - typedef TBuf TPhoneNumText; - - /** Remote end CLI identifier (name/number/call id) */ - TPhoneNumText iPhoneNumText; /** Event data validity */ TUint iEventDataValidity; diff -r f15ac8e65a02 -r 779871d1e4f4 vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp --- a/vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -620,7 +620,6 @@ { iVtCallInfo.iVoiceCallPossible = ETrue; } - iVtCallInfo.iPhoneNumText = aData.iRemotePhoneNumber; iVtCallInfo.iEventDataValidity |= TVtVideoTelephonyCallInformation::EDisplayTextValid; TRACE2("CVtMediatorPlugin.SaveCallData data saved=%d>", diff -r f15ac8e65a02 -r 779871d1e4f4 vtprotocolplugins/DisplaySink/group/bld.inf --- a/vtprotocolplugins/DisplaySink/group/bld.inf Tue Aug 31 15:16:10 2010 +0300 +++ b/vtprotocolplugins/DisplaySink/group/bld.inf Wed Sep 01 12:29:12 2010 +0100 @@ -25,7 +25,7 @@ PRJ_EXPORTS -../inc/cvtimageconverter.h |../../../inc/cvtimageconverter.h +../inc/CVtImageConverter.h |../../../inc/cvtimageconverter.h ../inc/cvtimageconverter.inl |../../../inc/cvtimageconverter.inl ../inc/mdisplaysink.h |../../../inc/mdisplaysink.h ../inc/TDisplaySinkParamsDSA.h |../../../inc/tdisplaysinkparamsdsa.h diff -r f15ac8e65a02 -r 779871d1e4f4 vtprotocolplugins/DisplaySink/src/CVtImageConverter.cpp --- a/vtprotocolplugins/DisplaySink/src/CVtImageConverter.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtprotocolplugins/DisplaySink/src/CVtImageConverter.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -20,7 +20,7 @@ #include #include -#include "cvtimageconverter.h" +#include "CVtImageConverter.h" // LOCAL CONSTANTS AND MACROS diff -r f15ac8e65a02 -r 779871d1e4f4 vtprotocolplugins/VideoSource/src/CVSOnboardCameraDataProvider.cpp --- a/vtprotocolplugins/VideoSource/src/CVSOnboardCameraDataProvider.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtprotocolplugins/VideoSource/src/CVSOnboardCameraDataProvider.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -824,7 +824,7 @@ { __IF_DEBUG(Print(_L("VideoSource [%d]: CVSOnboardCameraDataProvider::HandleEvent() event %d>>"), RThread().Id().operator TUint(), aEvent.iEventType )); - __IF_DEBUG(Print(_L("VideoSource [%d]: CVSOnboardCameraDataProvider::HandleEvent() iErrorCode %d>"), + __IF_DEBUG(Print(_L("VideoSource [%d]: CVSOnboardCameraDataProvider::HandleEvent() iErrorCode %d>"), RThread().Id().operator TUint(), aEvent.iErrorCode )); //Needs to handled first if( aEvent.iEventType == KUidECamEventCameraNoLongerReserved ) diff -r f15ac8e65a02 -r 779871d1e4f4 vtprotocolplugins/VideoSource/src/CVSStillImageDataProvider.cpp --- a/vtprotocolplugins/VideoSource/src/CVSStillImageDataProvider.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtprotocolplugins/VideoSource/src/CVSStillImageDataProvider.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -22,8 +22,8 @@ #include #include #include -#include -#include +#include +#include #include #include "CVSStillImageDataProvider.h" @@ -327,7 +327,7 @@ iActiveWait = new (ELeave) CVSActiveWait< CVSStillImageDataProvider > ( this ); //Create viewer - iViewer = CMultiframeProvider::NewL( this , iDisplayMode ); + iViewer = CMultiframeProvider::NewL( this , EColor16MU/*iDisplayMode*/ ); User::LeaveIfError( iFreezeCS.CreateLocal() ); __IF_DEBUG(Print(_L("VideoSource [%d]: CVSStillImageDataProvider::CommonInitializeL() <<"), RThread().Id().operator TUint())); @@ -805,7 +805,7 @@ // SourceThreadLogoff() if a switch is pending if( iProtoTimer && ( iPSState == EPSPlaying ) ) { - iProtoTimer->After( iProtoUpdateRate, &CVSStillImageDataProvider::ProtoTimer ); + iProtoTimer->After( iProtoUpdateRate, &ProtoTimer ); } __IF_DEBUG(Print(_L("VideoSource[%d]: CVSStillImageDataProvider::ProtoTimer() this %x <<"), RThread().Id().operator TUint(), this)); } @@ -894,8 +894,7 @@ CWsScreenDevice* wsScreenDevice = new ( ELeave ) CWsScreenDevice( wsSession ); CleanupStack::PushL( wsScreenDevice ); User::LeaveIfError( wsScreenDevice->Construct() ); - //iDisplayMode = wsScreenDevice->DisplayMode();/* = EColor16MU;*/ - iDisplayMode = EColor16MU; + iDisplayMode = wsScreenDevice->DisplayMode();/* = EColor16MU;*/ CleanupStack::PopAndDestroy( 2 ); // wsSession, wsScreenDevice __IF_DEBUG(Print(_L("VideoSource [%d]: CVSStillImageDataProvider::ConstructL() this %x <<"), RThread().Id().operator TUint(), this)); } @@ -1097,7 +1096,7 @@ // has beed aquired and play state is on if ( ( iTargetSize == iVFBitmap->Size() ) && ( iVFState == EVFPlaying ) ) { - iVFTimer->After( 1, &CVSStillImageDataProvider::VFTimer ); + iVFTimer->After( 1, &VFTimer ); } else { diff -r f15ac8e65a02 -r 779871d1e4f4 vtprotocolplugins/VideoSource/src/cmultiframeprovider.cpp --- a/vtprotocolplugins/VideoSource/src/cmultiframeprovider.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtprotocolplugins/VideoSource/src/cmultiframeprovider.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -19,8 +19,8 @@ // INCLUDE FILES #include #include -#include -#include +#include +#include #include #include "cmultiframeprovider.h" @@ -233,7 +233,7 @@ } iGSImage = ETrue; iCount = 1; - iActiveWaitInit->InitializeWaiter( &CMultiframeProvider::ConversionFinished ); + iActiveWaitInit->InitializeWaiter( &ConversionFinished ); iActiveWaitInit->Signal( KErrNone ); } else @@ -275,7 +275,7 @@ CleanupStack::PopAndDestroy(); // tempBitmap tempBitmap = 0; - iActiveWaitInit->InitializeWaiter( &CMultiframeProvider::BMSScalingFinished ); + iActiveWaitInit->InitializeWaiter( &BMSScalingFinished ); iActiveWaitInit->Signal( KErrNone ); __IF_DEBUG(Print(_L("VideoSource [%d]: CMultiframeProvider::IniatializeBlank() <<"), RThread().Id().operator TUint())); } @@ -517,7 +517,7 @@ iDefaultImageFile.Close(); if ( aError == KErrNone ) { - iActiveWaitInitScale->InitializeWaiter( &CMultiframeProvider::BMSScalingFinished ); + iActiveWaitInitScale->InitializeWaiter( &BMSScalingFinished ); if ( iGSImage ) { __IF_DEBUG(Print(_L("VideoSource[%d]: CMultiframeProvider::ConversionFinished() scale GS "), RThread().Id().operator TUint())); @@ -579,12 +579,12 @@ } // Allways inform Decoding problems else - { + { iObserver->NotifyImageHandlingError( aError ); delete iTempBM; - delete iMask; - iMask = NULL; - iTempBM = NULL; + delete iMask; + iMask = NULL; + iTempBM = NULL; // GIF used when error happen if ( iCount > 1 ) { @@ -686,7 +686,7 @@ { //ScaleCopy is not running, Jump ScaleCopy __IF_DEBUG(Print(_L("VideoSource[%d]: CMultiframeProvider::VFScalingReady()jump ScaleCopy>>"), RThread().Id().operator TUint())); - iActiveWaitScale->InitializeWaiter( &CMultiframeProvider::VFRescalingFinished ); + iActiveWaitScale->InitializeWaiter( &VFRescalingFinished ); iActiveWaitScale->Signal(KErrNone); } } @@ -729,7 +729,7 @@ else { __IF_DEBUG(Print(_L("VideoSource [%d]: CMultiframeProvider::ScaleCopy(): scaling NOW"), RThread().Id().operator TUint())); - iActiveWaitScale->InitializeWaiter( &CMultiframeProvider::VFRescalingFinished ); + iActiveWaitScale->InitializeWaiter( &VFRescalingFinished ); TInt result( iVFbitmap->Bitmap().Resize( aSize ) ); __IF_DEBUG(Print(_L("VideoSource [%d]: CMultiframeProvider::ScaleCopy() result %d <<"), RThread().Id().operator TUint(), result)); if ( result != KErrNone ) @@ -811,7 +811,7 @@ void CMultiframeProvider::ScaleVF( const TSize& aSize ) { __IF_DEBUG(Print(_L("VideoSource[%d]: CMultiframeProvider::ScaleVF() >>"), RThread().Id().operator TUint())); - iActiveWaitScale->InitializeWaiter( &CMultiframeProvider::VFRescalingFinished ); + iActiveWaitScale->InitializeWaiter( &VFRescalingFinished ); TInt result( iVFbitmap->Bitmap().Resize( aSize ) ); ClearVFScalingTargetSize(); if ( result != KErrNone ) diff -r f15ac8e65a02 -r 779871d1e4f4 vtprotocols/group/videotelproto.mmp --- a/vtprotocols/group/videotelproto.mmp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtprotocols/group/videotelproto.mmp Wed Sep 01 12:29:12 2010 +0100 @@ -40,7 +40,7 @@ SOURCE cvtuserinput.cpp SOURCE vtprotocolfactory.cpp -DOCUMENT ../../bld.inf +DOCUMENT ../../group/bld.inf USERINCLUDE ../inc/ diff -r f15ac8e65a02 -r 779871d1e4f4 vtprotocols/inc/ch324confighandler.h --- a/vtprotocols/inc/ch324confighandler.h Tue Aug 31 15:16:10 2010 +0300 +++ b/vtprotocols/inc/ch324confighandler.h Wed Sep 01 12:29:12 2010 +0100 @@ -126,4 +126,4 @@ }; #endif // End of File - + \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtprotocols/src/ch324confighandler.cpp --- a/vtprotocols/src/ch324confighandler.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtprotocols/src/ch324confighandler.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -168,7 +168,7 @@ TInt CH324ConfigCommand::SendUserInputMessageL(MVTUserInput& user_input) { __IF_DEBUG(Print(_L("VTProto: CH324ConfigCommand::SendUserInputMessageL<"))); - if ( user_input.GetType() == EVtUiiDTMF ) + if (user_input.GetType() == EVtUiiDTMF ) { CVTUserInputDtmf* dtmf = static_cast(&user_input); return iH324Config->SendUserInputL(*dtmf->iUII); diff -r f15ac8e65a02 -r 779871d1e4f4 vtprotocols/src/vtprotocolfactory.cpp --- a/vtprotocols/src/vtprotocolfactory.cpp Tue Aug 31 15:16:10 2010 +0300 +++ b/vtprotocols/src/vtprotocolfactory.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -177,7 +177,7 @@ EXPORT_C MVTUserInput* VTProtocolFactory::CreateUserInputIndication(TUserInputType aUIIType, TUint8 aTone) { __IF_DEBUG(Print(_L("VTProto: VTProtocolFactory::CreateUserInputIndication"))); - if ( aUIIType == EVtUiiDTMF ) + if (aUIIType == EVtUiiDTMF ) { CVTUserInputDtmf* uii = CVTUserInputDtmf::NewL(aTone); return uii; diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/group/bld.inf Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2004 - 2006 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: Build information for Vtuis subsystem. +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +// Include components' bld.inf files +#include "../videotelui/group/bld.inf" + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/cenrep/keys_s60videotelephony.xls Binary file vtuis/lcvtapp/cenrep/keys_s60videotelephony.xls has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/conf/CI_s60videotelephony.confml Binary file vtuis/lcvtapp/conf/CI_s60videotelephony.confml has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/conf/s60videotelephony.confml Binary file vtuis/lcvtapp/conf/s60videotelephony.confml has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/conf/s60videotelephony_102072D0.crml Binary file vtuis/lcvtapp/conf/s60videotelephony_102072D0.crml has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/conf/s60videotelephony_10281872.crml Binary file vtuis/lcvtapp/conf/s60videotelephony_10281872.crml has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/data/videotelui_stub.pkg --- a/vtuis/lcvtapp/data/videotelui_stub.pkg Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -; -; 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: -; -; Languages -&EN - -; Header -#{"videotelui"}, (0x101F8681), 1, 0, 0, TYPE=SA - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -;Files -""-"z:\sys\bin\videotelui.exe" -""-"z:\resource\apps\videotelui.rsc" -""-"z:\private\10003a3f\import\apps\videotelui_reg.rsc" \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/data/videotelui_stub.sis Binary file vtuis/lcvtapp/data/videotelui_stub.sis has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/inc/VideoTelephonyInternalCRKeys.h --- a/vtuis/lcvtapp/inc/VideoTelephonyInternalCRKeys.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2008 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: Video Telephony internal Central Repository keys -* -*/ - - -#ifndef VIDEOTELEPHONYINTERNALCRKEYS_H -#define VIDEOTELEPHONYINTERNALCRKEYS_H - -#include - -/** -* Video Telephony Variation API -* Keys under this category are used in defining video telephony variation. -*/ -const TUid KCRUidVTVariation = {0x102072D0}; - -/** -* Video Telephony Local Variation Flags. Values are defined in -* VideoTelephonyVariant.hrh. -*/ -const TUint32 KVTLocalVariationFlags = 0x00000001; - -/** -* Video Telephony Configuration API -* Keys under this category are used for configuring video call behaviour. -* @since S60 3.1 -*/ -const TUid KCRUidVTConfiguration = {0x10281872}; - -/** -* This key controls minimum, normal and maximum frame rate for video encoder. -* Integer values in the string are between 0 and 31 separated by space. -* Example for key value is "5 10 5". -*/ -const TUint32 KVTVideoFrameRates = 0x00000001; - -/** -* Defines layout (screen orientation) used by Video Telephone application -* per active camera. Each camera has one of the following configurations: -* 1) "LS" = Landscape -* 2) "PR" = Portrait -* 3) "OL" = Obey device layout (normal operation) -* Camera values are: -* 1) "C1" = VT primary camera (inwards) -* 2) "C2" = VT secondary camera (outwards) -* Example value (portrait for cam1, landscape for cam2): C1:PR C2:LS -*/ -const TUint32 KVTCameraLayout = 0x00000002; - -/** -* Lists implementation UIDs for MPEG4, H.263 and H.264 encoders for video -* telephony in hexadecimal separated by space -*/ -const TUint32 KVTVideoEncoderUIDs = 0x00000003; - -/** -* Lists implementation UIDs for MPEG4, H.263 and H.264 decoders for video -* telephony in hexadecimal separated by space -*/ -const TUint32 KVTVideoDecoderUIDs = 0x00000004; - -/** -* Lists implementation UIDs for AMR-NB and future audio encoders for video -* telephony (in hex, separated by space) -*/ -const TUint32 KVTAudioEncoderUIDs = 0x00000005; - -/** -* Lists implementation UIDs for AMR-NB and future audio decoders for video -* telephony (in hex, separated by space) -*/ -const TUint32 KVTAudioDecoderUIDs = 0x00000006; - -/** -* Lists processing delay for MPEG4, H.263 and H.264 encoders for video -* telephony in unsigned 32-bit integers separated by space -*/ -const TUint32 KVTVideoEncoderDelay = 0x00000007; - -/** -* Lists processing delay for MPEG4, H.263 and H.264 decoders for video -* telephony in unsigned 32-bit integers separated by space -*/ -const TUint32 KVTVideoDecoderDelay = 0x00000008; - -/** -* Lists processing delay for AMR-NB and future audio encoders for video -* telephony (in unsigned 32-bit integers, separated by space) -*/ -const TUint32 KVTAudioEncoderDelay = 0x00000009; - -/** -* Lists processing delay for AMR-NB and future audio decoders for video -* telephony (in unsigned 32-bit integers, separated by space) -*/ -const TUint32 KVTAudioDecoderDelay = 0x0000000A; - -/* -* Defines number of toolbar buttons. Three buttons is minimum -* and seven is maximum. -*/ -//const TUint32 KVTToolbarCommands = 0x0000000B; - -#endif // VIDEOTELEPHONYINTERNALCRKEYS_H - -// End of file \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/inc/VideoTelephonyVariant.hrh --- a/vtuis/lcvtapp/inc/VideoTelephonyVariant.hrh Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2008 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: Bit flag definitions for VT local variation. -* -*/ - - -#ifndef VIDEOTELEPHONYVARIANT_HRH -#define VIDEOTELEPHONYVARIANT_HRH - - -/** -* KVTLVFlagScalingMethodENearest defines whether the video image is -* scaled using Nearest algorithm, which is fast, but quality is low. -* When the flag is set ENearest is used. -* @since S60 v2.8 -*/ -#define KVTLVFlagScalingMethodENearest 0x00000001 - -/** -* KVTLVFlagScalingMethodEBilinear defines whether the video image is -* scaled using Bilinear algorithm, which offers the best quality, but in a -* slow way. When the flag is set Bilinear is used. -* @since S60 v2.8 -*/ -#define KVTLVFlagScalingMethodEBilinear 0x00000002 - -/** -* KVTLVFlagEnableBitReversal defines if bit order should be -* reversed in PV. -* When the flag is set bit order is reversed. -*/ -#define KVTLVFlagEnableBitReversal 0x00000004 - -/** -* KVTLVFlagEnableAMR_WB defines if AMR wideband is supported in video calls. -* @since S60 v5.0 -*/ -#define KVTLVFlagEnableAMR_WB 0x00000008 - -/** -* KVTLVFlagSupportMpeg4 defines whether the PV should support Mepg4. -* @since S60 v5.0 -*/ -#define KVTLVFlagDisableMpeg4 0x00000010 - -#endif // VIDEOTELEPHONYVARIANT_HRH - -// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/lcapplication.cpp --- a/vtuis/lcvtapp/lcapplication.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2008 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: -* -*/ -//USER -#include "lcapplication.h" -#include "cvtlogger.h" - -LcHbApplication* LcHbApplication::self = 0; - -// ----------------------------------------------------------------------------- -// LcHbApplication::LcHbApplication -// ----------------------------------------------------------------------------- -// -LcHbApplication::LcHbApplication(int &argc, char *argv[]) : - HbApplication(argc, argv) -{ - __VTPRINT( DEBUG_GEN, "LcHbApplication::LcHbApplication()"); - self = this; -} - -// ----------------------------------------------------------------------------- -// LcHbApplication::~LcHbApplication -// ----------------------------------------------------------------------------- -// -LcHbApplication::~LcHbApplication() -{ - self = 0; -} - -// ----------------------------------------------------------------------------- -// LcHbApplication::quit -// ----------------------------------------------------------------------------- -// -void LcHbApplication::quit() -{ - __VTPRINT( DEBUG_GEN, "LcHbApplication::quit()"); - if (self) { - emit self->handleQuit(); - } -} - - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/lcapplication.h --- a/vtuis/lcvtapp/lcapplication.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2008 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: -* -*/ -#ifndef LCAPPLICATION_H -#define LCAPPLICATION_H - -#include - -class LcHbApplication : public HbApplication -{ -Q_OBJECT -public: - - LcHbApplication(int &argc, char *argv[]); - ~LcHbApplication(); - -signals: - - void handleQuit(); - -public slots: - - //from QCoreApplication - static void quit(); - -private: //data - - static LcHbApplication* self; -}; - -#endif //LCAPPLICATION_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/lcvtapp.pro --- a/vtuis/lcvtapp/lcvtapp.pro Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -# -# 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: -# -# - -TEMPLATE = app -TARGET = videotelui -CONFIG += hb -TRANSLATIONS = video_telephone.ts - -INCLUDEPATH += ../../inc -# Input -HEADERS += lcapplication.h -SOURCES += lcapplication.cpp main.cpp - -symbian: { - - :BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " - :BLD_INF_RULES.prj_exports += "./rom/videotelui.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videotelui.iby)" - :BLD_INF_RULES.prj_exports += "./rom/videoteluiResources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(videoteluiResources.iby)" - :BLD_INF_RULES.prj_exports += "./conf/s60videotelephony.confml APP_LAYER_CONFML(s60videotelephony.confml)" - :BLD_INF_RULES.prj_exports += "./conf/CI_s60videotelephony.confml APP_LAYER_CONFML(CI_s60videotelephony.confml)" - :BLD_INF_RULES.prj_exports += "./conf/s60videotelephony_102072D0.crml APP_LAYER_CRML(s60videotelephony_102072D0.crml)" - :BLD_INF_RULES.prj_exports += "./conf/s60videotelephony_10281872.crml APP_LAYER_CRML(s60videotelephony_10281872.crml)" - :BLD_INF_RULES.prj_exports += "./inc/VideoTelephonyVariant.hrh |../../inc/videotelephonyvariant.hrh" - :BLD_INF_RULES.prj_exports += "./inc/VideoTelephonyInternalCRKeys.h |../../inc/videotelephonyinternalcrkeys.h" - :BLD_INF_RULES.prj_exports += "./data/videotelui_stub.sis /epoc32/data/z/system/install/videotelui_stub.sis" - - TARGET.UID2 = 0x100039CE - TARGET.UID3 = 0x101F8681 - TARGET.VID = 0x101FB657 - TARGET.CAPABILITY = CAP_APPLICATION NetworkControl SwEvent Location MultimediaDD CommDD - LIBS += -llivecommsui -lvtlogger -lapgrfx -lcone - RSS_RULES += "hidden = KAppIsHidden;" -} diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/main.cpp --- a/vtuis/lcvtapp/main.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* Copyright (c) 2008 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: -* -*/ -//SYSTEM -#include -#include -#include -#include -#include - -//USER -#include "cvtlogger.h" -#include "lcapplication.h" - - -int main(int argc, char *argv[]) -{ - LcHbApplication app(argc, argv); - CVtLogger::Initialize(); // Cannot do before app creation as activescheduler is installed at that stage - __VTPRINT2(CVtLogger::ELogToFile, "videotelui.exe::main entered: argc=%d ",argc); - if (argc > 0) - { - QString arg1Str(QString::fromUtf8(argv[0])); - TPtrC arg1(arg1Str.utf16()); - CVtLogger::Print(CVtLogger::ELogToFile,arg1); - } - - //Load application-specific translator - QString lang = QLocale::system().name(); - QString path = "z:/resource/qt/translations/"; - QTranslator translator; - if ( translator.load( path + "video_telephone_" + lang + ".qm") ){ - app.installTranslator(&translator); - } else { - __VTPRINT( DEBUG_GEN, "videotelui.exe::main, couldn't load translation" ); - } - - // Temporarily set VT as system app as otherwise GOOM memory releasing will shut - // down the process when running low on graphics mem. - CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(CEikonEnv::Static()->WsSession()); - wgName->SetSystem(ETrue); // Allow only application with PowerManagement cap to shut us down - wgName->SetCaptionL(_L("Videotelephony")); - wgName->SetAppUid(TUid::Uid(0x101F8681)); - wgName->SetWindowGroupName(CEikonEnv::Static()->RootWin()); - CleanupStack::PopAndDestroy(); - - QString engineName("Videotelephony"); - QString applicationName("Video Telephone"); - - LcViewManager viewManager(engineName,applicationName); - - QObject::connect( &app, SIGNAL( handleQuit() ), - &viewManager, SLOT( terminateSession() ), - Qt::QueuedConnection ); - - int err = app.exec(); - __VTPRINT2(CVtLogger::ELogToFile, "videotelui.exe::main returns %d ",err); - CVtLogger::Uninitialize(); - return err; -} diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/rom/videotelui.iby --- a/vtuis/lcvtapp/rom/videotelui.iby Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2008 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: IBY file - * -*/ - - -#ifndef __VIDEOTELUI_IBY__ -#define __VIDEOTELUI_IBY__ - -REM Video Telephone application - -#ifdef __CS_VIDEO_TELEPHONY - -file=ABI_DIR\urel\videotelui.exe PROGRAMS_DIR\videotelui.exe -data=DATAZ_\private\10003a3f\import\apps\videotelui_reg.rsc \private\10003a3f\import\apps\videotelui_reg.rsc - -// Enabler for eclipsing ROM binaries -data=ZSYSTEM\install\videotelui_stub.sis system\install\videotelui_stub.sis - -#endif // __CS_VIDEO_TELEPHONY -#endif diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtapp/rom/videoteluiResources.iby --- a/vtuis/lcvtapp/rom/videoteluiResources.iby Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2008 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: IBY file - * -*/ - - -#ifndef __VIDEOTELUI_RESOURCES_IBY__ -#define __VIDEOTELUI_RESOURCES_IBY__ - -#include - -#ifdef __CS_VIDEO_TELEPHONY -data=DATAZ_\APP_RESOURCE_DIR\videotelui.rsc APP_RESOURCE_DIR\videotelui.rsc -data=DATAZ_\QT_TRANSLATIONS_DIR\video_telephone.qm QT_TRANSLATIONS_DIR\video_telephone.qm -#endif // __CS_VIDEO_TELEPHONY - -#endif \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorcontroller/bwins/lcvtindicatorcontrolleru.def --- a/vtuis/lcvtindicatorcontroller/bwins/lcvtindicatorcontrolleru.def Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -EXPORTS - ?disableActiveCallIndicator@LcVtIndicatorController@@QAEXXZ @ 1 NONAME ; void LcVtIndicatorController::disableActiveCallIndicator(void) - ?enableActiveCallIndicator@LcVtIndicatorController@@QAEXXZ @ 2 NONAME ; void LcVtIndicatorController::enableActiveCallIndicator(void) - ??1LcVtIndicatorController@@UAE@XZ @ 3 NONAME ; LcVtIndicatorController::~LcVtIndicatorController(void) - ??0LcVtIndicatorController@@QAE@XZ @ 4 NONAME ; LcVtIndicatorController::LcVtIndicatorController(void) - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorcontroller/data/lcvtindicatorcontroller_stub.pkg --- a/vtuis/lcvtindicatorcontroller/data/lcvtindicatorcontroller_stub.pkg Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -; -; 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: -; -; Languages -&EN - -; Header -#{"lcvtindicatorcontroller"}, (0x200315EC), 1, 0, 0, TYPE=SA - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -;Files -""-"z:\sys\bin\lcvtindicatorcontroller.dll" - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorcontroller/data/lcvtindicatorcontroller_stub.sis Binary file vtuis/lcvtindicatorcontroller/data/lcvtindicatorcontroller_stub.sis has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorcontroller/eabi/lcvtindicatorcontrolleru.def --- a/vtuis/lcvtindicatorcontroller/eabi/lcvtindicatorcontrolleru.def Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -EXPORTS - _ZN23LcVtIndicatorController25enableActiveCallIndicatorEv @ 1 NONAME - _ZN23LcVtIndicatorController26disableActiveCallIndicatorEv @ 2 NONAME - _ZN23LcVtIndicatorControllerC1Ev @ 3 NONAME - _ZN23LcVtIndicatorControllerC2Ev @ 4 NONAME - _ZN23LcVtIndicatorControllerD0Ev @ 5 NONAME - _ZN23LcVtIndicatorControllerD1Ev @ 6 NONAME - _ZN23LcVtIndicatorControllerD2Ev @ 7 NONAME - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorcontroller/inc/lcvtindicatorcontroller.h --- a/vtuis/lcvtindicatorcontroller/inc/lcvtindicatorcontroller.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/*! -* Copyright (c) 2010 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: Handles phone indicators. -*/ - -#ifndef LCVTINDICATORCONTROLLER_H_ -#define LCVTINDICATORCONTROLLER_H_ - -// FORWARD DECLARATION - -class LcVtIndicatorControllerImpl; - -class LcVtIndicatorController - { -public: - IMPORT_C explicit LcVtIndicatorController(); - IMPORT_C virtual ~LcVtIndicatorController(); - - IMPORT_C void enableActiveCallIndicator(); - IMPORT_C void disableActiveCallIndicator(); - -private: - LcVtIndicatorControllerImpl* mIndicatorimpl; - - friend class UT_LcVtIndicatorController; - }; - -#endif /* LCVTINDICATORCONTROLLER_H_ */ diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorcontroller/inc/lcvtindicatorcontrollerimpl.h --- a/vtuis/lcvtindicatorcontroller/inc/lcvtindicatorcontrollerimpl.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/*! -* Copyright (c) 2010 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: Handles phone indicators. -*/ - -#ifndef LCVTINDICATORCONTROLLERIMPL_H_ -#define LCVTINDICATORCONTROLLERIMPL_H_ - -// FORWARD DECLARATION -class HbIndicator; - -class LcVtIndicatorControllerImpl - { -public: - explicit LcVtIndicatorControllerImpl(); - virtual ~LcVtIndicatorControllerImpl(); - - void enableActiveCallIndicator(); - void disableActiveCallIndicator(); - -private: - HbIndicator* mIndicator; - friend class UT_LcVtIndicatorController; - }; - - - -#endif /* LCVTINDICATORCONTROLLERIMPL_H_ */ diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorcontroller/lcvtindicatorcontroller.pri --- a/vtuis/lcvtindicatorcontroller/lcvtindicatorcontroller.pri Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# -# 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: -# - -HEADERS += ./inc/lcvtindicatorcontroller.h -HEADERS += ./inc/lcvtindicatorcontrollerimpl.h - -SOURCES += ./src/lcvtindicatorcontroller.cpp -SOURCES += ./src/lcvtindicatorcontrollerimpl.cpp diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorcontroller/lcvtindicatorcontroller.pro --- a/vtuis/lcvtindicatorcontroller/lcvtindicatorcontroller.pro Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -# 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: - -TEMPLATE = lib -TARGET = lcvtindicatorcontroller -CONFIG += hb dll svg - -QT += core - -INCLUDEPATH += ./inc -INCLUDEPATH += ../../inc -INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE - -DEFINES += LCVTINDICATORCONTROLLER_LIB - -libFiles.sources = lcvtindicatorcontroller.dll -libFiles.path = "!:/sys/bin" -DEPLOYMENT += libFiles - -symbian: { - TARGET.UID2 = 0x1000008d - TARGET.UID3 = 0x200315EC - - TARGET.CAPABILITY = CAP_GENERAL_DLL - TARGET.EPOCALLOWDLLDATA = 1 - LIBS += -lflogger -lxqplugins -lxqservice -lxqserviceutil - defFiles = "$${LITERAL_HASH}ifdef WINS" \ - "DEFFILE bwins/lcvtindicatorcontroller.def" \ - "$${LITERAL_HASH}else" \ - "DEFFILE eabi/lcvtindicatorcontroller.def" \ - "$${LITERAL_HASH}endif" - MMP_RULES += defFiles - :BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " - :BLD_INF_RULES.prj_exports += "rom/lcvtindctr.iby CORE_APP_LAYER_IBY_EXPORT_PATH(lcvtindctr.iby)" -} -# Input -include(lcvtindicatorcontroller.pri) \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorcontroller/rom/lcvtindctr.iby --- a/vtuis/lcvtindicatorcontroller/rom/lcvtindctr.iby Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2008 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: IBY file - * -*/ - - -#ifndef __LCVTINDCTR_IBY__ -#define __LCVTINDCTR_IBY__ - - -//#ifdef __CS_VIDEO_TELEPHONY - -file=ABI_DIR\UREL\lcvtindicatorcontroller.dll SHARED_LIB_DIR\lcvtindicatorcontroller.dll - -// Enabler for eclipsing ROM binaries -data=ZSYSTEM\install\lcvtindicatorcontroller_stub.sis system\install\lcvtindicatorcontroller_stub.sis - -#endif - - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorcontroller/src/lcvtindicatorcontroller.cpp --- a/vtuis/lcvtindicatorcontroller/src/lcvtindicatorcontroller.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/*! -* Copyright (c) 2010 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: Handles phone indicators. -* -*/ - -#include - -#include "lcvtindicatorcontroller.h" -#include "lcvtindicatorcontrollerimpl.h" - - -EXPORT_C LcVtIndicatorController::LcVtIndicatorController() -{ - mIndicatorimpl = new LcVtIndicatorControllerImpl(); -} - -EXPORT_C LcVtIndicatorController::~LcVtIndicatorController() -{ - delete mIndicatorimpl; -} - - -EXPORT_C void LcVtIndicatorController::enableActiveCallIndicator() -{ - mIndicatorimpl->enableActiveCallIndicator(); -} - -EXPORT_C void LcVtIndicatorController::disableActiveCallIndicator() -{ - mIndicatorimpl->disableActiveCallIndicator(); - -} - -// End of file - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorcontroller/src/lcvtindicatorcontrollerimpl.cpp --- a/vtuis/lcvtindicatorcontroller/src/lcvtindicatorcontrollerimpl.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/*! -* Copyright (c) 2010 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: Handles phone indicators. -* -*/ - -#include -#include -#include -#include -#include -#ifdef Q_OS_SYMBIAN -#include -#endif -#include "lcvtindicatorcontrollerimpl.h" -#include - -const static QString lcVtIndicator = "com.nokia.hb.indicator.lcvtindicatorplugin/1.0"; - - -LcVtIndicatorControllerImpl::LcVtIndicatorControllerImpl() -{ - qDebug() << "LcVtIndicatorControllerImpl::LcVtIndicatorControllerImpl()"; - mIndicator = new HbIndicator(); -} - -LcVtIndicatorControllerImpl::~LcVtIndicatorControllerImpl() -{ - qDebug() << "LcVtIndicatorControllerImpl::~LcVtIndicatorControllerImpl()"; - delete mIndicator; -} - -void LcVtIndicatorControllerImpl::enableActiveCallIndicator() -{ - qDebug() << "LcVtIndicatorControllerImpl::enableActiveCallIndicator()"; - QString indicatorType(lcVtIndicator); - QVariantMap parameters; - - //indicator text - parameters.insert( - QVariant(HbIndicatorInterface::PrimaryTextRole).toString(), - hbTrId("txt_vt_dblist_ongoing_video_call")); - - //status bar icon - parameters.insert( - QVariant(HbIndicatorInterface::MonoDecorationNameRole).toString(), - QString("qtg_mono_call")); - - //indicator icon - parameters.insert(QVariant(HbIndicatorInterface::DecorationNameRole).toString(), - QString("qtg_mono_call")); - - mIndicator->activate(indicatorType, parameters); - qDebug() << "LcVtIndicatorControllerImpl::enableActiveCallIndicator(), exit"; -} - -void LcVtIndicatorControllerImpl::disableActiveCallIndicator() -{ - qDebug() << "LcVtIndicatorControllerImpl::disableActiveCallIndicator()"; - QString indicatorType(lcVtIndicator); - mIndicator->deactivate(indicatorType); -} - -// End of file - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorplugin/data/lcvtindicatorplugin_stub.pkg --- a/vtuis/lcvtindicatorplugin/data/lcvtindicatorplugin_stub.pkg Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -; -; 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: -; -; Languages -&EN - -; Header -#{"lcvtindicatorplugin"}, (0x200315EB), 1, 0, 0, TYPE=SA - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -;Files -""-"z:\sys\bin\lcvtindicatorplugin.dll" -""-"z:\resource\plugins\indicators\lcvtindicatorplugin.qtplugin" diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorplugin/data/lcvtindicatorplugin_stub.sis Binary file vtuis/lcvtindicatorplugin/data/lcvtindicatorplugin_stub.sis has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorplugin/inc/lcvtindicatorplugin.h --- a/vtuis/lcvtindicatorplugin/inc/lcvtindicatorplugin.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2010 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: - * - */ - -#ifndef LCVTINDICATORPLUGIN_H -#define LCVTINDICATORPLUGIN_H - -#include -#include - -class LcVtIndicatorPlugin : public HbIndicatorInterface, public HbIndicatorPluginInterface -{ -Q_OBJECT -Q_INTERFACES(HbIndicatorPluginInterface) -public: - - LcVtIndicatorPlugin(); - ~LcVtIndicatorPlugin(); - -public: //from HbIndicatorPluginInterface - QStringList indicatorTypes() const; - bool accessAllowed(const QString &indicatorType, - const QVariantMap &securityInfo) const; - HbIndicatorInterface* createIndicator(const QString &indicatorType); - int error() const; - -public: //from HbIndicatorInterface - bool handleInteraction(InteractionType type); - QVariant indicatorData(int role) const; - - -protected: //from HbIndicatorInterface - bool handleClientRequest(RequestType type, const QVariant ¶meter); - - -private: - - bool bringVtToForeground(); - -private: - Q_DISABLE_COPY(LcVtIndicatorPlugin) - int mError; - QStringList mIndicatorTypes; - QVariant mParameter; - - friend class UT_LcVtIndicatorPlugin; -}; - -#endif // LCVTINDICATORPLUGIN_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorplugin/lcvtindicatorplugin.pro --- a/vtuis/lcvtindicatorplugin/lcvtindicatorplugin.pro Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -# -# Copyright (c) 2010 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: -# - -TEMPLATE = lib -CONFIG += plugin hb - -# directories -INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -INCLUDEPATH += ./inc - -# Input -HEADERS += inc/lcvtindicatorplugin.h -SOURCES += src/lcvtindicatorplugin.cpp - -symbian: { - TARGET.EPOCALLOWDLLDATA = 1 - TARGET.UID3 = 0x200315EB - TARGET.CAPABILITY = CAP_GENERAL_DLL - LIBS += -lxqservice - - :BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " - :BLD_INF_RULES.prj_exports += "rom/lcvtindicatorplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(lcvtindicatorplugin.iby)" - - pluginstub.sources = lcvtindicatorplugin.dll - pluginstub.path = /resource/plugins/indicators - DEPLOYMENT += pluginstub -} diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorplugin/rom/lcvtindicatorplugin.iby --- a/vtuis/lcvtindicatorplugin/rom/lcvtindicatorplugin.iby Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2010 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: -* -*/ - -#ifndef __LCVTINDICATORPLUGIN_IBY__ -#define __LCVTINDICATORPLUGIN_IBY__ - -#include - -file=ABI_DIR\UREL\lcvtindicatorplugin.dll SHARED_LIB_DIR\lcvtindicatorplugin.dll -data=\epoc32\data\z\resource\plugins\indicators\lcvtindicatorplugin.qtplugin RESOURCE_FILES_DIR\plugins\indicators\lcvtindicatorplugin.qtplugin - -// Enabler for eclipsing ROM binaries -data=ZSYSTEM\install\lcvtindicatorplugin_stub.sis system\install\lcvtindicatorplugin_stub.sis - -#endif diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorplugin/src/lcvtindicatorplugin.cpp --- a/vtuis/lcvtindicatorplugin/src/lcvtindicatorplugin.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2010 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: - * - */ - -#include -#include -#include -#include - -#include "lcvtindicatorplugin.h" - -const static QString IndicatorType = "com.nokia.hb.indicator.lcvtindicatorplugin/1.0"; - -Q_EXPORT_PLUGIN(LcVtIndicatorPlugin) - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -LcVtIndicatorPlugin::LcVtIndicatorPlugin(): - HbIndicatorInterface(IndicatorType, NotificationCategory, InteractionActivated), - mError(0) -{ - qDebug() << "LcVtIndicatorPlugin::LcVtIndicatorPlugin()"; - mIndicatorTypes << IndicatorType; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -LcVtIndicatorPlugin::~LcVtIndicatorPlugin() -{ -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -QStringList LcVtIndicatorPlugin::indicatorTypes() const -{ - qDebug() << "LcVtIndicatorPlugin::indicatorTypes()"; - return mIndicatorTypes; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -bool LcVtIndicatorPlugin::accessAllowed(const QString &indicatorType, - const QVariantMap &securityInfo) const -{ - Q_UNUSED(indicatorType); - Q_UNUSED(securityInfo); - qDebug() << "LcVtIndicatorPlugin::accessAllowed()"; - return true; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -HbIndicatorInterface* LcVtIndicatorPlugin::createIndicator( - const QString &indicatorType) -{ - Q_UNUSED(indicatorType); - return this; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -int LcVtIndicatorPlugin::error() const -{ - return mError; -} - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -bool LcVtIndicatorPlugin::handleInteraction(InteractionType type) -{ - qDebug() << "LcVtIndicatorPlugin::handleInteraction()"; - bool handled = false; - if (type == InteractionActivated) { - handled = bringVtToForeground(); - if (!handled) { - qDebug() << "couldn't bring VT to FG, deactivating indicator!"; - emit deactivate(); - } - } - qDebug() << "LcVtIndicatorPlugin::handleInteraction(), exit"; - return handled; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -QVariant LcVtIndicatorPlugin::indicatorData(int role) const -{ - qDebug() << "LcVtIndicatorInterface::indicatorData()"; - QVariantMap map = mParameter.value(); - - if (role == PrimaryTextRole) { - return map.value( (QVariant(PrimaryTextRole)).toString()).toString(); - } else if (role == MonoDecorationNameRole) { //status bar icon - return map.value((QVariant(MonoDecorationNameRole)).toString()).toString(); - } else if (role == DecorationNameRole) { - return map.value( (QVariant(DecorationNameRole)).toString()).toString(); - } - return QVariant(); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -bool LcVtIndicatorPlugin::handleClientRequest(RequestType type, const QVariant ¶meter) -{ - qDebug() << "LcVtIndicatorPlugin::handleClientRequest()"; - bool handled(false); - switch (type) { - case RequestActivate: - if (mParameter != parameter) { - mParameter = parameter; - emit dataChanged(); - } - handled = true; - break; - default: - mParameter.clear(); - } - qDebug() << "LcVtIndicatorPlugin::handleClientRequest(), exit"; - - return handled; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -bool LcVtIndicatorPlugin::bringVtToForeground() -{ - qDebug() << "LcVtIndicatorPlugin::bringVtToForeground()"; - const QString AppName = "videotelui.exe"; - return QProcess::startDetached(AppName); -} - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorplugin/tsrc/qtestutils/inc/testresultxmlparser.h --- a/vtuis/lcvtindicatorplugin/tsrc/qtestutils/inc/testresultxmlparser.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* 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: -* -*/ - -#ifndef TESTRESULTXMLPARSER_H -#define TESTRESULTXMLPARSER_H - -#include - - -class TestResultXmlParser : public QXmlDefaultHandler -{ -public: // Constructors and destructor - TestResultXmlParser(); - ~TestResultXmlParser(); - -public: // From QXmlContentHandler - bool startElement( - const QString& namespaceURI, - const QString& localName, - const QString& qName, - const QXmlAttributes& atts); - - bool endElement( - const QString& namespaceURI, - const QString& localName, - const QString& qName); - - bool characters(const QString& ch); - -public: // New functions - - int parse(const QString& fileName); - - int parseAndPrintResults( - const QString& fileName, - bool printDetails=false); - - int testCount(); - - QStringList errors(); - -private: // Data - int mTestCount; - QStringList* mErrors; - bool mParsingIncidentElement; - bool mParsingDescriptionElement; - bool mCurrentTestFailed; - QString mCurrentTestName; - QString mCurrentTestFile; - int mCurrentTestFailureLine; -}; - - -#endif // TESTRESULTXMLPARSER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorplugin/tsrc/qtestutils/src/testresultxmlparser.cpp --- a/vtuis/lcvtindicatorplugin/tsrc/qtestutils/src/testresultxmlparser.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,178 +0,0 @@ -/* -* 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: -* -*/ - -#include "testresultxmlparser.h" -#include - -const char testFunctionElement[] = "TestFunction"; -const char incidentElement[] = "Incident"; -const char descriptionElement[] = "Description"; -const char nameAttr[] = "name"; -const char typeAttr[] = "type"; -const char fileAttr[] = "file"; -const char lineAttr[] = "line"; -const char attrValueFail[] = "fail"; - - -// ----------------------------------------------------------------------------- -// TestResultXmlParser::TestResultXmlParser -// ----------------------------------------------------------------------------- -// -TestResultXmlParser::TestResultXmlParser() -: mTestCount(0), - mParsingIncidentElement(false), - mParsingDescriptionElement(false), - mCurrentTestFailed(false), - mCurrentTestFailureLine(0) -{ - mErrors = new QStringList; -} - -// ----------------------------------------------------------------------------- -// TestResultXmlParser::TestResultXmlParser -// ----------------------------------------------------------------------------- -// -TestResultXmlParser::~TestResultXmlParser() -{ - delete mErrors; -} - -// ----------------------------------------------------------------------------- -// TestResultXmlParser::startElement -// ----------------------------------------------------------------------------- -// -bool TestResultXmlParser::startElement( - const QString& /*namespaceURI*/, - const QString& /*localName*/, - const QString& qName, - const QXmlAttributes& atts) -{ - if (qName == testFunctionElement) { - mTestCount++; - mCurrentTestName = atts.value(nameAttr); - return true; - } - if (qName == incidentElement) { - mParsingIncidentElement = true; - if (atts.value(typeAttr) == attrValueFail) { - mCurrentTestFailed = true; - mCurrentTestFile = atts.value(fileAttr); - mCurrentTestFailureLine = atts.value(lineAttr).toInt(); - } - return true; - } - mParsingDescriptionElement = (qName == descriptionElement); - return true; -} - -// ----------------------------------------------------------------------------- -// TestResultXmlParser::endElement -// ----------------------------------------------------------------------------- -// -bool TestResultXmlParser::endElement( - const QString& /*namespaceURI*/, - const QString& /*localName*/, - const QString& qName) -{ - if (qName == incidentElement) { - mParsingIncidentElement = false; - mCurrentTestFailed = false; - return true; - } - if (qName == descriptionElement) { - mParsingDescriptionElement = false; - } - return true; -} - -// ----------------------------------------------------------------------------- -// TestResultXmlParser::characters -// ----------------------------------------------------------------------------- -// -bool TestResultXmlParser::characters(const QString& ch) -{ - if (mParsingIncidentElement && - mParsingDescriptionElement && - mCurrentTestFailed) { - QString testResult = mCurrentTestName + " failed:\n"; - testResult += "File: "; - testResult += mCurrentTestFile; - testResult += "\n"; - testResult += "Line: "; - testResult += QString::number(mCurrentTestFailureLine); - testResult += "\n"; - testResult += "Reason: "; - testResult += ch; - testResult += "\n"; - mErrors->append(testResult); - } - return true; -} - -// ----------------------------------------------------------------------------- -// TestResultXmlParser::parse -// ----------------------------------------------------------------------------- -// -int TestResultXmlParser::parse(const QString& fileName) -{ - QFile file(fileName); - QXmlInputSource inputSource(&file); - QXmlSimpleReader reader; - reader.setContentHandler(this); - return reader.parse(inputSource); -} - -// ----------------------------------------------------------------------------- -// TestResultXmlParser::parseAndPrintResults -// ----------------------------------------------------------------------------- -// -int TestResultXmlParser::parseAndPrintResults( - const QString& fileName, - bool printDetails) -{ - printf("Parsing: %s\n", fileName.toUtf8().data()); - int error = parse(fileName); - printf("%d tests executed. Failed total: %d\n", mTestCount, mErrors->count()); - if (printDetails) { - printf("\n"); - foreach(QString error, *mErrors) { - printf(error.toUtf8().data()); - printf("\n"); - } - } - return error; -} - -// ----------------------------------------------------------------------------- -// TestResultXmlParser::testCount -// ----------------------------------------------------------------------------- -// -int TestResultXmlParser::testCount() -{ - return mTestCount; -} - -// ----------------------------------------------------------------------------- -// TestResultXmlParser::errors -// ----------------------------------------------------------------------------- -// -QStringList TestResultXmlParser::errors() -{ - return *mErrors; -} - -// End of File. diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorplugin/tsrc/ut_lcvtindicatorplugin/inc/ut_lcvtindicatorplugin.h --- a/vtuis/lcvtindicatorplugin/tsrc/ut_lcvtindicatorplugin/inc/ut_lcvtindicatorplugin.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* 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: -* -*/ -#ifndef UT_LCVTINDICATORPLUGIN_H -#define UT_LCVTINDICATORPLUGIN_H - -#include -#include - -class LcVtIndicatorPlugin; - -class UT_LcVtIndicatorPlugin : public QObject -{ - Q_OBJECT - -private slots: - -/* - * In addition, there are four private slots that are not treated as testfunctions. - * They will be executed by the testing framework and can be used to initialize and clean up - * either the entire test or the current test function. - * - * initTestCase() will be called before the first testfunction is executed. - * cleanupTestCase() will be called after the last testfunction was executed. - * init() will be called before each testfunction is executed. - * cleanup() will be called after every testfunction. -*/ - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - -private slots: //test methods - - void testLcVtIndicatorPlugin(); - void testIndicatorTypes(); - void testAccessAllowed(); - void testCreateIndicator(); - void testError(); - void testHandleInteraction(); - void testIndicatorData(); - void testHandleClientRequest(); - void testBringVtToForeground(); - -private: - - LcVtIndicatorPlugin* mLcVtIndicatorPlugin; - -}; - - -#endif //UT_LCVTINDICATORPLUGIN_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorplugin/tsrc/ut_lcvtindicatorplugin/src/main.cpp --- a/vtuis/lcvtindicatorplugin/tsrc/ut_lcvtindicatorplugin/src/main.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* 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: -* -*/ - - -#include - -#include "ut_lcvtindicatorplugin.h" -#include "testresultxmlparser.h" - -int main(int argc, char *argv[]) -{ - bool promptOnExit(true); - for (int i=0; i - -const static QString lcVtIndicator = "com.nokia.hb.indicator.lcvtindicatorplugin/1.0"; - - -void UT_LcVtIndicatorPlugin::initTestCase() -{ - -} - -void UT_LcVtIndicatorPlugin::cleanupTestCase() -{ -} - -void UT_LcVtIndicatorPlugin::init() -{ - mLcVtIndicatorPlugin = new LcVtIndicatorPlugin(); -} - -void UT_LcVtIndicatorPlugin::cleanup() -{ - delete mLcVtIndicatorPlugin; - mLcVtIndicatorPlugin = 0; -} - -void UT_LcVtIndicatorPlugin::testLcVtIndicatorPlugin() -{ - QVERIFY( mLcVtIndicatorPlugin ); -} - -void UT_LcVtIndicatorPlugin::testIndicatorTypes() -{ - QCOMPARE(mLcVtIndicatorPlugin->indicatorTypes()[0], lcVtIndicator); -} - -void UT_LcVtIndicatorPlugin::testAccessAllowed() -{ - QVERIFY( mLcVtIndicatorPlugin->accessAllowed(QString(), QVariantMap()) ); -} - -void UT_LcVtIndicatorPlugin::testCreateIndicator() -{ - mLcVtIndicatorPlugin->createIndicator(lcVtIndicator); -} - -void UT_LcVtIndicatorPlugin::testError() -{ - QVERIFY( !mLcVtIndicatorPlugin->error() ); -} - - -void UT_LcVtIndicatorPlugin::testHandleInteraction() -{ - QSignalSpy spy(mLcVtIndicatorPlugin, SIGNAL(deactivate())); - - //No interation requered - QVERIFY( !mLcVtIndicatorPlugin->handleInteraction( - HbIndicatorInterface::NoInteraction) ); - QCOMPARE( spy.count(), 0 ); - - //Indicator activated, no VT running => deactivating - QVERIFY( !mLcVtIndicatorPlugin->handleInteraction( - HbIndicatorInterface::InteractionActivated) ); - QCOMPARE( spy.count(), 1 ); - - //Indicator activated, VT running => bringing to FG - spy.clear(); - QVERIFY( mLcVtIndicatorPlugin->bringVtToForeground() ); - QVERIFY( QProcess::isRunning ); - QCOMPARE( spy.count(), 0 ); -} - -void UT_LcVtIndicatorPlugin::testIndicatorData() -{ - //No params defined - QVERIFY( mLcVtIndicatorPlugin->indicatorData( - HbIndicatorInterface::DecorationNameRole) == QVariant(QString()) ); - QVERIFY( mLcVtIndicatorPlugin->indicatorData( - HbIndicatorInterface::MonoDecorationNameRole) == QVariant(QString()) ); - QVERIFY( mLcVtIndicatorPlugin->indicatorData( - HbIndicatorInterface::PrimaryTextRole) == QVariant(QString()) ); - QVERIFY( mLcVtIndicatorPlugin->indicatorData( - HbIndicatorInterface::SecondaryTextRole) == QVariant() ); - //Non-existing param role - QVERIFY( mLcVtIndicatorPlugin->indicatorData(999) == QVariant() ); - - //Parameters defined - QVariantMap parameters; - parameters.insert( - QVariant(HbIndicatorInterface::DecorationNameRole).toString(), - QVariant("decoration") ); - parameters.insert( - QVariant(HbIndicatorInterface::MonoDecorationNameRole).toString(), - QVariant("mono_decoration") ); - parameters.insert( - QVariant(HbIndicatorInterface::PrimaryTextRole ).toString(), - QVariant("primary_text") ); - parameters.insert( - QVariant(HbIndicatorInterface::SecondaryTextRole ).toString(), - QVariant("secondary_text") ); - - mLcVtIndicatorPlugin->mParameter = parameters; - - QVERIFY( mLcVtIndicatorPlugin->indicatorData( - HbIndicatorInterface::DecorationNameRole) - == QVariant("decoration") ); - QVERIFY( mLcVtIndicatorPlugin->indicatorData( - HbIndicatorInterface::MonoDecorationNameRole) - == QVariant("mono_decoration") ); - QVERIFY( mLcVtIndicatorPlugin->indicatorData( - HbIndicatorInterface::PrimaryTextRole) - == QVariant("primary_text") ); - QVERIFY( mLcVtIndicatorPlugin->indicatorData( - HbIndicatorInterface::SecondaryTextRole) - == QVariant() ); -} - -void UT_LcVtIndicatorPlugin::testHandleClientRequest() -{ - QVariantMap parameters; - parameters.insert("key", QVariant("value")); - mLcVtIndicatorPlugin->mParameter = parameters; - QSignalSpy spy(mLcVtIndicatorPlugin, SIGNAL(dataChanged())); - - // Deactivate, params cleareds - QVERIFY( !mLcVtIndicatorPlugin->mParameter.isNull() ); - QVERIFY( !mLcVtIndicatorPlugin->handleClientRequest( - HbIndicatorInterface::RequestDeactivate, QVariant()) ); - QCOMPARE( spy.count(), 0 ); - QVERIFY( mLcVtIndicatorPlugin->mParameter.isNull() ); - - // Activate request, parameters changed - parameters.insert("key", QVariant("value")); - QVERIFY( mLcVtIndicatorPlugin->handleClientRequest( - HbIndicatorInterface::RequestActivate, QVariant(parameters)) ); - QCOMPARE( spy.count(), 1 ); - - // Activate request, parameters not changed - spy.clear(); - QVERIFY( mLcVtIndicatorPlugin->handleClientRequest( - HbIndicatorInterface::RequestActivate, QVariant(parameters)) ); - QCOMPARE( spy.count(), 0 ); -} - -void UT_LcVtIndicatorPlugin::testBringVtToForeground() -{ - QVERIFY( !mLcVtIndicatorPlugin->bringVtToForeground() ); - QVERIFY( QProcess::isRunning ); -} - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtindicatorplugin/tsrc/ut_lcvtindicatorplugin/stubs/qprocess.h --- a/vtuis/lcvtindicatorplugin/tsrc/ut_lcvtindicatorplugin/stubs/qprocess.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - -#ifndef QPROCESS_H -#define QPROCESS_H - -class QProcess -{ -public: - static bool startDetached(const QString &program){ QProcess::isRunning = true; } ; - static bool isRunning; -}; - -#endif // QPROCESS_H \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/data/F0112235.rss --- a/vtuis/lcvtplugin/data/F0112235.rss Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* ============================================================================== -* Name : F0112234.rss -* Part of : -* Description : -* Version : -* -* Copyright © 2004 Nokia Corporation. -* This material, including documentation and any related -* computer programs, is protected by copyright controlled by -* Nokia Corporation. All rights are reserved. Copying, -* including reproducing, storing, adapting or translating, any -* or all of this material requires the prior written consent of -* Nokia Corporation. This material also contains confidential -* information which may not be disclosed to others without the -* prior written consent of Nokia Corporation. -* ============================================================================== -*/ -#include "registryinfov2.rh" - -RESOURCE REGISTRY_INFO theInfo - { - resource_format_version = RESOURCE_FORMAT_VERSION_2; - // UID for the DLL - dll_uid = 0xF0112235; - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = 0x20021340; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = 0x20021342; - version_no = 1; - default_data = "Videotelephony"; - rom_only = 0; - } - }; - } - }; - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/data/lcvtplugin.pkg --- a/vtuis/lcvtplugin/data/lcvtplugin.pkg Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -; Languages -; -&EN - -; Header -#{"lcvtplugin patch"}, (0xF0112235), 1, 0, 0, TYPE=PU - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -;Files -"\epoc32\release\armv5\udeb\lcvtengineplugin.dll" - "!:\sys\bin\lcvtengineplugin.dll" -"\epoc32\data\Z\Resource\Plugins\lcvtengineplugin.RSC"-"!:\resource\plugins\lcvtengineplugin.RSC" diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/data/lcvtplugin_stub.pkg --- a/vtuis/lcvtplugin/data/lcvtplugin_stub.pkg Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -; -; 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: -; -; Languages -&EN - -; Header -#{"lcvtplugin"}, (0xF0112235), 1, 0, 0, TYPE=SA - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -;Files -""-"Z:\sys\bin\lcvtengineplugin.dll" -""-"Z:\resource\plugins\lcvtengineplugin.RSC" \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/data/lcvtplugin_stub.sis Binary file vtuis/lcvtplugin/data/lcvtplugin_stub.sis has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/group/bld.inf --- a/vtuis/lcvtplugin/group/bld.inf Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -#include - -PRJ_EXPORTS -// Export IBY files -../rom/lcvt.iby CORE_APP_LAYER_IBY_EXPORT_PATH(lcvt.iby) -../data/lcvtplugin_stub.sis /epoc32/data/z/system/install/lcvtplugin_stub.sis - -PRJ_MMPFILES -lcvt.mmp diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/group/lcvt.mmp --- a/vtuis/lcvtplugin/group/lcvt.mmp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* ============================================================================== -* Name : lcvt.mmp -* Part of : -* Description : -* Version : -* -* Copyright © 2006 Nokia Corporation. -* This material, including documentation and any related -* computer programs, is protected by copyright controlled by -* Nokia Corporation. All rights are reserved. Copying, -* including reproducing, storing, adapting or translating, any -* or all of this material requires the prior written consent of -* Nokia Corporation. This material also contains confidential -* information which may not be disclosed to others without the -* prior written consent of Nokia Corporation. -* ============================================================================== -*/ - -#include - -// Capability assignment. -CAPABILITY CAP_GENERAL_DLL - -// Vendor ID assignment. -VENDORID VID_DEFAULT - -TARGET lcvtengineplugin.dll -TARGETTYPE PLUGIN - -EPOCALLOWDLLDATA - -UID 0x10009D8D 0xF0112235 - -USERINCLUDE ../inc/base -USERINCLUDE ../inc/common -USERINCLUDE ../inc/control -USERINCLUDE ../inc/states -USERINCLUDE ../../lcvtindicatorcontroller/inc - -APP_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE ../../../inc - - -SOURCEPATH ../src/base -SOURCE dllmain.cpp clcvtengine.cpp clcvtsession.cpp clcvtcmdexecutor.cpp clcvtactiveexec.cpp clcvtappshutter.cpp - -SOURCEPATH ../src/common -SOURCE lcvtutility.cpp tlcvtstates.cpp tlcvtaudiostate.cpp tlcvtmediastate.cpp - -SOURCEPATH ../src/control -SOURCE tlcvtcamerahandler.cpp clcvtlocalvideoplayer.cpp clcvtremotevideoplayer.cpp clcvtvideoplayerbase.cpp - -SOURCEPATH ../src/states -SOURCE tlcvtstatebase.cpp tlcvtstatestarting.cpp tlcvtstaterunning.cpp tlcvtstateresetting.cpp - - -SOURCEPATH ../data -START RESOURCE F0112235.rss -TARGET lcvtengineplugin.rsc -END - - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY flogger.lib -LIBRARY centralrepository.lib -LIBRARY featmgr.lib -LIBRARY ws32.lib -LIBRARY efsrv.lib -LIBRARY estor.lib -LIBRARY fbscli.lib -LIBRARY gdi.lib - -LIBRARY eikcore.lib -LIBRARY apparc.lib -LIBRARY cone.lib -LIBRARY eikcoctl.lib -LIBRARY apgrfx.lib -LIBRARY eikdlg.lib -LIBRARY bitgdi.lib -LIBRARY egul.lib - -LIBRARY aknlayout.lib -LIBRARY aknlayout2.lib -LIBRARY avkon.lib -LIBRARY aknskins.lib -LIBRARY aknnotify.lib - - -LIBRARY videoteleng.lib -DEBUGLIBRARY vtlogger.lib - -LIBRARY phoneclient.lib - -LIBRARY lcvtindicatorcontroller.lib diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/base/clcvtactiveexec.h --- a/vtuis/lcvtplugin/inc/base/clcvtactiveexec.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2008 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: Asynchronous execution class for LC VT plugin. -* -*/ - - - -#ifndef CLCVTACTIVEEXEC_H -#define CLCVTACTIVEEXEC_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CLcVtActiveExec; - -// CLASS DECLARATION - -/** -* Interface for asynchronous execution. -* -* @since Series 60 2.6 -*/ -class MLcVtActiveExec - { - public: // New functions - - /** - * Starts execution of a command. - * @param aActiveExec active executor. - * @param aState state based on which execution can be started. - * @param aNextState next state. - * @param aRequest request status, which should be used if operation is - * asynchronous. - * @return ETrue if operation was synchronous, otherwise EFalse. - */ - virtual TBool ActiveExecExecuteL( - CLcVtActiveExec& aActiveExec, - const TInt aState, - TInt& aNextState, - TRequestStatus& aRequest ) = 0; - - /** - * Decide whether to continue or not. - * @param aActiveExec active executor. - * @param aState current state, should be updated to new state. - * @param aError error code. - * @return ETrue if continued, EFalse if stopped. - */ - virtual TBool ActiveExecContinue( - CLcVtActiveExec& aActiveExec, - TInt& aState, - const TInt aError ) = 0; - - /** - * Cancels operation of specific state. - * @param aActiveExec active executor. - * @param aState state. - */ - virtual void ActiveExecCancel( - CLcVtActiveExec& aActiveExec, - const TInt aState ) = 0; - - /** - * Informs that operation has been finished. - * @param aActiveExec active executor. - * @param aInitialState initial state. - */ - virtual void ActiveExecDone( - CLcVtActiveExec& aActiveExec, - const TInt aInitialState ) = 0; - - }; - -/** -* Asynchronous execution class for LC VT plugin. -* -* @since Series 60 2.6 -*/ -class CLcVtActiveExec - : public CActive - { - public: // Constructors and destructor - - /** - * Constructor. - * @param aPriority priority of the active object. - */ - CLcVtActiveExec( - const TInt aPriority ); - - /** - * Destructor. - */ - ~CLcVtActiveExec(); - - public: // New functions - - /** - * Starts execution. - * @param aStartState initial state. - * @param aExec executor. - */ - void Start( - TInt aStartState, - MLcVtActiveExec& aExec ); - - /** - * Initial state of currently - * active operation. - * - * @return initial state, or KErrNotFound if no operation ongoing. - */ - TInt InitialState() const; - - /** - * Returns request status. - * @return request status. - */ - TInt RequestStatus() const; - - protected: // Functions from base classes - - /** - * @see CActive::RunL. - */ - virtual void RunL(); - - /** - * @see CActive::DoCancel. - */ - virtual void DoCancel(); - - /** - * @see CActive::RunError. - */ - virtual TInt RunError( TInt aError ); - - private: - - // Ref to active executor. - MLcVtActiveExec* iActiveExec; - - // Initial state. - TInt iInitialState; - - // Current state. - TInt iCurrentState; - - // Next state. - TInt iNextState; - - }; - -#endif // CLCVTACTIVEEXEC_H - -// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/base/clcvtappshutter.h --- a/vtuis/lcvtplugin/inc/base/clcvtappshutter.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ -/* -* Copyright (c) 2008 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: Class responsible for application exit. -* -*/ - - -#ifndef C_VTUIAPPSHUTTER_H -#define C_VTUIAPPSHUTTER_H - -#include - -#include -#include -#include - -class CAsyncCallBack; -class MLcVtShutterObserver; -class MLcVtStateContext; - -/** -* Shutdown service for the application. This is singleton -* which deletes itself when shutdown is complete. -* -* @since S60 v3.2 -*/ -class CLcVtAppShutter : public CBase - { -public: - - /** - * Returns the instance of application shutter. - * - * @param aComms for sending call ending related commands to Phone. - * @param aObserver observer informed when shutdown is completed. - * @return the application shutter - */ - static CLcVtAppShutter* InstanceL( - MLcVtShutterObserver& aObserver ); - - /** - * Starts shutdown. - */ - void StartShutdown(); - - /** - * Starts shutdown because emergency call was requested by the user. - * If supplied number is detected other than emergency number this method - * leaves KErrArgument. - * @param aStateContext for accessing emergency number and local - * variation. - */ - void ShutdownWithEmergencyCallL( MLcVtStateContext& aStateContext ); - - /** - * Callback from emergency caller. - */ - void EmergencyCallDoneL(); - -private: - - /** - * Exits the application if no pending shutdown preparation - * is ongoing. Deletes itself as last action. - */ - void ShutdownIfReadyAndDestroy(); - - - /** - * Enques async callback. - */ - void EnqueCallbackL( TCallBack& aCallback ); - - /** - * Asynch callback handling response to emergency call creation. - */ - static TInt EmergencyResponseCallback( TAny* aAny ); - - /** C++ constructor */ - CLcVtAppShutter( MLcVtShutterObserver& aObserver ); - - /** destructor */ - ~CLcVtAppShutter(); - -private: // for making shutdown with emergency call - class CEmergencyCaller : public CBase, private MPhCltEmergencyCallObserver - { - public: - /** - * Dials emergency call. Object destroys itself when - * response is received. - */ - static CEmergencyCaller* DialEmergencyL( - CLcVtAppShutter& aObserver, - MLcVtStateContext& aStateContext ); - - // Destructor - ~CEmergencyCaller(); - - private: // C++ constructor - - CEmergencyCaller( - CLcVtAppShutter& aObserver, - MLcVtStateContext& aStateContext ); - - /** - * 2nd phase constructor - */ - void ConstructL(); - - public: // from MPhCltEmergencyCallObserver - /** - * @see MPhCltEmergencyCallObserver::HandleEmergencyDialL - */ - virtual void HandleEmergencyDialL( const TInt aStatus ); - - private: // Data - - // Emergency number - TPhCltTelephoneNumber iNumber; - - // Phone Server session - RPhCltServer iServer; - - // Emergency call handler - CPhCltEmergencyCall* iEmergency; - - // Observer for callback - CLcVtAppShutter& iObserver; - - // State context for gettin entered numbers and local variation - MLcVtStateContext& iStateContext; - }; -private: // Data - - /** - * Guard flags for completing shutdown. - * All must be cleared before shutdown - * can be completed. - */ - enum TShutterFlags - { - /** Waiting for call on StartShutdown() */ - EShutterWaitingStart, - /** Waiting for callback on emegency call request */ - EShutterWaitingEmergencyCallback, - }; - - // Asynch callback - CAsyncCallBack* iCallback; - - // guard flags - TBitFlags8 iPendingStateFlags; - - // Observer to notify when application exit - // is allowed. - MLcVtShutterObserver& iObserver; - - // Handles emergency call dialling - CEmergencyCaller* iEmergencyCaller; - - }; - -#endif // C_VTUIAPPSHUTTER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/base/clcvtcmdexecutor.h --- a/vtuis/lcvtplugin/inc/base/clcvtcmdexecutor.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/* -* Copyright (c) 2008 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: Class for command execution for Video Telephone application. -* -*/ - -#ifndef CLCVTCMDEXECUTOR_H_ -#define CLCVTCMDEXECUTOR_H_ - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class MVtEngCommandHandler; -class MLcVtEngineCommandManager; - -// CLASS DECLARATION - -/** -* Class for command execution for Video Telephone application. -* -* @since Series 60 2.6 -*/ -class CLcVtCmdExecutor - : public CBase, - private MVtEngCommandObserver - { - public: // Constructors and destructor - - /** - * Constructor. - * - * @param aSelfPtr optional pointer to itself. - * @param aCommandHandler command handler. - * @param aCommandManager command manager. - */ - CLcVtCmdExecutor( - CLcVtCmdExecutor** aSelfPtr, - MVtEngCommandHandler& aCommandHandler, - MLcVtEngineCommandManager& aCommandManager ); - - /** - * Destructor. - */ - ~CLcVtCmdExecutor(); - - public: // New functions - - /** - * Executes command. - * @param aCommandId command identifier. - * @param aParams parameters. - * @param aRequest request status, optional. - */ - void ExecuteCmdL( - const TVtEngCommandId aCommandId, - TDesC8* aParams, - TRequestStatus* aRequest ); - - /** - * @see MVtEngCommandObserver::HandleVTCommandPerformedL. - */ - virtual void HandleVTCommandPerformedL( - TVtEngCommandId aCommand, - const TInt aError ); - - protected: // New functions - - /** - * Completes dialog with error. - * Note: this method will delete the dialog. - * @param aError error code. - */ - void Complete( const TInt aError ); - - private: - /** - * Handles execution failure. - * @param aResult error code. - */ - void HandleExecuteFailed( TInt aResult ); - - private: - - // Inner class. - class CActiveCmd; - - // Friend. - friend class CActiveCmd; - - //pointer to itself - CLcVtCmdExecutor** iSelfPtr; - - // Error code. - TInt* iError; - - // Request status. - TRequestStatus* iRequest; - - // Ref to command handler. - MVtEngCommandHandler& iCommandHandler; - - // Ref to command manager. - MLcVtEngineCommandManager& iCommandManager; - - // Command to be executed. - TVtEngCommandId iCommand; - - // Owned parameters. - HBufC8* iCommandParams; - - // ETrue if command has been completed. - TBool iCommandCompleted; - - // Owned active object to perform the command. - CActiveCmd* iActiveCmd; - - // ActiveSheduler Waiter inside CLcVtCmdExecutor - CActiveSchedulerWait iWait; - - }; - - - -#endif /* CLCVTCMDEXECUTOR_H_ */ diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/base/clcvtengine.h --- a/vtuis/lcvtplugin/inc/base/clcvtengine.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2008 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: LiveComm Videotelephony Plugin Class -* -*/ - -#ifndef CLCVTENGINE_H -#define CLCVTENGINE_H - -#include -#include - -class CLcVtSession; -class MLcSessionObserver; -class MLcUiProvider; -class MLcSession; - -class CLcVtEngine : public CLcEngine - { -public: - - /** - * Static constructor - * - * @param aParams ECom instantiation parameters - * @return An initialized instance of this class. - */ - static CLcVtEngine* NewL( TAny* aParams ); - - ~CLcVtEngine(); - -public: // From CLcEngine - - MLcSession& Session(); - - TBool IsFeatureSupported( TLcFeature aLcFeature ); - -private: - void ConstructL(); - CLcVtEngine(); - -private: - - CLcVtSession* iSession; - - }; - -#endif // CLCVTENGINE_H - -// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/base/clcvtsession.h --- a/vtuis/lcvtplugin/inc/base/clcvtsession.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,572 +0,0 @@ -/* -* ========================================================================== -* Name : lcvtsession.h -* Description : -* Version : -* -* Copyright ?2005 Nokia Corporation. -* This material, including documentation and any related -* computer programs, is protected by copyright controlled by -* Nokia Corporation. All rights are reserved. Copying, -* including reproducing, storing, adapting or translating, any -* or all of this material requires the prior written consent of -* Nokia Corporation. This material also contains confidential -* information which may not be disclosed to others without the -* prior written consent of Nokia Corporation. -* ========================================================================== -*/ - -#ifndef LCVTSESSION_H -#define LCVTSESSION_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - -#include "tlcvtcamerahandler.h" -#include "clcvtactiveexec.h" -#include "tlcvtstatebase.h" -#include "lcvtindicatorcontroller.h" - -#define NGA_VIDEO_RENDER - -class CVtEngModel; -class CLcVtLocalVideoPlayer; -class CLcVtRemoteVideoPlayer; -class TLcVtStates; -class CLcVtCmdExecutor; - - -class CLcVtSession : public CBase, - public MLcSession, - public MLcAudioControl, - public MLcVtActiveExec, - public MLcVtStateContext - { -public: - - static CLcVtSession* NewL(); - - ~CLcVtSession(); - -public: // From MLcSession - - TLcSessionState LcSessionState() const; - - void EstablishLcSessionL(); - - void TerminateLcSessionL(); - - void SetLcSessionObserver( MLcSessionObserver* aObserver ); - - void SetLcUiProvider( MLcUiProvider* aUiProvider ); - - TBool IsBackgroundStartup(); - - MLcVideoPlayer* RemoteVideoPlayer(); - - MLcVideoPlayer* LocalVideoPlayer(); - - const TDesC& LocalDisplayName(); - - const TDesC& RemoteDisplayName(); - - TInt SetParameter( TInt aId, TInt aValue ); - - TInt ParameterValue( TInt aId ); - - TInt SetForegroundStatus( TBool aIsForeground ); - - const TDesC& RemoteDetails(); - - void UpdateLcSessionL(); - - TBool SendDialTone( TChar aKey ); - -public: // from MLcAudioControl - - TBool IsLcAudioMutedL(); - - void MuteLcAudioL( TBool aMute ); - - TBool IsLcMicMutedL(); - - void MuteLcMicL( TBool aMute ); - - TBool IsEnablingLcLoudspeakerAllowed(); - - void EnableLcLoudspeakerL( TBool aEnabled ); - - TBool IsLcLoudspeakerEnabled(); - - TInt LcVolumeL(); - - void SetLcVolumeL( TInt aValue ); - - void IncreaseLcVolumeL(); - - void DecreaseLcVolumeL(); - -public: //from MLcVtActiveExec - /** - * @see MLcVtActiveExec::ActiveExecExecuteL. - */ - TBool ActiveExecExecuteL( - CLcVtActiveExec& aActiveExec, - const TInt aState, - TInt& aNextState, - TRequestStatus& aRequest ); - - /** - * @see MLcVtActiveExec::ActiveExecContinue. - */ - TBool ActiveExecContinue( - CLcVtActiveExec& aActiveExec, - TInt& aState, - const TInt aError ); - - /** - * @see MLcVtActiveExec::ActiveExecCancel. - */ - void ActiveExecCancel( - CLcVtActiveExec& aActiveExec, - const TInt aState ); - - /** - * @see MLcVtActiveExec::ActiveExecDone. - */ - virtual void ActiveExecDone( - CLcVtActiveExec& aActiveExec, - const TInt aInitialState ); - -public: //new function - /** - * @see MLcVtActiveExec::ActiveExecExecuteL. - */ - TBool ActiveExecInitExecuteL( - const TInt aState, - TInt& aNextState, - TRequestStatus& aRequest ); - - /** - * @see MLcVtActiveExec::ActiveExecContinue. - */ - TBool ActiveExecInitContinue( - TInt& aState, - const TInt aError ); - - /** - * @see MLcVtActiveExec::ActiveExecCancel. - */ - void ActiveExecInitCancel( - const TInt aState ); - - /** - * @see MLcVtActiveExec::ActiveExecDone. - */ - void ActiveExecInitDone( - const TInt aInitialState ); - - /** - * Executes command taking no parameters. - * @param aCommand command to be performed. - * @param aRequest request status. - */ - void ActiveExecInitExecuteCommandL( - const TVtEngCommandId aCommand, - TRequestStatus& aRequest ); - - /** - * Executes command taking no parameters. - * @param aCommand command to be performed. - * @param aParam command parameters. - * @param aRequest request status. - */ - template < class T > - void ActiveExecInitExecuteCommandL( - const TVtEngCommandId aCommand, - T& aParam, - TRequestStatus& aRequest ); - - /** - * Executes prepare viewfinder command. - * @param aRequest request status to be completed when finished. - */ - void ActiveExecInitPrepareViewFinderL( - TRequestStatus& aRequest ); - - /** - * Executes prepare remote render command. - * @param aRequest request status to be completed when finished. - */ - void ActiveExecInitPrepareRemoteRenderL( - TRequestStatus& aRequest ); - - /** - * Executes 'prepare camera' command. - * @param aSource source to be prepared. - * @param aRequest request status. - */ - void ActiveExecInitPrepareCameraL( - const MVtEngMedia::TMediaSource aSource, - TRequestStatus& aRequest ); - - /** - * Executes 'set source' command. - * @param aSource source to be selected. - * @param aRequest request status. - */ - void ActiveExecInitSetSourceL( - const MVtEngMedia::TMediaSource aSource, - TRequestStatus& aRequest ); - - /** - * Performs a command without any parameters. - * @param aCommand command to be performed. - */ - void ExecuteCmdL( const TVtEngCommandId aCommand ); - - /** - * Performs a command with a parameter. - * @param aCommmand command to be performed. - * @param aParam parameter. - */ - template< class T > - void ExecuteCmdL( - const TVtEngCommandId aCommand, - T& aParam ); - - // ASYNCHRONOUS EXECUTION: - - /** - * Performs a command without any parameters. - * @param aExecutorPtr pointer to which returned value is stored. - * @param aCommand command to be performed. - * @param aStatus request status. - * @return dialog. - */ - CLcVtCmdExecutor* ExecuteCmdAsyncL( - CLcVtCmdExecutor** aExecutorPtr, - const TVtEngCommandId aCommand, - TRequestStatus& aStatus ); - - /** - * Performs a command with a parameter. - * @param aExecutorPtr pointer to which returned value is stored. - * @param aCommmand command to be performed. - * @param aParam parameter. - * @param aStatus request status. - * @return dialog. - */ - template< class T > - CLcVtCmdExecutor* ExecuteCmdAsyncL( - CLcVtCmdExecutor** aExecutorPtr, - const TVtEngCommandId aCommand, - T& aParam, - TRequestStatus& aStatus ); - - /** - * Performs a command. - * @param aExecutorPtr pointer to which returned value is stored. - * @param aCommand command. - * @param aParams parameter, optional. - * @param aStatus request status. - * @return dialog. - */ - CLcVtCmdExecutor* DoExecuteCmdAsyncL( - CLcVtCmdExecutor** aExecutorPtr, - const TVtEngCommandId aCommand, - TDesC8* aParams, - TRequestStatus& aStatus ); - - /** - * Executes command in TRAP harnness. - * @param aCommand command identifier. - * @param aParam optional, parameters. - * @return error code. - */ - TInt Execute( const TVtEngCommandId aCommand, TDesC8* aParam ); - - /** - * Handles layout changes basically calling HandleLayoutChangedL - * in trap harness. - * @return error code. - */ - //TInt HandleLayoutChanged(); - - /** - * Handles layout changes. - */ - void HandleLayoutChangedL(); - -public: //from MLcVtStateContext - - /** @see MLcVtStateContext::StartupPhase1L */ - void StartupPhase1L(); - - /** @see MLcVtStateContext::ShutdownL */ - void ShutdownL(); - - /** @see MLcVtStateContext::StartupPhase2L */ - void StartupPhase2L(); - - /** @see MLcVtStateContext::ChangeApplicationFocus */ - void ChangeApplicationFocus( const TBool aForeground ); - - /** @see MLcVtStateContext::ChangeState */ - void ChangeState( TLcVtStateBase* aState ); - - /** @see MLcVtStateContext::StartTone */ - //void StartDtmfTone( const TChar& aTone ); - - /** @see MLcVtStateContext::StopTone */ - //void StopDtmfTone(); - - /** @see MLcVtStateContext::Model */ - CVtEngModel& Model(); - - /** @see MLcVtStateContext::NumberSource*/ - TDesC* NumberSource() const; - - /** @see MLcVtStateContext::RefreshL */ - void RefreshL( const TInt aRefreshFlags ); - - /** @see MLcVtStateContext::RefreshStatesL */ - void RefreshStatesL(); - - /** @see MLcVtStateContext::DoExecuteCmdL */ - void DoExecuteCmdL( - const TVtEngCommandId aCommand, - TDesC8* aParams ); - - /** @see MLcVtStateContext::DoHandleLayoutChangedL */ - void DoHandleLayoutChangedL(); - - /** From MLcVtShutterObserver via MLcVtStateContext - * Exits the application. - */ - void HandleShutdownReady(); - - /** @see MLcVtStateContext::SetCallIdL */ - void SetCallIdL( const TInt aCallId ); - - /** @see MLcVtStateContext::SetCallNameL */ - TBool SetCallNameL( const TDesC& aName ); - - /** @see MLcVtStateContext::SetCallNumberL */ - void SetCallNumberL( const TDesC& aNumber ); - - /** @see MLcVtStateContext::StartShutdown */ - void StartShutdown(); - -public: //new functions - - /** - * Static async callback for handling layout change. - */ - //static TInt DelayedHandleLayoutChanged( TAny* aPtr ); - - /** - * Callback function to exit. - * @param aAny pointer to instance of this class. - * @return KErrNone always. - */ - static TInt DoExit( TAny* aAny ); - - /** - * Close UI Application. - */ - void CloseApp(); - - /** - * Handles engine reset. - */ - void HandleEngineResetL(); - - /** - * Handle plugin command. - */ - void HandleCommandL(const TInt acommand); - - /** - * Sets given zoom step, if it allowed. - * @param aZoomStep New zoom step to be set. - */ - void SetZoomFactorL( TInt aZoomStep ); - - /** - * Updates rendering parameters. - */ - void UpdateRenderingParametersL(); - - inline TLcVtStates& LcVtStates(); - -#ifndef NGA_VIDEO_RENDER - void vtHandleFrameL( CFbsBitmap* aBitmap ); -#endif - TBool IsFeatureSupported( CLcEngine::TLcFeature aLcFeature ); - - -private: - CLcVtSession(); - - void ConstructL(); - -#ifndef NGA_VIDEO_RENDER - /** - * connect to font & bitmap server. - */ - void ConnectFbsServerL(); - - /** - * disconnect from font & bitmap server. - */ - void DisconnectFbsServer(); -#endif - - // COMMAND HANDLING - - /** - * Enables audio (unmute microphone). - */ - void CmdEnableAudioL(); - - /** - * Disables audio (mute microphone). - */ - void CmdDisableAudioL(); - - /** - * Switches used camera. - * @param aPrimaryCamera ETrue if primary camera is to be selected, - * EFalse if secondary camera is to be selected. - */ - void CmdUseCameraL( const TBool aPrimaryCamera ); - - /** - * Activates loudspeaker. - */ - void CmdActivateLoudspeakerL(); - - /** - * Deactivates loudspeaker. - */ - void CmdDeactivateLoudspeakerL(); - - /** - * Enables video. - */ - void CmdEnableVideoL(); - - /** - * Disables video. - */ - void CmdDisableVideoL(); - -#ifdef NGA_VIDEO_RENDER - void CreateVideoWindowsL(); - void DestroyVideoWindows(); -#endif - -private: - class CEventObserver; - -private: -#ifdef NGA_VIDEO_RENDER - RWindow* iRemoteVideoWindow; - RWindow* iLocalVideoWindow; -#else - CFbsBitmap* iDummy; - CWindowGc* iGc; - TBool iFbsStarted; - RWsSession* iWsSession; - CWsScreenDevice* iWsSessionScreenDev; - RWindowGroup *iRootWin; -#endif - // Owned event observer. - CEventObserver* iEventObserver; - // Engine model. - CVtEngModel* iModel; - // plugin states (media, audio, boolean variables) - TLcVtStates* iLcVtStates; - - TVtCameraHandler iCameraHandler; - CLcVtLocalVideoPlayer* iLocalVideoPlayer; - CLcVtRemoteVideoPlayer* iRemoteVideoPlayer; - - MLcSessionObserver* iObserver; - MLcUiProvider* iUiProvider; - - TLcSessionState iSessionState; - - // Owned active executor for initialisation / uninitialisation. - CLcVtActiveExec* iActiveExec; - - CLcVtCmdExecutor* iCmdExecutor; - - // Reference to request status. - TRequestStatus* iShutdownRequest; - - TLcVtStateBase* iState; - - // ASync callback. - CAsyncCallBack* iAsyncCallback; - - // Async callback for layout change - //CAsyncCallBack* iLayoutChangeCallback; - - // DTMF tone, used as parameter to KVtEngStartDtmfTone. - TPckgBuf< TChar > iDtmfTone; - - TBool iLoudspeakerEnabled; - TBool iMute; - - RWindow* iMainWindow; - - RWsSession iRwSession; - RWindowGroup* iRwGroup; - CWsScreenDevice* iDev; - - HBufC* iRemoteDisplayName; - HBufC* iRemoteDetails; - - TInt VideoSendingKey; - - LcVtIndicatorController* iIndicatorCtr; - }; - - -TLcVtStates& CLcVtSession::LcVtStates() - { - return *iLcVtStates; - } -#endif // LCVTSESSION_H - -// end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/base/lcvtplugincommand.h --- a/vtuis/lcvtplugin/inc/base/lcvtplugincommand.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2008 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: Plguin command -* -*/ - -#ifndef LCVTPLUGINCOMMAND_H_ -#define LCVTPLUGINCOMMAND_H_ - -enum - { - // End active call - EPluginCmdEndActiveCall = 5000, - // Switch to voice call - EPluginCmdCreateVoice, - // Create a emergency call - EPluginCmdDialEmergency, - // Enable video - EPluginCmdEnableVideo, - // Enable audio - EPluginCmdEnableAudio, - // Disable video - EPluginCmdDisableVideo, - // Disable audio - EPluginCmdDisableAudio, - // Use primary camera - EPluginCmdUsePrimaryCamera, - // Use secondary camera - EPluginCmdUseSecondaryCamera, - // Active Loudspeaker - EPluginCmdActivateLoudspeaker, - // Deactive Loudspeaker - EPluginCmdDeactivateLoudspeaker - }; - - -#endif /* LCVTPLUGINCOMMAND_H_ */ diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/base/mlcvtenginecommandmanager.h --- a/vtuis/lcvtplugin/inc/base/mlcvtenginecommandmanager.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* - * mlcvtenginecommandmanager.h - * - * Created on: Jun 29, 2009 - * Author: z51wang - */ - -#ifndef M_LCVTENGINECOMMANDMANAGER_H -#define M_LCVTENGINECOMMANDMANAGER_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class MVtEngCommandObserver; - -// CLASS DECLARATION - -/** -* Command manager class for Video Telephone application. -* -* @since Series 60 2.6 -*/ -class MLcVtEngineCommandManager - { - public: // New functions - - /** - * Adds observer. - * @param aObserver observer to be added. - */ - virtual void AddObserverL( MVtEngCommandObserver& aObserver ) = 0; - - /** - * Removes observer. - * @param aObserver observer to be removed. - */ - virtual void RemoveObserver( MVtEngCommandObserver& aObserver ) = 0; - - }; - - -#endif /* M_LCVTENGINECOMMANDMANAGER_H */ diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/base/mlcvtshutterobserver.h --- a/vtuis/lcvtplugin/inc/base/mlcvtshutterobserver.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2008 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: Interface for reporting application shutdown readiness. -* -*/ - - -#ifndef M_MLCVTSHUTTEROBSERVER_H -#define M_MLCVTSHUTTEROBSERVER_H - - -/** -* Observer interface for reporting shutdown readiness. -* -* @since S60 v3.2 -*/ -class MLcVtShutterObserver - { -public: - - /** - * Called when application can exit. - */ - virtual void HandleShutdownReady() = 0; - }; - -#endif // M_MLCVTSHUTTEROBSERVER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/base/mlcvtstatecontext.h --- a/vtuis/lcvtplugin/inc/base/mlcvtstatecontext.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* Copyright (c) 2008 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: Interface for state objects to request application services. -* -*/ - - -#ifndef M_MLCVTSTATECONTEXT_H -#define M_MLCVTSTATECONTEXT_H - -#include -#include -#include "mlcvtshutterobserver.h" - -class TLcVtStateBase; -class CVtEngModel; - -/** -* Provides service interface for vt plugin state objects. -* -* @since S60 v3.2 -*/ -class MLcVtStateContext : public MLcVtShutterObserver - { - public: - - /** - * Starts first phase of startup when prepare is received. - */ - virtual void StartupPhase1L() = 0; - - /** - * Starts application shutdown. - */ - virtual void ShutdownL() = 0; - - /** - * Starts second phase of startup. - */ - virtual void StartupPhase2L() = 0; - - /** - * Sets application to foreground and background. - * @param aForeground ETrue => foreground, EFalse => background - */ - virtual void ChangeApplicationFocus( const TBool aForeground ) = 0; - - /** - * Changes current application state. - * @param aState new state - */ - virtual void ChangeState( TLcVtStateBase* aState ) = 0; - - /** - * Starts DTMF tone. - * @param aTone DTMF tone. - */ - //virtual void StartDtmfTone( const TChar& aTone ) = 0; - - /** - * Stops tarts DTMF tone. - */ - //virtual void StopDtmfTone() = 0; - - /** - * Returns model. - * @return model - */ - virtual CVtEngModel& Model() = 0; - - /** - * Returns source containing numbers typed by the user. - * @return number soure - */ - virtual TDesC* NumberSource() const = 0; - - /** - * Executes engine command. - * @param aCommand command id - * @param aParams command params - */ - virtual void DoExecuteCmdL( const TVtEngCommandId aCommand, - TDesC8* aParams ) = 0; - - /** - * Refreshes application UI. - * @param aRefreshFlags identifies what to refresh - */ - virtual void RefreshL( const TInt aRefreshFlags ) = 0; - - /** - * Updates engine states. - */ - virtual void RefreshStatesL() = 0; - - /** - * Handles layout change. - */ - //virtual void DoHandleLayoutChangedL() = 0; - - /** - * Sets call id. - */ - virtual void SetCallIdL( const TInt aCallId ) = 0; - - /** - * Sets display text of remote end. - */ - virtual TBool SetCallNameL( const TDesC& aName ) = 0; - - /** - * Sets call number text of remote end. - */ - virtual void SetCallNumberL( const TDesC& aNumber ) = 0; - - /** - * Start shutdown process - */ - virtual void StartShutdown() = 0; - - - /** - * Refresh flags - */ - enum TRefreshFlags - { - /** Navipane is refreshed */ - ENaviPane = 0x01, - /** Softkeys are refreshed */ - ESoftkeys = 0x02, - /** Refreshes blind (video availability) status */ - EBlind = 0x04, - /** Refreshes state sync with call handling */ - ESynchronise = 0x08, - /** Refreshes internal states (media etc) */ - EUiStates = 0x10, - /** Refreshes everything */ - EAll = ENaviPane | - ESoftkeys | - EBlind | - ESynchronise | - EUiStates - }; - }; - - -#endif // M_MLCVTSTATECONTEXT_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/common/lcvtutility.h --- a/vtuis/lcvtplugin/inc/common/lcvtutility.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* -* Copyright (c) 2008 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: Utility methods for Video Telephone application. -* -*/ - - - -#ifndef LCVTUTILITY_H -#define LCVTUTILITY_H - -// INCLUDES -#include -#include -#include -#include - -// FORWARD DECLARATIONS - -// CLASS DECLARATION - -/** -* Utility methods for Video Telephone application. -* -* @since Series 60 2.6 -*/ -class LcVtUtility - { - public: // New functions - - /** - * Enumerates audio routing masks. - */ - enum TAudioRoutingMask - { - // Deactivate loudspeaker. - EDeactivateLoudspeaker = (1<<0), - // Activate loudspeaker. - EActivateLoudspeaker = (1<<1), - // Deactivate BT handsfree. - EDeactivateBtHandsfree = (1<<2), - // Activate BT handsfree. - EActivateBtHandsfree = (1<<3) - }; - - /** - * Gets audio routing availabilities. - * @param aAudio audio instance. - * @param aAvailable availability bitmap. - */ - static void GetAudioRoutingAvailability( - MVtEngAudio& aAudio, - TInt& aAvailable ); - - /** - * Gets outgoing media state. - * @param aMedia media instance. - * @param aAvailable availability bitmap. - */ - static void GetOutgoingMediaState( - MVtEngMedia& aMedia, - TInt& aAvailable ); - - /** - * Gets incoming media state. - * @param aMedia media instance. - * @param aAvailable availability bitmap. - */ - static void GetIncomingMediaState( - MVtEngMedia& aMedia, - TInt& aAvailable ); - - /** - * Checks if media has still image. - * @param aMedia media instance. - * @return ETrue if media has still image. - */ - static TBool HasStillImage( - MVtEngMedia& aMedia ); - - /** - * Gets freeze's current status. - * @param aMedia media instance. - * @return ETrue if active provider is frozen, EFalse otherwise. - */ - static TBool GetFreezeState( - MVtEngMedia& aMedia ); - - /** - * Checks if freeze is supported. - * @param aMedia media instance. - * @return ETrue if freeze is supported. - */ - static TBool IsFreezeSupported( - MVtEngMedia& aMedia ); - - /** - * Gets current local video quality setting. - * @param aMedia media instance. - * @param aVideoQuality Current local video quality settings. - */ - static void GetVideoQuality( - MVtEngMedia& aMedia, - MVtEngMedia::TVideoQuality& aVideoQuality ); - /** - * Gets current object sharing state. - * @param aMedia media instance. - * @param aShareObjectState contains current object sharing state on - * return. - */ - static void GetObjectSharingState( MVtEngMedia& aMedia, - MVtEngMedia::TShareObjectState& aShareObjectState ); - - /** - * Checks if zooming is allowed. - * @param aMedia media instance. - * @return ETrue if allowed, EFalse otherwise. - */ - static TBool IsZoomAllowed( - MVtEngMedia& aMedia ); - - /** - * Checks if the device has cameras currently attached. - * @param aMedia media instance. - * @return ETrue if there are cameras available. - */ - static TBool HasCameras( MVtEngMedia& aMedia ); - - /** - * Checks if the character is DTMF enabled. - * @param aChar The character. - * @return ETrue if this character is DTMF character. - */ - static TBool IsDTMFCharacter( const TChar aChar ); - - private: - - /** - * Checks if audio routing is available. - * @param aAudio audio instance. - * @param aCurrent current speaker. - * @param aSource source speaker. - * @param aTarget target speaker. - */ - static TBool IsAudioRoutingAvailable( - MVtEngAudio& aAudio, - const MVtEngAudio::TAudioRoutingState aCurrent, - const MVtEngAudio::TAudioRoutingState aSource, - const MVtEngAudio::TAudioRoutingState aTarget ); - - }; - -#endif // LCVTUTILITY_H - -// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/common/tlcvtaudiostate.h --- a/vtuis/lcvtplugin/inc/common/tlcvtaudiostate.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* Copyright (c) 2008 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: Audio state class definition. -* -*/ - - -#ifndef T_LCVTAUDIOSTATE_H -#define T_LCVTAUDIOSTATE_H - -#include - -#include "tlcvtflagcontainer.h" - -class CVtEngModel; - -/** - * TLcVtAudioState - * - * Contains status information about video telephony audio. - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TLcVtAudioState ) : public TLcVtUpdateableFlagContainer - { -public: - - /** - * Constructor - * - * @param aModel Reference to VT engine model. - */ - inline TLcVtAudioState( CVtEngModel& aModel ); - - /** - * Return whether audio is enabled or not. - * - * @return ETrue if audio is enabled EFalse otherwise. - */ - inline TBool IsAudio() const; - - /** - * Return whether BT handsfree can be activated or not. - * - * @return ETrue if BT handsfree can be activated EFalse otherwise. - */ - inline TBool CanActivateBtHf() const; - - /** - * Return whether BT handsfree can be deactivated or not. - * - * @return ETrue if BT handsfree can be deactivated EFalse otherwise. - */ - inline TBool CanDeactivateBtHf() const; - - /** - * Return whether loudspeaker can be activated or not. - * - * @return ETrue if loudpseaker can be activated EFalse otherwise. - */ - inline TBool CanActivateLoudspeaker() const; - - /** - * Return whether loudspeaker can be deactivated or not. - * - * @return ETrue if loudspeaker can be deactivated EFalse otherwise. - */ - inline TBool CanDeactivateLoudspeaker() const; - - /** - * Return whether or not audio is permanently stopped. - * - * @return ETrue if audio is permanently stopped. - */ - inline TBool IsAudioPermanentlyStopped() const; - -private: // from TVtUpdateableFlagContainer - - /** - * @see TVtUpdateableFlagContainer::UpdateFlags - */ - void UpdateFlags(); - -private: - - // Enumeration for audio state flags. - enum TFlags - { - /** Is set if audio is currently enabled. */ - EIsAudio = ( 1<<0 ), - /** Is set if BT handsfree can be activated. */ - ECanActivateBtHf = ( 1<<1 ), - /** Is set if BT handsfree can be deactivated. */ - ECanDeactivateBtHf = ( 1<<2 ), - /** Is set if loudspeaker can be activated. */ - ECanActivateLoudspeaker = ( 1<<3 ), - /** Is set if loudspeaker can be deactivated. */ - ECanDeactivateLoudspeaker = ( 1<<4 ), - /** Set if audio is permanently stopped */ - EIsAudioPermanentlyStopped = ( 1<<5 ) - }; - - // Reference to engine model instance - CVtEngModel& iModel; - - }; - -#include "tlcvtaudiostate.inl" - -#endif // T_LCVTAUDIOSTATE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/common/tlcvtaudiostate.inl --- a/vtuis/lcvtplugin/inc/common/tlcvtaudiostate.inl Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2008 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: Audio state class inline methods. -* -*/ - - -// ----------------------------------------------------------------------------- -// TLcVtAudioState::TLcVtAudioState -// ----------------------------------------------------------------------------- -// -TLcVtAudioState::TLcVtAudioState( CVtEngModel& aModel ) -: iModel( aModel ) - { - } - -// ----------------------------------------------------------------------------- -// TLcVtAudioState::IsAudio -// ----------------------------------------------------------------------------- -// -TBool TLcVtAudioState::IsAudio() const - { - return IsFlag( EIsAudio ); - } - -// ----------------------------------------------------------------------------- -// TLcVtAudioState::CanActivateBtHf -// ----------------------------------------------------------------------------- -// -TBool TLcVtAudioState::CanActivateBtHf() const - { - return IsFlag( ECanActivateBtHf ); - } - -// ----------------------------------------------------------------------------- -// TLcVtAudioState::CanDeactivateBtHf -// ----------------------------------------------------------------------------- -// -TBool TLcVtAudioState::CanDeactivateBtHf() const - { - return IsFlag( ECanDeactivateBtHf ); - } - -// ----------------------------------------------------------------------------- -// TLcVtAudioState::CanActivateLoudspeaker -// ----------------------------------------------------------------------------- -// -TBool TLcVtAudioState::CanActivateLoudspeaker() const - { - return IsFlag( ECanActivateLoudspeaker ); - } - -// ----------------------------------------------------------------------------- -// TLcVtAudioState::CanDeactivateLoudspeaker -// ----------------------------------------------------------------------------- -// -TBool TLcVtAudioState::CanDeactivateLoudspeaker() const - { - return IsFlag( ECanDeactivateLoudspeaker ); - } - -// ----------------------------------------------------------------------------- -// TLcVtAudioState::IsAudioPermanentlyStopped -// ----------------------------------------------------------------------------- -// -TBool TLcVtAudioState::IsAudioPermanentlyStopped() const - { - return IsFlag( EIsAudioPermanentlyStopped ); - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/common/tlcvtflagcontainer.h --- a/vtuis/lcvtplugin/inc/common/tlcvtflagcontainer.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2008 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: Flag container class definition. -* -*/ - - -#ifndef T_LCVTFLAGCONTAINER_H -#define T_LCVTFLAGCONTAINER_H - -#include - -/** - * TLcVtFlagContainer - * - * Flag container is a class that holds maximum of 32 different flags. Also - * contains methods for setting, clearing and getting the flag state. - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TLcVtFlagContainer ) - { -public: - - /** - * Constructor. - */ - inline TLcVtFlagContainer(); - -protected: - - /** - * Clears all flags. - */ - inline void Clear(); - - /** - * Tests flag. - */ - inline TBool IsFlag( TUint32 aFlags ) const; - - /** - * Sets flag(s). - */ - inline void SetFlag( TUint32 aFlags ); - - /** - * Clears flag(s). - */ - inline void ClearFlag( TUint32 aFlags ); - - /** - * Gets flag value. - */ - inline TUint32 Value() const; - - /** - * Sets flag value. - */ - inline void SetValue( TUint32 aValue ); - -private: - - // Current flags - TUint32 iFlags; - - }; - -/** - * TLcVtUpdateableFlagContainer - * - * A flag container with Update() method that can be called to get - * flags updated in one pass. - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TLcVtUpdateableFlagContainer ) : public TLcVtFlagContainer - { -public: - - /** - * Issues flag updation. - */ - inline void Update(); - -private: - - /** - * Called when flags needs to be updated (as a result to call Update()). - */ - virtual void UpdateFlags() = 0; - - }; - -#include "tlcvtflagcontainer.inl" - -#endif // T_LCVTFLAGCONTAINER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/common/tlcvtflagcontainer.inl --- a/vtuis/lcvtplugin/inc/common/tlcvtflagcontainer.inl Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2008 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: Flag container class inline methods. -* -*/ - - -// ----------------------------------------------------------------------------- -// TLcVtFlagContainer::TLcVtFlagContainer -// ----------------------------------------------------------------------------- -// -TLcVtFlagContainer::TLcVtFlagContainer() - { - Clear(); - } - -// ----------------------------------------------------------------------------- -// TLcVtFlagContainer::Clear -// ----------------------------------------------------------------------------- -// -void TLcVtFlagContainer::Clear() - { - iFlags = 0; - } - -// ----------------------------------------------------------------------------- -// TLcVtFlagContainer::IsFlag -// ----------------------------------------------------------------------------- -// -TBool TLcVtFlagContainer::IsFlag( TUint32 aFlags ) const - { - return ( iFlags & aFlags ); - } - -// ----------------------------------------------------------------------------- -// TLcVtFlagContainer::SetFlag -// ----------------------------------------------------------------------------- -// -void TLcVtFlagContainer::SetFlag( TUint32 aFlags ) - { - iFlags |= aFlags; - } - -// ----------------------------------------------------------------------------- -// TLcVtFlagContainer::ClearFlag -// ----------------------------------------------------------------------------- -// -void TLcVtFlagContainer::ClearFlag( TUint32 aFlags ) - { - iFlags &= ~aFlags; - } - -// ----------------------------------------------------------------------------- -// TLcVtFlagContainer::Value -// ----------------------------------------------------------------------------- -// -TUint32 TLcVtFlagContainer::Value() const - { - return iFlags; - } - -// ----------------------------------------------------------------------------- -// TLcVtFlagContainer::SetValue -// ----------------------------------------------------------------------------- -// -void TLcVtFlagContainer::SetValue( TUint32 aValue ) - { - iFlags = aValue; - } - -// ----------------------------------------------------------------------------- -// TLcVtUpdateableFlagContainer::Update -// ----------------------------------------------------------------------------- -// -void TLcVtUpdateableFlagContainer::Update() - { - Clear(); - UpdateFlags(); - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/common/tlcvtmediastate.h --- a/vtuis/lcvtplugin/inc/common/tlcvtmediastate.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,216 +0,0 @@ -/* -* Copyright (c) 2008 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: Media state class definition. -* -*/ - - -#ifndef T_LCVTMEDIASTATE_H -#define T_LCVTMEDIASTATE_H - -#include - -#include "tlcvtflagcontainer.h" - -class MVtEngMedia; -class MVtEngCommandHandler; - -/** - * TLcVtMediaState - * - * Contains information about media's (video) current status. - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TLcVtMediaState ) : public TLcVtUpdateableFlagContainer - { -public: - - /** - * Constructor. - * - * @param aMedia Reference to VT engine media object. - * @param aCommandHandler Reference to command handler object. - */ - inline TLcVtMediaState( MVtEngMedia& aMedia, - MVtEngCommandHandler& aCommandHandler ); - - /** - * Return whether or not video is being sent. - * - * @return ETrue if video is being sent. - */ - inline TBool IsVideo() const; - - /** - * Return whether or not any camera is available in device. - * - * @return ETrue if any camera is available in device. - */ - inline TBool HasCamera() const; - - /** - * Return whether or not freeze is supported for active video source. - * - * @return ETrue if freeze is supported for active video source. - */ - inline TBool IsFreezeSupported() const; - - /** - * Return whether or not active video source is frozen. - * - * @return ETrue if video is frozen. - */ - inline TBool IsFrozen() const; - - /** - * Return whether or not share is active. - * - * @return ETrue if still image is being shared. - */ - inline TBool IsSharing() const; - - /** - * Return whether or not sharing is being initialized. - * - * @return ETrue if still image sharing is being initialized. - */ - inline TBool IsInitializingShare() const; - - /** - * Return whether or not primary camera is being used by VT. - * - * @return ETrue if primary camera is being used. - */ - inline TBool IsPrimaryCameraInUse() const; - - /** - * Return whether or not secondary camera is being used by VT. - * - * @return ETrue if secondary camera is being used. - */ - inline TBool IsSecondaryCameraInUse() const; - - /** - * Return whether or not it is possible to share. - * - * @return ETrue if sharing is not allowed. - */ - inline TBool IsNotAbleToShare() const; - - /** - * Return whether or not device has primary camera. - * - * @return ETrue if primary camera is available. - */ - inline TBool HasPrimaryCamera() const; - - /** - * Return whether or not device has secondary camera. - * - * @return ETrue if secondary camera is available. - */ - inline TBool HasSecondaryCamera() const; - - /** - * Return whether or not active video source supports contrast setting. - * - * @return ETrue if contrast settingis allowed. - */ - inline TBool IsContrastSupported() const; - - /** - * Return whether or not active video source supports white balance setting. - * - * @return ETrue if white balance setting is allowed. - */ - inline TBool IsWhiteBalanceSupported() const; - - /** - * Return whether or not active video source supports color tone setting. - * - * @return ETrue if colour tone setting is allowed. - */ - inline TBool IsColorToneSupported() const; - - /** - * Return whether or not active video source supports brightness setting. - * - * @return ETrue if brightness setting is allowed. - */ - inline TBool IsBrightnessSupported() const; - - /** - * Return whether or not video is permanently stopped. - * - * @return ETrue if video is permanently stopped. - */ - inline TBool IsVideoPermanentlyStopped() const; - -private: // from TVtUpdateableFlagContainer - - /** - * @see TVtUpdateableFlagContainer::UpdateFlags - */ - void UpdateFlags(); - -private: - - // Enumeration for media state flags. - enum TFlags - { - /** Set if video is currently enabled. */ - EIsVideo = ( 1<<0 ), - /** Set if device has any cameras */ - EHasCamera = ( 1<<1 ), - /** Set if current active video source supports freezing */ - EIsFreezeSupported = ( 1<<2 ), - /** Set if current active video source is frozen */ - EIsFrozen = ( 1<<3 ), - /** Set if sharing is active */ - EIsSharing = ( 1<<4 ), - /** Set if sharing is being initialized */ - EIsInitializingShare = ( 1<<5 ), - /** Set if device's primary camera is being used by VT application */ - EIsPrimaryCameraInUse = ( 1<<6 ), - /** Set if device's secondary camera is being used by VT application */ - EIsSecondaryCameraInUse = ( 1<<7 ), - /** Set if it is not possible to share */ - EIsNotAbleToShare = ( 1<<8 ), - /** Set if device has primary camera */ - EHasPrimaryCamera = ( 1<<9 ), - /** Set if device has secondary camera */ - EHasSecondaryCamera = ( 1<<10 ), - /** Set if current video source supports contrast setting */ - EIsContrastSupported = ( 1<<11 ), - /** Set if current video source supports white balance setting */ - EIsWhiteBalanceSupported = ( 1<<12 ), - /** Set if current video source supports color tone setting */ - EIsColorToneSupported = ( 1<<13 ), - /** Set if current video source supports brightness setting */ - EIsBrightnessSupported = ( 1<<14 ), - /** Set if video is permanently stopped*/ - EIsVideoPermanentlyStopped = ( 1<<15 ) - }; - - // Reference to engine media instance. - MVtEngMedia& iMedia; - - // Reference to engine command handler instance. - MVtEngCommandHandler& iCommandHandler; - }; - -#include "tlcvtmediastate.inl" - -#endif // T_LCVTMEDIASTATE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/common/tlcvtmediastate.inl --- a/vtuis/lcvtplugin/inc/common/tlcvtmediastate.inl Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +0,0 @@ -/* -* Copyright (c) 2008 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: Media state class inline methods. -* -*/ - - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::TLcVtMediaState -// ----------------------------------------------------------------------------- -// -TLcVtMediaState::TLcVtMediaState( MVtEngMedia& aMedia, - MVtEngCommandHandler& aCommandHandler ) - : iMedia( aMedia ), iCommandHandler( aCommandHandler ) - { - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsVideo -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsVideo() const - { - return IsFlag( EIsVideo ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::HasCamera -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::HasCamera() const - { - return IsFlag( EHasCamera ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsFreezeSupported -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsFreezeSupported() const - { - return IsFlag( EIsFreezeSupported ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsFrozen -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsFrozen() const - { - return IsFlag( EIsFrozen ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsSharing -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsSharing() const - { - return IsFlag( EIsSharing ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsInitializingShare -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsInitializingShare() const - { - return IsFlag( EIsInitializingShare ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsPrimaryCameraInUse -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsPrimaryCameraInUse() const - { - return IsFlag( EIsPrimaryCameraInUse ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsSecondaryCameraInUse -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsSecondaryCameraInUse() const - { - return IsFlag( EIsSecondaryCameraInUse ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsNotAbleToShare -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsNotAbleToShare() const - { - return IsFlag( EIsNotAbleToShare ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::HasPrimaryCamera -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::HasPrimaryCamera() const - { - return IsFlag( EHasPrimaryCamera ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::HasSecondaryCamera -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::HasSecondaryCamera() const - { - return IsFlag( EHasSecondaryCamera ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsContrastSupported -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsContrastSupported() const - { - return IsFlag( EIsContrastSupported ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsWhiteBalanceSupported -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsWhiteBalanceSupported() const - { - return IsFlag( EIsWhiteBalanceSupported ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsColorToneSupported -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsColorToneSupported() const - { - return IsFlag( EIsColorToneSupported ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsBrightnessSupported -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsBrightnessSupported() const - { - return IsFlag( EIsBrightnessSupported ); - } - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::IsVideoPermanentlyStopped -// ----------------------------------------------------------------------------- -// -TBool TLcVtMediaState::IsVideoPermanentlyStopped() const - { - return IsFlag( EIsVideoPermanentlyStopped ); - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/common/tlcvtstates.h --- a/vtuis/lcvtplugin/inc/common/tlcvtstates.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,333 +0,0 @@ -/* -* Copyright (c) 2008 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: LC VT states class definition. -* -*/ - - -#ifndef T_LCVTSTATES_H -#define T_LCVTSTATES_H - -#include - -#include "tlcvtmediastate.h" -#include "tlcvtaudiostate.h" - -class CVtEngModel; -class MVtEngCameraPreferences; - -/** - * TLcVtStates - * - * Contains information about Application UI's current status. - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TLcVtStates ) : public TLcVtFlagContainer - { - -public: // enumerations - - /** - * Lc VT plugin execution state (will be set by the plugin state classes) - */ - enum TLcVtExecState - { - EExecStateStarting, - EExecStateRunning, - EExecStateResetting, - EExecStateFinalized - }; - -public: - - /** - * Constructor. - */ - TLcVtStates( CVtEngModel& aModel ); - - /** - * Updates UI states. - */ - void Update(); - - /** - * Return whether or not ColorToneSetting - * is supported by current camera. - * - * @return ETrue if at least one color tone setting is available, - * EFalse otherwise. - */ - TBool IsColorToneSettingAvailable() const; - - /** - * Return whether or not WhiteBalanceSetting - * is supported by current camera. - * - * @return ETrue if at least one white balance setting is available, - * EFalse otherwise. - */ - TBool IsWhiteBalanceSettingAvailable() const; - - /** - * Return whether or not ontrast setting - * is supported by current camera. - * - * @return ETrue if at contrast setting is available, - * EFalse otherwise. - */ - TBool IsContrastSettingAvailable() const; - - /** - * Return whether or not brightness setting - * is supported by current camera. - * - * @return ETrue if brightness setting is available, - * EFalse otherwise. - */ - TBool IsBrightnessSettingAvailable() const; - - /** - * Returns reference to media state object - * - * @return Reference to media state object. - */ - inline const TLcVtMediaState& MediaState() const; - - /** - * Returns reference to audio state object - * - * @return Reference to audio state object. - */ - inline const TLcVtAudioState& AudioState() const; - - /** - * Sets or clears EIsCLIReceived - * - * @param aSet ETrue if setting will be set, EFalse otherwise. - */ - inline void SetCLIReceived( TBool aSet ); - - /** - * Check if EIsCLIReceived is set - * - * @return ETrue if EIsCLIReceived is set EFalse otherwise - */ - inline TBool IsCLIReceived() const; - - /** - * Sets or clears EIsLayoutChangeNeeded - * - * @param aSet ETrue if setting will be set, EFalse otherwise. - */ - inline void SetLayoutChangeNeeded( TBool aSet ); - - /** - * Check if EIsLayoutChangeNeeded is set - * - * @return ETrue if EIsLayoutChangeNeeded is set EFalse otherwise - */ - inline TBool IsLayoutChangeNeeded() const; - - /** - * Sets or clears EIsDeviceLockOn - * - * @param aSet ETrue if setting will be set, EFalse otherwise. - */ - inline void SetDeviceLockOn( TBool aSet ); - - /** - * Check if EIsDeviceLockOn is set - * - * @return ETrue if EIsDeviceLockOn is set EFalse otherwise - */ - inline TBool IsDeviceLockOn() const; - - /** - * Sets or clears EDetailsReceived - * - * @param aSet ETrue if setting will be set, EFalse otherwise. - */ - inline void SetDetailsReceived( TBool aSet ); - - /** - * Check if EDetailsReceived is set - * - * @return ETrue if EDetailsReceived is set EFalse otherwise - */ - inline TBool IsDetailsReceived() const; - - /** - * Sets or clears EWaitingForFirstFrame - * - * @param aSet ETrue if setting will be set, EFalse otherwise. - */ - inline void SetWaitingForFirstFrame( TBool aSet ); - - /** - * Check if EWaitingForFirstFrame is set - * - * @return ETrue if EWaitingForFirstFrame is set EFalse otherwise - */ - inline TBool IsWaitingForFirstFrame() const; - - /** - * Sets or clears EUseSQCif - * - * @param aSet ETrue if setting will be set, EFalse otherwise. - */ - inline void SetUseSQCif( TBool aSet ); - - /** - * Check if EUseSQCif is set - * - * @return ETrue if EUseSQCif is set EFalse otherwise - */ - inline TBool IsUseSQCif() const; - - /** - * Sets or clears EIsThisApplicationForeground - * - * @param aSet ETrue if setting will be set, EFalse otherwise. - */ - inline void SetThisApplicationForeground( TBool aSet ); - - /** - * Check if EIsThisApplicationForeground is set - * - * @return ETrue if EIsThisApplicationForeground is set EFalse otherwise - */ - inline TBool IsThisApplicationForeground() const; - - /** - * Sets or clears EIsDisableBlindSetting - * - * @param aSet ETrue if setting will be set, EFalse otherwise. - */ - inline void SetDisableBlindSetting( TBool aSet ); - - /** - * Check if EIsDisableBlindSetting is set - * - * @return ETrue if EIsDisableBlindSetting is set EFalse otherwise - */ - inline TBool IsDisableBlindSetting() const; - - /** - * Sets or clears EExecShowCameraInUse - * - * @param aSet ETrue if setting will be set, EFalse otherwise. - */ - inline void SetExecShowCameraInUse( TBool aSet ); - - /** - * Check if EExecShowCameraInUse is set - * - * @return ETrue if EExecShowCameraInUse is set EFalse otherwise - */ - inline TBool IsExecShowCameraInUse() const; - - /** - * Sets or clears EIsWaitingCall - * - * @param aSet ETrue if setting will be set, EFalse otherwise. - */ - inline void SetWaitingCall( TBool aSet ); - - /** - * Check if there is waiting video/voice call. - * - * @return ETrue if waiting call is ongoing, EFalse otherwise - */ - inline TBool IsWaitingCall() const; - - /** - * Returns application's execution state. - * @return Application's current execution state. - */ - inline TLcVtExecState ExecState() const; - - /** - * Sets application's execution state. - * @param aState Application's new execution state. - */ - inline void SetExecState( const TLcVtExecState aState ); - -private: // methods to be accessed only by certain classes (see friends) - - - -private: - - // Enumeration for ui state flags. - enum TFlags - { - /** Set if CLI is received */ - EIsCLIReceived = ( 1<<0 ), - - /** Set if layout change is needed */ - EIsLayoutChangeNeeded = ( 1<<1 ), - - /** Set if device lock is on */ - EIsDeviceLockOn = ( 1<<2 ), - - /** Set if details have been received */ - EDetailsReceived = ( 1<<3 ), - - /** Set if waiting for first frame */ - EWaitingForFirstFrame = ( 1<<4 ), - - /** Set if SQCIF is being used */ - EUseSQCif = ( 1 << 5 ), - - /** Set if application on foreground */ - EIsThisApplicationForeground = ( 1<<6 ), - - /** Set if blind setting should be temporarily disabled. - This is used in preventing blind bitmap from flashing - while operations involving multiple engine commands/events - take place (e.g. 'Swap image places' and layout switch). */ - EIsDisableBlindSetting = ( 1<<7 ), - - /** Set if camera in use note should be shown. */ - EExecShowCameraInUse = ( 1<<8 ), - - /** Set if waiting call exists */ - EIsWaitingCall = ( 1<<9 ), - }; - - // Engine media state - TLcVtMediaState iMediaState; - - // Engine audio state - TLcVtAudioState iAudioState; - - // Refrence to engine - CVtEngModel& iModel; - - // Refrence to camera prefrences - MVtEngCameraPreferences* iCameraPref; - - // Application execution state - TLcVtExecState iExecState; - -private: // friends - - //friend class TLcVtStateBase; - - }; - -#include "tlcvtstates.inl" - -#endif // T_LCVTSTATES_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/common/tlcvtstates.inl --- a/vtuis/lcvtplugin/inc/common/tlcvtstates.inl Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,242 +0,0 @@ -/* -* Copyright (c) 2008 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: LC VT states class inline methods. -* -*/ - - -// ----------------------------------------------------------------------------- -// TLcVtStates::MediaState -// ----------------------------------------------------------------------------- -// -const TLcVtMediaState& TLcVtStates::MediaState() const - { - return iMediaState; - } - -// ----------------------------------------------------------------------------- -// TVtUiStates::AudioState -// ----------------------------------------------------------------------------- -// -const TLcVtAudioState& TLcVtStates::AudioState() const - { - return iAudioState; - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::SetCLIReceived -// ----------------------------------------------------------------------------- -// -void TLcVtStates::SetCLIReceived( TBool aSet ) - { - aSet ? SetFlag( EIsCLIReceived ) : ClearFlag( EIsCLIReceived ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsCLIReceived -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsCLIReceived() const - { - return IsFlag( EIsCLIReceived ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::SetLayoutChangeNeeded -// ----------------------------------------------------------------------------- -// -void TLcVtStates::SetLayoutChangeNeeded( TBool aSet ) - { - aSet ? SetFlag( EIsLayoutChangeNeeded ) : - ClearFlag( EIsLayoutChangeNeeded ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsLayoutChangeNeeded -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsLayoutChangeNeeded() const - { - return IsFlag( EIsLayoutChangeNeeded ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::SetDeviceLockOn -// ----------------------------------------------------------------------------- -// -void TLcVtStates::SetDeviceLockOn( TBool aSet ) - { - aSet ? SetFlag( EIsDeviceLockOn ) : - ClearFlag( EIsDeviceLockOn ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsDeviceLockOn -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsDeviceLockOn() const - { - return IsFlag( EIsDeviceLockOn ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::SetDetailsReceived -// ----------------------------------------------------------------------------- -// -void TLcVtStates::SetDetailsReceived( TBool aSet ) - { - aSet ? SetFlag( EDetailsReceived ) : - ClearFlag( EDetailsReceived ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsDetailsReceived -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsDetailsReceived() const - { - return IsFlag( EDetailsReceived ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::SetWaitingForFirstFrame -// ----------------------------------------------------------------------------- -// -void TLcVtStates::SetWaitingForFirstFrame( TBool aSet ) - { - aSet ? SetFlag( EWaitingForFirstFrame ) : - ClearFlag( EWaitingForFirstFrame ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsWaitingForFirstFrame -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsWaitingForFirstFrame() const - { - return IsFlag( EWaitingForFirstFrame ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::SetUseSQCif -// ----------------------------------------------------------------------------- -// -void TLcVtStates::SetUseSQCif( TBool aSet ) - { - aSet ? SetFlag( EUseSQCif ) : - ClearFlag( EUseSQCif ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsUseSQCif -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsUseSQCif() const - { - return IsFlag( EUseSQCif ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::SetThisApplicationForeground -// ----------------------------------------------------------------------------- -// -void TLcVtStates::SetThisApplicationForeground( TBool aSet ) - { - aSet ? SetFlag( EIsThisApplicationForeground ) : - ClearFlag( EIsThisApplicationForeground ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsThisApplicationForeground -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsThisApplicationForeground() const - { - return IsFlag( EIsThisApplicationForeground ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::SetDisableBlindSetting -// ----------------------------------------------------------------------------- -// -void TLcVtStates::SetDisableBlindSetting( TBool aSet ) - { - aSet ? SetFlag( EIsDisableBlindSetting ) : - ClearFlag( EIsDisableBlindSetting ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsDisableBlindSetting -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsDisableBlindSetting() const - { - return IsFlag( EIsDisableBlindSetting ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::SetExecShowCameraInUse -// ----------------------------------------------------------------------------- -// -void TLcVtStates::SetExecShowCameraInUse( TBool aSet ) - { - aSet ? SetFlag( EExecShowCameraInUse ) : - ClearFlag( EExecShowCameraInUse ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsExecShowCameraInUse -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsExecShowCameraInUse() const - { - return IsFlag( EExecShowCameraInUse ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates:::SetWaitingCall -// ----------------------------------------------------------------------------- -// -void TLcVtStates::SetWaitingCall( TBool aSet ) - { - aSet ? SetFlag( EIsWaitingCall ) : - ClearFlag( EIsWaitingCall ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsWaitingCall -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsWaitingCall() const - { - return IsFlag( EIsWaitingCall ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::SetExecState -// ----------------------------------------------------------------------------- -// -void TLcVtStates::SetExecState( const TLcVtExecState aState ) - { - iExecState = aState; - } -// ----------------------------------------------------------------------------- -// TLcVtStates::ExecState -// ----------------------------------------------------------------------------- -// -TLcVtStates::TLcVtExecState TLcVtStates::ExecState() const - { - return iExecState; - } - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/control/clcvtlocalvideoplayer.h --- a/vtuis/lcvtplugin/inc/control/clcvtlocalvideoplayer.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2008 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: LiveComm Videotelephony's Local Video Player -* -*/ -#ifndef LCVTLOCALVIDEOPLAYER_H -#define LCVTLOCALVIDEOPLAYER_H - -#include -#include "clcvtvideoplayerbase.h" - - -// FORWARD DECLARATIONS -class CLcVtSession; -class TVtCameraHandler; -class MLcWindow; -class MLcAudioControl; - -class CLcVtLocalVideoPlayer : public CLcVtVideoPlayerBase - { -public: // Constructors and destructor - - static CLcVtLocalVideoPlayer* NewL( - CLcVtSession* avtSession, - MLcAudioControl& aLcAudioControl, - TVtCameraHandler& aCameraHandler); - - ~CLcVtLocalVideoPlayer(); - -public: // from CLcVtVideoPlayerBase - - TLcVideoPlayerState LcVideoPlayerState() const; - - TBool LcIsPlayingL(); - - void LcPlayL( TLcVideoPlayerSource aSource=ECameraSource ); - - void LcPauseL(); - - MLcCameraControl* LcCameraControl(); - - MLcZoomControl* LcZoomControl(); - - MLcBrightnessControl* LcBrightnessControl(); - - void SetLcWindowRectL( TRect aRect ); - - void SetLcWindowOrientationL( - TLcWindowOrientation aOrientation ); - -public: - TBool IsOrientationChanged(); - -private: // Constructors - - CLcVtLocalVideoPlayer( - CLcVtSession* avtSession, - MLcAudioControl& aLcAudioControl, - TVtCameraHandler& aCameraHandler); - - void ConstructL(); - -private: // Data - - TVtCameraHandler& iCameraHandler; - TBool iOrientationChanged; - - }; - - -#endif //LCVTLOCALVIDEOPLAYER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/control/clcvtremotevideoplayer.h --- a/vtuis/lcvtplugin/inc/control/clcvtremotevideoplayer.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2008 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: LiveComm Videotelephony's Remte Video Player -* -*/ -#ifndef LCVTREMOTEVIDEOPLAYER_H -#define LCVTREMOTEVIDEOPLAYER_H - -#include -#include "clcvtvideoplayerbase.h" - -class CLcVtRemoteVideoPlayer : public CLcVtVideoPlayerBase - { -public: // Constructors and destructor - - static CLcVtRemoteVideoPlayer* NewL( - CLcVtSession* avtSession, - MLcAudioControl& aLcAudioControl ); - - - ~CLcVtRemoteVideoPlayer(); - - -public: // from CLcVtVideoPlayerBase - - TLcVideoPlayerState LcVideoPlayerState() const; - - TBool LcIsPlayingL(); - - void SetLcWindowRectL( TRect aRect ); - - -private: // Constructors - - CLcVtRemoteVideoPlayer( - CLcVtSession* avtSession, - MLcAudioControl& aLcAudioControl ); - - void ConstructL(); - -private: // Data - }; - -#endif //LCVTREMOTEVIDEOPLAYER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/control/clcvtvideoplayerbase.h --- a/vtuis/lcvtplugin/inc/control/clcvtvideoplayerbase.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2008 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: LiveComm Videotelephony's Video Player Base Class -* -*/ - -#ifndef LCVTPLAYERS_H -#define LCVTPLAYERS_H - -#include - -#include -#include -#include -#include -#include -#include "clcvtsession.h" - - -class CLcVtVideoPlayerBase : public CBase, public MLcVideoPlayer, public MLcWindow - { - -public: // Constructors and destructor - - ~CLcVtVideoPlayerBase(); - -public: // from MLcVideoPlayer - - //TLcVideoPlayerState LcVideoPlayerState() const; - - //TBool LcIsPlayingL(); - - void LcPlayL( TLcVideoPlayerSource aSource=ECameraSource ); - - void LcPauseL(); - - MLcWindow* LcWindow(); - - MLcCameraControl* LcCameraControl(); - - MLcSourceFileControl* LcSourceFileControl(); - - MLcDestinationFileControl* LcDestinationFileControl(); - - MLcAudioControl* LcAudioControl(); - - MLcZoomControl* LcZoomControl(); - - MLcBrightnessControl* LcBrightnessControl(); - - -public: // from MLcWindow - - void EnableLcWindowL( TBool aEnable ); - - TBool IsLcWindowEnabled(); - - void SetLcWindowRectL( TRect aRect ); - - TRect LcWindowRect(); - - void SetLcWindowOrientationL( - TLcWindowOrientation aOrientation ); - - TLcWindowOrientation LcWindowOrientationL(); - -protected: // Constructors - - CLcVtVideoPlayerBase( - CLcVtSession* avtSession, - MLcAudioControl& aLcAudioControl ); - -protected: // Data - - CLcVtSession* ivtSession; // Not owned - - MLcAudioControl& iLcAudioControl; - - TBool iIsWindowEnabled; - - TRect iWindowRect; - - MLcWindow::TLcWindowOrientation iWindowOrientation; - }; - - -#endif // LCVTPLAYERS_H - -// end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/control/tlcvtcamerahandler.h --- a/vtuis/lcvtplugin/inc/control/tlcvtcamerahandler.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2008 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: LiveComm Videotelephony's Camera Handler -* -*/ - -#ifndef LCVTCAMERAHANDLER_H -#define LCVTCAMERAHANDLER_H - -#include -#include -#include - -class CLcVtSession; - -class TVtCameraHandler : - public MLcCameraControl, - public MLcBrightnessControl, - public MLcZoomControl - { - public: // From MLcCameraControl - - TInt LcCameraCountL(); - - TInt CurrentLcCameraIndex(); - - void ToggleLcCameraL(); - - public: // From MLcBrightnessControl - - TInt MinLcBrightnessL(); - - TInt MaxLcBrightnessL(); - - TInt LcBrightnessL(); - - void SetLcBrightnessL( TInt aValue ); - - void IncreaseLcBrightnessL(); - - void DecreaseLcBrightnessL(); - - public: // From MLcZoomControl - - TInt MinLcZoomL(); - - TInt MaxLcZoomL(); - - TInt LcZoomValueL(); - - void SetLcZoomValueL( TInt aValue ); - - void LcZoomInL(); - - void LcZoomOutL(); - - public: - - TVtCameraHandler(); - - void SetSession( CLcVtSession* aSession ); - - private: - - enum TCurrentCamera - { - ECameraNotAvailable = KErrNotFound, - EBackCamera = 0, - EFrontCamera = 1 - }; - - private: // Data - - CLcVtSession* ivtSession; // Not owned - - }; - -#endif //LCVTCAMERAHANDLER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/states/tlcvtpluginstates.h --- a/vtuis/lcvtplugin/inc/states/tlcvtpluginstates.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,279 +0,0 @@ -/* -* Copyright (c) 2008 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: Concrete VT plugin state classes -* -*/ - - -#ifndef T_LCVTPLUGINSTATES_H -#define T_LCVTPLUGINSTATES_H - -#include "tlcvtstatebase.h" -#include -#include - - -/** -* Initial application state. Responsible for startup phase 1 and -* startup phase 2 (see EVtUiAppUiStartup in CVtUiAppUi.cpp). -* Certain other state changes are required for phase 2 and history -* of their reception is handled with precondition flags. -* -* @since S60 v3.2 -*/ -class TLcVtStateStarting : public TLcVtStateBase - { -public: - /** - * returns singleton instance of TLcVtStateStarting - * @param aCtx state context - * @param aUiStates UI states - * @return singleton - */ - static TLcVtStateStarting* InstanceL( - MLcVtStateContext& aCtx, - TLcVtStates& aUiStates ); - -public: // from TLcVtStateBase - - /** @see TLcVtStateBase */ - virtual void LcVtStartupPhase1DoneL(); - - /** @see TLcVtStateBase */ - virtual void LcVtStartupPhase2DoneL(); - - /** @see TLcVtStateBase */ - virtual TEventResponse HandleVtEventL( TInt aEvent ); - - /** @see TLcVtStateBase */ - virtual TEventResponse HandleCommandL( const TInt aCommand ); - - /** @see TLcVtStateBase */ - virtual TBool HandleForegroundChangedL( TBool aIsForeground ); - - /** @see TLcVtStateBase */ - virtual TBool PreHandleForegroundChangedL( TBool aIsForeground ); - -private: // from TLcVtStateBase - - /** @see TLcVtStateBase */ - virtual void OpenL(); - - /** @see TLcVtStateBase */ - virtual void Close(); - -private: // new methods - - void CheckSessionStateL(); - - static TInt AsynchOpen( TAny* aAny ); - - void DoOpenL(); - - /** Preconditions that must be passed in order to proceed - * to Phase 2 in startup. - */ - enum TPreconditions - { - /** waiting for CLI from engine*/ - EWaitingCLI, - /** waiting for phase1 to complete */ - EWaitingPhase1ToComplete, - /** waiting for engine to get proper state */ - EWaitingSessionState - }; - - /** - * Clears precondition passed as argument and checks if any - * preconditions hold and if not proceeds to phase 2 of startup. - */ - void CheckPhase2StartupL( const TPreconditions aClearCondition ); - - void HandleCLIReceivedL(); - -private: // constructors and destructors - - // c++ constructor - TLcVtStateStarting( - MLcVtStateContext& aCtx, - TLcVtStates& aUiStates ); - - // Destructor - virtual ~TLcVtStateStarting(); - -private: // data members - - // Precondition for state change to running - TBitFlags8 iPreconditions; - - // Singleton - static TLcVtStateStarting* iInstance; - - // Starts phase1 startup in state state context. Needed because - // initial state is opened from within state context construction. - CAsyncCallBack* iStartCallback; - }; - -/** -* Application state that is active in normal operation. -* -* @since S60 v3.2 -*/ -class TLcVtStateRunning : public TLcVtStateBase - { -public: - /** - * returns singleton instance of TLcVtStateRunning - * @param aCtx state context - * @param aUiStates UI states - * @return singleton - */ - static TLcVtStateRunning* InstanceL( - MLcVtStateContext& aCtx, - TLcVtStates& aUiStates ); - -public: // from TLcVtStateBase - - /** @see TLcVtStateBase */ - virtual TEventResponse HandleVtEventL( TInt aEvent ); - - /** @see TLcVtStateBase */ - virtual TEventResponse HandleCommandL( const TInt aCommand ); - - /** @see TLcVtStateBase */ - virtual TBool HandleForegroundChangedL( TBool aIsForeground ); - - /** @see TLcVtStateBase */ - virtual TBool PreHandleForegroundChangedL( TBool aIsForeground ); - /** @see TLcVtStateBase */ - //virtual void HandleLayoutChangedL(); - - /** @see TLcVtStateBase */ - //virtual void StartDtmfTone( const TChar& aTone ); - - /** @see TLcVtStateBase */ - //virtual void StopDtmfTone(); - - /** @see TLcVtStateBase */ - virtual void OpenL(); - -private: // from TLcVtStateBase - /** @see TLcVtStateBase */ - virtual void Close(); - -private: // constructors and destructors - - // c++ constructor - TLcVtStateRunning( - MLcVtStateContext& aCtx, - TLcVtStates& aUiStates ); - - // Destructor - virtual ~TLcVtStateRunning(); - -private: // new functions - - /** Requests call handling subsystem to initiate a voice call. - * Starts shutdown of the application. - */ - void CreateVoiceCallL(); - - /** Dials emergency call and starts shutdown */ - void DialEmergencyCallL(); - - void ShutdownWithEngineCommandL( const TInt aCommand ); - -private: // data members - // singleton - static TLcVtStateRunning* iInstance; - - }; - -/** -* Application state that is active during shutdown. -* -* @since S60 v3.2 -*/ -class TLcVtStateResetting : public TLcVtStateBase - { -public: - /** - * returns singleton instance of TLcVtStateResetting - * @param aCtx state context - * @param aUiStates UI states - * @param aCommand engine command to send when resetting state activates - * @return singleton - */ - static TLcVtStateResetting* InstanceL( - MLcVtStateContext& aCtx, - TLcVtStates& aUiStates, - const TVtEngCommandId aCommand = KVtEngCommandNone ); - -public: // from TLcVtStateBase - - /** @see TLcVtStateBase */ - virtual void LcVtStartupFailedL(); - - /** @see TLcVtStateBase */ - virtual void ShutdownDoneL(); - - /** @see TLcVtStateBase */ - virtual TEventResponse HandleVTCommandPerformedL( - TVtEngCommandId aCommand, - const TInt aError ); - - /** @see TLcVtStateBase */ - virtual TEventResponse HandleVtEventL( TInt aEvent ); - - /** @see TLcVtStateBase */ - virtual TEventResponse HandleCommandL( const TInt aCommand ); - - /** @see TLcVtStateBase */ - virtual TBool HandleForegroundChangedL( TBool aIsForeground ); - - /** @see TLcVtStateBase */ - virtual TBool PreHandleForegroundChangedL( TBool aIsForeground ); - - /** @see TLcVtStateBase */ - //virtual void HandleLayoutChangedL(); - -private: // from TLcVtStateBase - - /** @see TLcVtStateBase */ - virtual void OpenL(); - - /** @see TLcVtStateBase */ - virtual void Close(); - -private: // constructors and destructors - - // c++ constructor - TLcVtStateResetting( - MLcVtStateContext& aCtx, - TLcVtStates& aUiStates, - const TVtEngCommandId aCommand = KVtEngCommandNone ); - - // Destructor - virtual ~TLcVtStateResetting(); - -private: // data members - - // Singleton - static TLcVtStateResetting* iInstance; - - // Used in user originated shutdown (end active call/switch to voice) - TVtEngCommandId iCommand; - }; - -#endif // T_LCVTPLUGINSTATES_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/states/tlcvtstatebase.h --- a/vtuis/lcvtplugin/inc/states/tlcvtstatebase.h Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,248 +0,0 @@ -/* -* Copyright (c) 2008 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: Base class for application states. -* -*/ - - -#ifndef T_LCVTSTATEBASE_H -#define T_LCVTSTATEBASE_H - -#include -#include -#include "mlcvtstatecontext.h" -#include "mlcvtshutterobserver.h" -#include "tlcvtstates.h" - -/** -* Base class for application states related to application startup, normal -* operation and shutdown. AppUi delegates decision making by forwarding -* events/commands it receives to current state. -* Not all event handlers declared by the base class are applicable in -* all concrete states. All methods returning TEventResponse imply that it may -* consume the event completely and caller should not process it further. -* -* It should be kept in mind that as new functionality is added to application, -* state classes may need changes if e.g. handling of specific event should be -* allowed in appUi. By default event handler in specific state may consume all -* events. Note that in this context e.g. HandleCommandL is considered as an -* event handler. -* -* @since S60 v3.2 -*/ -class TLcVtStateBase : public MLcVtShutterObserver - { -public: // new functions - - /** - * Return value from state's event handlers. - */ - enum TEventResponse - { - /** Event was handled by a state and should - * not be further processed by caller. - */ - EEventHandled, - /** Event can be handled by caller. */ - EEventNotHandled - }; - - /** - * Performs state dependent actions when phase 1 of - * startup is completed. - */ - virtual void LcVtStartupPhase1DoneL(); - - /** - * Performs state dependent actions when startup fails. - */ - virtual void LcVtStartupFailedL(); - - /** - * Performs state dependent actions when phase 2 of - * startup is completed. - */ - virtual void LcVtStartupPhase2DoneL(); - - /** - * Handles completion of shutdown. - */ - virtual void ShutdownDoneL(); - - /** - * Handles completion of an VT engine command. - * @param aCommand completed command - * @param aError error - * @return event response, is caller allowed to handle event - */ - virtual TEventResponse HandleVTCommandPerformedL( - const TVtEngCommandId aCommand, - const TInt aError ); - - /** - * Handles event from the engine. - * @param aEvent - * @return event response, is caller allowed to handle event - */ - virtual TEventResponse HandleVtEventL( const TInt aEvent ); - - /** - * Handles command from the user (or application framework). - * @param aCommand - * @return event response, is caller allowed to handle event - */ - virtual TEventResponse HandleCommandL( const TInt aCommand ); - - /** - * Performs state dependent actions for foreground change event. - * @param aIsForeground foreground status passed from UI framework - * @return ETrue if application should behave as in foreground - */ - virtual TBool HandleForegroundChangedL( const TBool aIsForeground ) = 0; - - /** - * Performs state dependent previous actions for foreground change event. - * @param aIsForeground foreground status passed from UI framework - * @return ETrue if application should behave as in foreground - */ - virtual TBool PreHandleForegroundChangedL( const TBool aIsForeground ) = 0; - - /** - * Performs state dependent actions for layout change. - */ - //virtual void HandleLayoutChangedL(); - - /** - * Sends DTMF tone if allowed by current state. - * @param aTone DTMF tone to send - */ - //virtual void StartDtmfTone( const TChar& aTone ); - - /** - * Stops DTMF tone if allowed by current state. - */ - //virtual void StopDtmfTone(); - - /** - * Sets initial application state. - * @param aCtx state context providing services to states - * @param aUiStates ui states - */ - static void SetInitialStateL( - MLcVtStateContext& aCtx, - TLcVtStates& aUiStates); - -public: // from MLcVtShutterObserver - - /** - * Handles 'shutdown ready' event. - */ - virtual void HandleShutdownReady(); - - -protected: // for concrete state classes - - /** - * Destructor, for cleanup. - */ - virtual ~TLcVtStateBase(); - - /** - * Performs entry action for a state. - */ - virtual void OpenL() = 0; - - /** - * Performs exit action for a state and deletes that state. - */ - virtual void Close() = 0; - - /** - * Sets current state. - */ - void ChangeStateL( TLcVtStateBase& aNewState ); - - /** - * Sets transition to resetting state as cleanup item. - */ - void CleanupResetPushL(); - - /** - * Starts shutdown when leave occurred. - */ - static void TransitionToReset( TAny* aAny ); - - - /** - * Ends the call if necessary and starts shutdown. - * @return ETrue if shutdown started. - */ - TBool CheckEndActiveCallL(); - - /** - * Returns engine session state. - * @param aUpdate is state forced to update - * @return session state - */ - MVtEngSessionInfo::TSessionState SessionState( - const TBool aUpdate ) const; - - /** - * Delegates engine command execution to the state context. - */ - template < typename T > - inline void ExecuteEngineCommand( - TInt aCommand, T& aParam ); - - /** - * Sets execution state. - */ - void SetExecState( const TLcVtStates::TLcVtExecState aState ); - -protected: // constructor - - // c++ constructor - TLcVtStateBase( MLcVtStateContext& aCtx, TLcVtStates& aUiStates ); - - -private: // new functions - - /** - * Updates applications lock state and sends to background if - * the device is locked. - */ - void HandleDeviceLockEventL( const TBool aDeviceIsLocked ); - -protected: // data members - - // Context providing services to states - MLcVtStateContext& iCtx; - - // Various application specific state information - TLcVtStates& iUiStates; - - /** Prevents sending end call command to call handling if ETrue. - * It is not allowed when call clearing is network originated. - */ - - /** - * shutdown request received - */ - static TBool iShutdownRequested; - - }; - -#include "tlcvtstatebase.inl" - -#endif // T_LCVTSTATEBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/inc/states/tlcvtstatebase.inl --- a/vtuis/lcvtplugin/inc/states/tlcvtstatebase.inl Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2008 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: Base class for application states. -* -*/ - - -template < typename T > -inline void TLcVtStateBase::ExecuteEngineCommand( - TInt aCommand, T& aParam ) - { - TPtrC8 params( reinterpret_cast< TUint8* >( &aParam ), - sizeof( T ) ); - TRAP_IGNORE( iCtx.DoExecuteCmdL( aCommand, ¶ms ) ); - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/rom/lcvt.iby --- a/vtuis/lcvtplugin/rom/lcvt.iby Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2008 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: IBY file - * -*/ - - -#ifndef __LCVTPLUGIN_IBY__ -#define __LCVTPLUGIN_IBY__ - -REM Video telephony plugin libraries - -#ifdef __CS_VIDEO_TELEPHONY - -ECOM_PLUGIN(lcvtengineplugin.dll,lcvtengineplugin.rsc) - -// Enabler for eclipsing ROM binaries -data=ZSYSTEM\install\lcvtplugin_stub.sis system\install\lcvtplugin_stub.sis - -#endif - -#endif diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/base/clcvtactiveexec.cpp --- a/vtuis/lcvtplugin/src/base/clcvtactiveexec.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of the CLcVtActiveExec class. -* -*/ - - - -// INCLUDE FILES -#include "clcvtactiveexec.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CLcVtActiveExec::CLcVtActiveExec -// ----------------------------------------------------------------------------- -// -CLcVtActiveExec::CLcVtActiveExec( - const TInt aPriority ) - : CActive( aPriority ) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CLcVtActiveExec::~CLcVtActiveExec -// ----------------------------------------------------------------------------- -// -CLcVtActiveExec::~CLcVtActiveExec() - { - Cancel(); - } - -// ----------------------------------------------------------------------------- -// CLcVtActiveExec::Start -// ----------------------------------------------------------------------------- -// -void CLcVtActiveExec::Start( - TInt aStartState, - MLcVtActiveExec& aExec ) - { - Cancel(); - - iInitialState = aStartState; - iCurrentState = aStartState; - iNextState = aStartState; - - iActiveExec = &aExec; - - TRequestStatus* status = &iStatus; - User::RequestComplete( status, KErrNone ); - SetActive(); - } - -// ----------------------------------------------------------------------------- -// CLcVtActiveExec::InitialState -// ----------------------------------------------------------------------------- -// -TInt CLcVtActiveExec::InitialState() const - { - return iInitialState; - } - -// ----------------------------------------------------------------------------- -// CLcVtActiveExec::RequestStatus -// ----------------------------------------------------------------------------- -// -TInt CLcVtActiveExec::RequestStatus() const - { - return iStatus.Int(); - } - -// ----------------------------------------------------------------------------- -// CLcVtActiveExec::RunL -// ----------------------------------------------------------------------------- -// -void CLcVtActiveExec::RunL() - { - User::LeaveIfError( iStatus.Int() ); - TBool synch = ETrue; - - // Execute to the next asynchronous operation. - while ( synch ) - { - iCurrentState = iNextState; - if ( iCurrentState ) - { - synch = iActiveExec->ActiveExecExecuteL( - *this, - iCurrentState, - iNextState, - iStatus ); - - if ( !synch ) - { - SetActive(); - } - } - else - { - iActiveExec->ActiveExecDone( *this, iInitialState ); - if ( !IsActive() ) - { - iInitialState = 0; - } - - synch = EFalse; - } - } - } - -// ----------------------------------------------------------------------------- -// CLcVtActiveExec::DoCancel -// ----------------------------------------------------------------------------- -// -void CLcVtActiveExec::DoCancel() - { - if ( iActiveExec ) - { - iActiveExec->ActiveExecCancel( *this, iCurrentState ); - - iCurrentState = 0; - iActiveExec = NULL; - iInitialState = 0; - } - } - -// ----------------------------------------------------------------------------- -// CLcVtActiveExec::RunError -// ----------------------------------------------------------------------------- -// -TInt CLcVtActiveExec::RunError( TInt aError ) - { - if ( iActiveExec->ActiveExecContinue( *this, iCurrentState, aError ) ) - { - iNextState = iCurrentState; - - TRequestStatus* status = &iStatus; - User::RequestComplete( status, KErrNone ); - SetActive(); - } - else - { - if ( !IsActive() ) - { - iInitialState = 0; - } - } - - return KErrNone; - } - -// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/base/clcvtappshutter.cpp --- a/vtuis/lcvtplugin/src/base/clcvtappshutter.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,258 +0,0 @@ -/* -* Copyright (c) 2008 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: Class responsible for application exit. -* -*/ - - -#include "clcvtappshutter.h" -#include "mlcvtshutterobserver.h" -#include "mlcvtstatecontext.h" -//#include "mlcvtnumbersource.h" -//#include "tvtuilocalvariation.h" -#include -//#include -//#include -#include -#include - -// singleton instance -static CLcVtAppShutter* iAppShutter = NULL; - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::InstanceL -// ----------------------------------------------------------------------------- -// -CLcVtAppShutter* CLcVtAppShutter::InstanceL( - MLcVtShutterObserver& aObserver ) - { - __VTPRINTENTER( "CLcVtAppShutter.InstanceL" ) - if ( iAppShutter == NULL ) - { - iAppShutter = new ( ELeave ) - CLcVtAppShutter( aObserver ); - } - __VTPRINTEXIT( "CLcVtAppShutter.InstanceL" ) - return iAppShutter; - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::CLcVtAppShutter -// ----------------------------------------------------------------------------- -// -CLcVtAppShutter::CLcVtAppShutter( - MLcVtShutterObserver& aObserver ) : - iPendingStateFlags( 0 ), - iObserver( aObserver ) - { - iPendingStateFlags.Set( EShutterWaitingStart ); - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::~CLcVtAppShutter -// ----------------------------------------------------------------------------- -// -CLcVtAppShutter::~CLcVtAppShutter() - { - __VTPRINTENTER( "CLcVtAppShutter.~" ) - // mark singleton null - iAppShutter = NULL; - delete iCallback; - __VTPRINTEXIT( "CLcVtAppShutter.~" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::StartShutdown -// Called when application may exit, i.e TVtUiStateResetting state receives -// ShutdownDoneL message. -// ----------------------------------------------------------------------------- -// -void CLcVtAppShutter::StartShutdown() - { - __VTPRINTENTER( "CLcVtAppShutter.StartShutdown" ) - iPendingStateFlags.Clear( EShutterWaitingStart ); - ShutdownIfReadyAndDestroy(); - __VTPRINTEXIT( "CLcVtAppShutter.StartShutdown" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::ShutdownWithEmergencyCallL -// ----------------------------------------------------------------------------- -// -void CLcVtAppShutter::ShutdownWithEmergencyCallL( - MLcVtStateContext& aStateContext ) - { - // Leaves if other than emergency number is supplied... - CEmergencyCaller* emergency = CEmergencyCaller::DialEmergencyL( *this, - aStateContext ); - // therefore the flag and member variable must not be set before above call. - iPendingStateFlags.Set( EShutterWaitingEmergencyCallback ); - iEmergencyCaller = emergency; - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::EmergencyCallDoneL -// ----------------------------------------------------------------------------- -// -void CLcVtAppShutter::EmergencyCallDoneL() - { - // Destruction of emergency handler is done asynchrounously to avoid - // problems that might - iPendingStateFlags.Clear( EShutterWaitingEmergencyCallback ); - TCallBack cb( EmergencyResponseCallback, this ); - EnqueCallbackL( cb ); - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::EmergencyResponseCallback -// ----------------------------------------------------------------------------- -// -TInt CLcVtAppShutter::EmergencyResponseCallback( TAny* aAny ) - { - CLcVtAppShutter* shutter = - reinterpret_cast( aAny ); - // delete callback - delete shutter->iCallback; - shutter->iCallback = NULL; - // delete emergency caller - delete shutter->iEmergencyCaller; - shutter->iEmergencyCaller = NULL; - - shutter->ShutdownIfReadyAndDestroy(); - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::EnqueCallbackL -// ----------------------------------------------------------------------------- -// -void CLcVtAppShutter::EnqueCallbackL( TCallBack& aCallback ) - { - __VTPRINTENTER( "CLcVtAppShutter.EnqueAsyncCommsCommandL" ) - if ( !iCallback ) - { - iCallback = new ( ELeave ) CAsyncCallBack( aCallback, EPriorityHigh ); - } - iCallback->Call(); - __VTPRINTEXIT( "CLcVtAppShutter.EnqueAsyncCommsCommandL" ) - __VTPRINTEXIT( "CLcVtAppShutter.EnqueCallbackL" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::ShutdownIfReadyAndDestroy -// ----------------------------------------------------------------------------- -// -void CLcVtAppShutter::ShutdownIfReadyAndDestroy() - { - __VTPRINTENTER( "CLcVtAppShutter.ShutdownIfReadyAndDestroy" ) - __VTPRINT2( DEBUG_GEN, " shutter flags %d", - iPendingStateFlags.Value() ); - if ( !iPendingStateFlags.Value() ) - { - iObserver.HandleShutdownReady(); - delete this; - } - __VTPRINTEXIT( "CLcVtAppShutter.ShutdownIfReadyAndDestroy" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::CEmergencyCaller::DialEmergencyL -// ----------------------------------------------------------------------------- -// -CLcVtAppShutter::CEmergencyCaller* CLcVtAppShutter::CEmergencyCaller:: - DialEmergencyL( - CLcVtAppShutter& aObserver, - MLcVtStateContext& aStateContext ) - { - __VTPRINTENTER( "CEmergencyCaller.DialEmergencyL" ) - CLcVtAppShutter::CEmergencyCaller* self = new ( ELeave ) - CLcVtAppShutter::CEmergencyCaller( aObserver, aStateContext ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - __VTPRINTEXIT( "CEmergencyCaller.DialEmergencyL" ) - return self; - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::CEmergencyCaller::ConstructL -// ----------------------------------------------------------------------------- -// -void CLcVtAppShutter::CEmergencyCaller::ConstructL() - { - __VTPRINTENTER( "CEmergencyCaller.ConstructL" ) - /* - const MVtUiNumberSource* source = iStateContext.NumberSource(); - if ( source ) - { - source->GetContents( iNumber ); - AknTextUtils::ConvertDigitsTo( iNumber, EDigitTypeWestern ); - User::LeaveIfError( iServer.Connect() ); - iEmergency = CPhCltEmergencyCall::NewL( this ); - TBool isEmergenyNumber = EFalse; - const TInt err = - iEmergency->FindEmergencyPhoneNumber( iNumber, isEmergenyNumber ); - - if ( err == KErrNone && isEmergenyNumber ) - { - __VTPRINT( DEBUG_GEN, "iEmergency->DialEmergencyCallL") - iEmergency->DialEmergencyCallL( iNumber ); - } - if ( !isEmergenyNumber || err ) - { - __VTPRINT( DEBUG_GEN, " not EC number => leave" ) - // Not an emergency call number. Abort emergency call process. - User::Leave( KErrArgument ); - } - } - */ - __VTPRINTEXIT( "CEmergencyCaller.ConstructL" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::CEmergencyCaller::CEmergencyCaller -// ----------------------------------------------------------------------------- -// -CLcVtAppShutter::CEmergencyCaller::CEmergencyCaller( - CLcVtAppShutter& aObserver, - MLcVtStateContext& aStateContext ) : - iObserver( aObserver ), - iStateContext( aStateContext ) - { - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::CEmergencyCaller::~CEmergencyCaller -// ----------------------------------------------------------------------------- -// -CLcVtAppShutter::CEmergencyCaller::~CEmergencyCaller() - { - __VTPRINTENTER( "CEmergencyCaller.~" ) - delete iEmergency; - iServer.Close(); - __VTPRINTEXIT( "CEmergencyCaller.~" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtAppShutter::CEmergencyCaller::HandleEmergencyDialL -// ----------------------------------------------------------------------------- -// -void CLcVtAppShutter::CEmergencyCaller::HandleEmergencyDialL( - const TInt ) - { - __VTPRINTENTER( "CEmergencyCaller.HandleEmergencyDialL" ) - iObserver.EmergencyCallDoneL(); - __VTPRINTEXIT( "CEmergencyCaller.HandleEmergencyDialL" ) - } - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/base/clcvtcmdexecutor.cpp --- a/vtuis/lcvtplugin/src/base/clcvtcmdexecutor.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,360 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of the CLcVtCmdExecutor class. -* -*/ - - -// INCLUDE FILES -#include "clcvtcmdexecutor.h" -#include "mlcvtenginecommandmanager.h" -#include -#include - -// MODULE DATA STRUCTURES - -/** -* Active object to perform asynchronous commands. -* @since Series 60 2.6 -*/ -class CLcVtCmdExecutor::CActiveCmd - : public CActive - { - public: // Constructors and destructor - - /** - * Constructor. - */ - CActiveCmd( - CLcVtCmdExecutor& aDialog, - MVtEngCommandHandler& aCommandHandler, - TVtEngCommandId aCommand, - TDesC8* aParams ); - - /** - * Destructor. - */ - ~CActiveCmd(); - - public: // New functions - - /** - * Starts active object. Command will be performed in RunL. - */ - void Start(); - - /** - * Checks if command has been performed. - * @return ETrue if command has been performed. - */ - TBool CommandPerformed() const; - - private: - - /** - * @see CActive::RunL - */ - void RunL(); - - /** - * @see CActive::DoCancel. - */ - void DoCancel(); - - /** - * @see CActive::RunError. - */ - TInt RunError( TInt aResult ); - - private: - - // Ref to dialog. - CLcVtCmdExecutor& iExecutor; - - // Ref to command handler. - MVtEngCommandHandler& iCommandHandler; - - // Command to be executed. - TVtEngCommandId iCommand; - - // Owned parameters. - TDesC8* iCommandParams; - - // ETrue if command has been performed. - TBool iCommandPerformed; - - }; - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CLcVtCmdExecutor::CLcVtCmdExecutor -// ----------------------------------------------------------------------------- -// -CLcVtCmdExecutor::CLcVtCmdExecutor( - CLcVtCmdExecutor** aSelfPtr, - MVtEngCommandHandler& aCommandHandler, - MLcVtEngineCommandManager& aCommandManager ) - : iSelfPtr( aSelfPtr ), - iCommandHandler( aCommandHandler ), - iCommandManager( aCommandManager ) - { - iRequest = NULL; - __VTPRINT2( DEBUG_GEN, "CLcVtCmdExecutor.Ctor this=%d", (TInt)this ) - } - -// ----------------------------------------------------------------------------- -// CLcVtCmdExecutor::~CLcVtCmdExecutor -// ----------------------------------------------------------------------------- -// -CLcVtCmdExecutor::~CLcVtCmdExecutor() - { - __VTPRINTENTER( "CLcVtCmdExecutor.~" ) - __VTPRINT2( DEBUG_GEN, "CLcVtCmdExecutor.~ this=%d", (TInt)this ) - if ( iActiveCmd ) - { - if ( !iCommandCompleted && iActiveCmd->CommandPerformed() ) - { - iCommandHandler.CancelCommand( iCommand ); // ignore error - } - } - delete iCommandParams; - delete iActiveCmd; - - iCommandManager.RemoveObserver( *this ); - - if ( iSelfPtr ) - { - *iSelfPtr = NULL; - iSelfPtr = NULL; - } - - if ( iRequest ) - { - __VTPRINT(DEBUG_GEN, "CLcVtCmdExecutor::~CLcVtCmdExecutor RequestComplete") - User::RequestComplete( iRequest, KErrCancel ); - iRequest = NULL; - } - else - { - if ( iWait.IsStarted()) - { - __VTPRINT(DEBUG_GEN, "CLcVtCmdExecutor::~CLcVtCmdExecutor AsyncStop") - iWait.AsyncStop(); - } - } - - - __VTPRINTEXIT( "CLcVtCmdExecutor.~" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtCmdExecutor::ExecuteCmdL -// ----------------------------------------------------------------------------- -// -void CLcVtCmdExecutor::ExecuteCmdL( - const TVtEngCommandId aCommandId, - TDesC8* aParams, - TRequestStatus* aRequest ) - { - __VTPRINTENTER( "CLcVtCmdExecutor.ExecuteCmdL" ) - __VTPRINT2( DEBUG_GEN, "CLcVtCmdExecutor.ExecuteCmdL this=%d", (TInt)this ) - iCommand = aCommandId; - CleanupStack::PushL( this ); - if ( aParams ) - { - iCommandParams = aParams->AllocL(); - } - - iCommandManager.AddObserverL( *this ); - CleanupStack::Pop( this ); - - iActiveCmd = - new ( ELeave ) CActiveCmd( - *this, iCommandHandler, iCommand, iCommandParams ); - iActiveCmd->Start(); - - if ( !aRequest ) - { - TInt error = KErrNone; - iError = &error; - //Start Active Schedule - iWait.Start(); - User::LeaveIfError( error ); - } - else - { - *aRequest = KRequestPending; - iRequest = aRequest; - } - - __VTPRINTEXIT( "CLcVtCmdExecutor.ExecuteCmdL" ) - } - - -// ----------------------------------------------------------------------------- -// CLcVtCmdExecutor::Complete -// ----------------------------------------------------------------------------- -// -void CLcVtCmdExecutor::Complete( const TInt aError ) - { - if ( iError ) - { - *iError = aError; - } - - if ( iRequest ) - { - User::RequestComplete( iRequest, aError ); - iRequest = NULL; - } - - delete this; - } - -// ----------------------------------------------------------------------------- -// CLcVtCmdExecutor::HandleVTCommandPerformedL -// ----------------------------------------------------------------------------- -// -void CLcVtCmdExecutor::HandleVTCommandPerformedL( - TVtEngCommandId aCommand, - const TInt aError ) - { - __VTPRINTENTER( "CLcVtCmdExecutor.HandleVTCommandPerformed" ) - __VTPRINT2( DEBUG_GEN, "CLcVtCmdExecutor.HandleVTCommandPerformed.cmd.%d", aCommand ) - __VTPRINT2( DEBUG_GEN, "CLcVtCmdExecutor.HandleVTCommandPerformed.err.%d", aError ) - if ( iActiveCmd && ( aCommand == iCommand ) ) - { - if ( iActiveCmd->CommandPerformed() && !iCommandCompleted ) - { - __VTPRINT( DEBUG_GEN, "CLcVtCmdExecutor.match" ) - iCommandCompleted = ETrue; - // Corrupted images may leave during initialization, thus we have - // to mask out errors when they happen during share initialize. - // Error code is handled correctly in CVtUiAppUi::CEventObserver:: - // HandleVTCommandPerformedL() method, thus it will not be ignored. - if ( aCommand == KVtEngInitializeShareImage ) - { - Complete( KErrNone ); - } - else - { - Complete( aError ); - } - } - } - __VTPRINTEXIT( "CLcVtCmdExecutor.HandleVTCommandPerformed" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtCmdExecutor::HandleExecuteFailed -// ----------------------------------------------------------------------------- -// -void CLcVtCmdExecutor::HandleExecuteFailed( TInt aResult ) - { - __VTPRINT3( DEBUG_GEN, "CLcVtCmdExecutor.Fail this=%d res=%d", - (TInt)this, aResult ) - Complete( aResult ); - } - -// Implementation of CLcVtCmdExecutor::CActiveCmd: - -// ----------------------------------------------------------------------------- -// CLcVtCmdExecutor::CActiveCmd::CActiveCmd -// ----------------------------------------------------------------------------- -// -CLcVtCmdExecutor::CActiveCmd::CActiveCmd( - CLcVtCmdExecutor& aExecutor, - MVtEngCommandHandler& aCommandHandler, - TVtEngCommandId aCommand, - TDesC8* aParams) - : CActive( CActive::EPriorityHigh ), - iExecutor( aExecutor ), - iCommandHandler( aCommandHandler ), - iCommand( aCommand ), - iCommandParams( aParams ) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CLcVtCmdExecutor::CActiveCmd::~CActiveCmd -// ----------------------------------------------------------------------------- -// -CLcVtCmdExecutor::CActiveCmd::~CActiveCmd() - { - __VTPRINT2( DEBUG_GEN, "CLcVtCmdExecutor.CActiveCmd.Dtor this=%d", (TInt)this ) - Cancel(); - } - -// ----------------------------------------------------------------------------- -// CLcVtCmdExecutor::CActiveCmd::Start -// ----------------------------------------------------------------------------- -// -void CLcVtCmdExecutor::CActiveCmd::Start() - { - __VTPRINTENTER( "CLcVtCmdExecutor.CActiveCmd.Start" ) - TRequestStatus* status = &iStatus; - User::RequestComplete( status, KErrNone ); - SetActive(); - __VTPRINTEXITR( "CLcVtCmdExecutor.CActiveCmd.Start this=%d", (TInt)this ) - } - -// ----------------------------------------------------------------------------- -// CLcVtCmdExecutor::CActiveCmd::CommandPerformed -// ----------------------------------------------------------------------------- -// -TBool CLcVtCmdExecutor::CActiveCmd::CommandPerformed() const - { - __VTPRINT3( DEBUG_GEN, "CLcVtCmdExecutor.CActiveCmd.Perf this=%d,cmd=%d", - (TInt)this, iCommandPerformed ) - return iCommandPerformed; - } - -// ----------------------------------------------------------------------------- -// CLcVtCmdExecutor::CActiveCmd::RunL -// ----------------------------------------------------------------------------- -// -void CLcVtCmdExecutor::CActiveCmd::RunL() - { - __VTPRINTENTER( "CLcVtCmdExecutor.CActiveCmd.RunL" ) - iCommandHandler.ExecuteL( iCommand, iCommandParams ); - iCommandPerformed = ETrue; - __VTPRINTEXITR( "CLcVtCmdExecutor.CActiveCmd.RunL this=%d", (TInt)this ) - } - -// ----------------------------------------------------------------------------- -// CLcVtCmdExecutor::CActiveCmd::DoCancel -// ----------------------------------------------------------------------------- -// -void CLcVtCmdExecutor::CActiveCmd::DoCancel() - { - __VTPRINT2( DEBUG_GEN, "CLcVtCmdExecutor.CActiveCmd.DoCnl this=%d", (TInt)this ) - // Request is completed immediately. - } - -// ----------------------------------------------------------------------------- -// CVtUiExecuteCmdDialog::CActiveCmd::RunError -// ----------------------------------------------------------------------------- -// -TInt CLcVtCmdExecutor::CActiveCmd::RunError( TInt aResult ) - { - __VTPRINTENTER( "CLcVtCmdExecutor.CActiveCmd.RunError" ) - // Exception was raised in RunL. Inform the dialog to close itself. - iExecutor.HandleExecuteFailed( aResult ); - __VTPRINTEXITR( "CLcVtCmdExecutor.CActiveCmd.RunError this=%d", (TInt)this ) - return KErrNone; - } - -// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/base/clcvtengine.cpp --- a/vtuis/lcvtplugin/src/base/clcvtengine.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2008 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: LiveComm Videotelephony Plugin Class -* -*/ - -#include -#include -#include -#include "clcvtengine.h" -#include "clcvtsession.h" -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CLcVtEngine* CLcVtEngine::NewL( TAny* aParams ) - { - CLcVtEngine* self = new ( ELeave ) CLcVtEngine; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -CLcVtEngine::~CLcVtEngine() - { - delete iSession; - } - -MLcSession& CLcVtEngine::Session() - { - return *iSession; - } - -void CLcVtEngine::ConstructL() - { - iSession = CLcVtSession::NewL(); - } - -CLcVtEngine::CLcVtEngine() : CLcEngine() - { - - } - -TBool CLcVtEngine::IsFeatureSupported( TLcFeature aLcFeature ) - { - return iSession->IsFeatureSupported( aLcFeature ); - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/base/clcvtsession.cpp --- a/vtuis/lcvtplugin/src/base/clcvtsession.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2372 +0,0 @@ -/* -* Copyright (c) 2008 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: LiveComm Videotelephony Plugin session Class -* -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "clcvtsession.h" - -#include "cvtengmodel.h" - -#include "clcvtvideoplayerbase.h" -#include "clcvtlocalvideoplayer.h" -#include "clcvtremotevideoplayer.h" -#include "tlcvtstates.h" -#include "clcvtcmdexecutor.h" -#include "mlcvtenginecommandmanager.h" -#include "lcvtplugincommand.h" -#include "lcvtutility.h" - -// User selectable Call answer status values -const TInt KAllwaysQuery = 0; -const TInt KAllwaysAllow = 2; - -// Default call index. -const TInt KVtUiDefaultCallId = 1; - -// Granularity of command observer array. -const TInt KLcVtCommandObserverArrayGranularity = 5; - - - -// Enumerates states for CLcVtActiveExec. -enum - { - // Operation finished. Must equal to zero. - EVtSessionNone, - - // Active execution states for iActiveExec: - - // Startup (prepare engine): - EVtSessionStartup = 100, // 100 - // Initialise engine. - EVtSessionStartupInitEngine = EVtSessionStartup, // 100 - // Prepare viewfinder. - EVtSessionStartupPrepareViewfinder, // 101 - // Prepare remote render. - EVtSessionStartupPrepareRemoteRender, // 102 - // Startup Finish - EVtSessionStartupFinish, // 103 - - // Shutdown (reset engine): - EVtSessionShutdown = 300, // 300 - // Hide application. - EVtSessionShutdownHideApplication = EVtSessionShutdown, // 300 - // Reset engine. - EVtSessionShutdownResetEngine, // 301 - - - // Answered: - EVtSessionAnswered = 500, // 500 - // Start remote render. - EVtSessionAnsweredStartRemoteRender = EVtSessionAnswered, // 500 - // Prepare Camere - EVtSessionAnsweredDoPrepareCamera, // 501 - // Select camera as source. - EVtSessionAnsweredSetlectCamera, // 502 - // Select blank image as source. - EVtSessionAnsweredSetlectNone, - // Start view finder - EVtSessionAnsweredStartViewFinder, // 504 - // Show Application - EVtSessionAnsweredBringToForeground, // 505 - - //EVtSessionAnswered = 500, // 500 - //EVtSessionAnsweredBringToForeground = EVtSessionAnswered, // 505 - - // Finish. - EVtSessionAnsweredFinish // 506 - }; - - -/** - * Encapsulates event handling. - * @since Series 60 2.6 - */ -class CLcVtSession::CEventObserver - : public CBase, - public MLcVtEngineCommandManager, - public MVtEngEventObserver, -#ifndef NGA_VIDEO_RENDER - public MVtEngFrameObserver, -#endif - public MVtEngCommandObserver - { - public: // Constructors and destructors - - /** - * Two-phased constructor. - * @param aSession plugin session. - */ - static CEventObserver* NewL(CLcVtSession& aSession); - - /** - * Destructor. - */ - ~CEventObserver(); - - public: // Functions from base classes - - /** - * @see MLcVtEngineCommandManager::AddObserverL. - */ - void AddObserverL( MVtEngCommandObserver& aObserver ); - - /** - * @see MLcVtEngineCommandManager::RemoveObserver. - */ - void RemoveObserver( MVtEngCommandObserver& aObserver ); - - /** - * @see MVtEngEventObserver::HandleVtEventL. - */ - void HandleVtEventL( TInt aEvent ); - - /** - * @see MVtEngCommandObserver::HandleVTCommandPerformedL. - */ - void HandleVTCommandPerformedL( - TVtEngCommandId aCommand, - const TInt aError ); -#ifndef NGA_VIDEO_RENDER - /** - * @see MVtEngFrameObserver::vtHandleFrameL. - */ - void vtHandleFrameL( TFrameType aType, CFbsBitmap* aBitmap ); - - /** - * @see MVtEngFrameObserver::vtSetFrame - */ - void vtSetFrame( TFrameType aType, CFbsBitmap* aBitmap ); -#endif - private: - - /** - * Constructor. - * @param aSession plugin session. - */ - CEventObserver(CLcVtSession& aSession ); - - /** - * Symbian OS constructor. - */ - void ConstructL(); - - private: - - // Ref to plugin session. - CLcVtSession& iSession; - - // ETrue when command events are being sent. - TBool iInCommandPerformed; - - // Owned array of observers. - RPointerArray< MVtEngCommandObserver > iCommandObservers; - - }; - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CLcVtSession* CLcVtSession::NewL() - { - CLcVtSession* self = new ( ELeave ) CLcVtSession(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CLcVtSession::CLcVtSession( ) - { - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ConstructL() - { - - __VTPRINTENTER( "CLcVtSession.ConstructL" ) - - __VTPRINT( DEBUG_MEDIA , "FeatureManager::InitializeLibL()" ) - FeatureManager::InitializeLibL(); - - __VTPRINT( DEBUG_MEDIA , "iCameraHandler.SetSession(this)" ) - iCameraHandler.SetSession(this); - __VTPRINT( DEBUG_MEDIA , "iRemoteVideoPlayer = CLcVtRemoteVideoPlayer_NewL" ) - iRemoteVideoPlayer = CLcVtRemoteVideoPlayer::NewL(this, *this); - __VTPRINT( DEBUG_MEDIA , "iLocalVideoPlayer = CLcVtLocalVideoPlayer_NewL" ) - iLocalVideoPlayer = CLcVtLocalVideoPlayer::NewL(this, *this, iCameraHandler); - -#ifndef NGA_VIDEO_RENDER - iFbsStarted = EFalse; - - __VTPRINT( DEBUG_MEDIA , "iWsSession = &(CCoeEnv::Static()->WsSession())" ) - iWsSession = &(CCoeEnv::Static()->WsSession()); - __VTPRINT( DEBUG_MEDIA , "iWsSessionScreenDev = CCoeEnv::Static()->ScreenDevice()" ) - iWsSessionScreenDev = CCoeEnv::Static()->ScreenDevice(); - __VTPRINT( DEBUG_MEDIA , "iRootWin = &(CCoeEnv::Static()->RootWin())" ) - iRootWin = &(CCoeEnv::Static()->RootWin()); - - __VTPRINT( DEBUG_MEDIA , "ConnectFbsServerL()" ) - ConnectFbsServerL(); -#endif - __VTPRINT( DEBUG_MEDIA , "iEventObserver = CEventObserver_NewL" ) - iEventObserver = CEventObserver::NewL( *this ); - - iModel = CVtEngModel::NewL( *iEventObserver, *iEventObserver ); - - __VTPRINT( DEBUG_MEDIA , "iLcVtStates_new" ) - iLcVtStates = new ( ELeave ) TLcVtStates( *iModel ); - __VTPRINT( DEBUG_MEDIA , "iLcVtStates->Update()" ) - iLcVtStates->Update(); - - __VTPRINT( DEBUG_MEDIA , "new_iActiveExec" ) - iActiveExec = - new ( ELeave ) CLcVtActiveExec( CActive::EPriorityHigh ); - - __VTPRINT( DEBUG_MEDIA , "SetCallIdL( KVtUiDefaultCallId )" ) - SetCallIdL( KVtUiDefaultCallId ); - - __VTPRINT( DEBUG_MEDIA , "iAsyncCallback" ) - iAsyncCallback = - new ( ELeave ) CAsyncCallBack ( - TCallBack( &DoExit, this ), - CActive::EPriorityStandard ); -#if 0 - __VTPRINT( DEBUG_MEDIA , "iLayoutChangeCallback" ) - iLayoutChangeCallback = - new ( ELeave ) CAsyncCallBack( - TCallBack( &DelayedHandleLayoutChanged, this ), - CActive::EPriorityStandard ); -#endif - CRepository* repository = CRepository::NewL( KCRUidTelephonySettings ); - - if ( repository->Get( KSettingsVTVideoSending, VideoSendingKey ) == KErrNone ) - { - __VTPRINT2( DEBUG_GEN, "CLcVtSession.IsFeatureSupported get key=%d", VideoSendingKey ) - } - else - { - __VTPRINT( DEBUG_GEN, "CLcVtSession.IsFeatureSupported set key to default KAllwaysAllow" ) - VideoSendingKey = KAllwaysAllow; - } - delete repository; - - iIndicatorCtr = new ( ELeave ) LcVtIndicatorController(); - __VTPRINTEXIT( "CLcVtSession.ConstructL" ) - - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CLcVtSession::~CLcVtSession() - { - __VTPRINTENTER( "CLcVtSession.~CLcVtSession" ) - - //delete iLayoutChangeCallback; - delete iAsyncCallback; - -#ifndef NGA_VIDEO_RENDER - DisconnectFbsServer(); -#endif - delete iActiveExec; - delete iLcVtStates; - - delete iModel; - - delete iEventObserver; - iEventObserver = NULL; - -#ifdef NGA_VIDEO_RENDER - DestroyVideoWindows(); -#endif - - delete iLocalVideoPlayer; - delete iRemoteVideoPlayer; - - delete iRemoteDisplayName; - delete iRemoteDetails; - if (iIndicatorCtr) { - iIndicatorCtr->disableActiveCallIndicator(); - delete iIndicatorCtr; - } - __VTPRINTEXIT( "CLcVtSession.~CLcVtSession" ) - FeatureManager::UnInitializeLib(); - } - -#ifndef NGA_VIDEO_RENDER -void CLcVtSession::ConnectFbsServerL() - { - // VT use bitmaps viewfinder now, So we start FBS server for proto demo - // and later we will use Qt image object to implement bitmaps view finder or we will use direct view finder - TInt err( KErrNone ); - // Start Font&Bitmap server - err = FbsStartup(); - if ( err == KErrNone ) - { - err = RFbsSession::Connect(); - if( err == KErrNone ) - { - iFbsStarted = ETrue; - } - } - - iDummy = new ( ELeave ) CFbsBitmap(); - //CleanupStack::PushL( iDummy ); - User::LeaveIfError( iDummy->Create( TSize( 4096, 1 ), EColor64K ) ); - - iGc = new (ELeave) CWindowGc( iWsSessionScreenDev ); - //CleanupStack::PushL( iGc ); - User::LeaveIfError( iGc->Construct()); - - //CleanupStack::Pop(2); - } - - -void CLcVtSession::DisconnectFbsServer() - { - delete iGc; - delete iDummy; - if ( iFbsStarted ) - { - RFbsSession::Disconnect(); - iFbsStarted = EFalse; - } - } -#endif -#ifdef NGA_VIDEO_RENDER - -_LIT(KVTWindowGroupName,"32VTPluginVideoWindow"); - -void CLcVtSession::CreateVideoWindowsL() - { - __VTPRINTENTER( "CLcVtSession.CreateVideoWindowsL" ) - User::LeaveIfError( iRwSession.Connect() ); - - iRwGroup = new (ELeave) RWindowGroup( iRwSession ) ; - iRwGroup->Construct( (TUint32)iRwGroup, EFalse ); - - iRwGroup->SetName( KVTWindowGroupName ); - iRwGroup->SetOrdinalPosition( 1 , ECoeWinPriorityNeverAtFront ); - iRwGroup->AutoForeground(EFalse); - - iDev = new (ELeave) CWsScreenDevice( iRwSession ); - iDev->Construct( ); - - iRemoteVideoWindow = new (ELeave) RWindow( iRwSession ); - iRemoteVideoWindow->Construct( *iRwGroup, (TUint32)iRemoteVideoWindow ); - - TRect RMRect = RemoteVideoPlayer()->LcWindow()->LcWindowRect(); - iRemoteVideoWindow->SetExtent( RMRect.iTl, RMRect.Size() ); - iRemoteVideoWindow->SetOrdinalPosition( 1, ECoeWinPriorityNeverAtFront ); - iRemoteVideoWindow->Activate(); - - iLocalVideoWindow = new (ELeave) RWindow( iRwSession ); - iLocalVideoWindow->Construct( *iRwGroup, (TUint32)iLocalVideoWindow ); - - TRect VFRect = LocalVideoPlayer()->LcWindow()->LcWindowRect(); - iLocalVideoWindow->SetExtent( VFRect.iTl, VFRect.Size() ); - iLocalVideoWindow->SetOrdinalPosition( 1, ECoeWinPriorityNeverAtFront ); - iLocalVideoWindow->Activate(); - - iRwSession.Flush(); - - __VTPRINTEXIT( "CLcVtSession.CreateVideoWindowsL" ) - } - -void CLcVtSession::DestroyVideoWindows() - { - - delete iDev; - iDev = NULL; - delete iRemoteVideoWindow; - iRemoteVideoWindow = NULL; - delete iLocalVideoWindow; - iLocalVideoWindow = NULL; - delete iRwGroup; - iRwGroup = NULL; - iRwSession.Close(); - } - -#endif - - -void CLcVtSession::SetLcSessionObserver( MLcSessionObserver* aObserver ) - { - iObserver = aObserver; - } - -void CLcVtSession::SetLcUiProvider( MLcUiProvider* aUiProvider ) - { - iUiProvider = aUiProvider; - } - -TBool CLcVtSession::IsBackgroundStartup() - { - return ETrue; - } - -TBool CLcVtSession::SendDialTone( TChar aKey ) - { - iDtmfTone = aKey; - __VTPRINT2( DEBUG_GEN, "CLcVtSession.SendDialTone: %d", iDtmfTone() ) - if ( Execute( KVtEngStartDtmfTone, &iDtmfTone ) != KErrNone ) - { - return EFalse; - } - else - { - return ETrue; - } - } - -void CLcVtSession::EstablishLcSessionL() - { - __VTPRINTENTER( "CLcVtSession.EstablishLcSessionL" ) - - TLcVtStateBase::SetInitialStateL( *this, *iLcVtStates ); - - __VTPRINTEXIT( "CLcVtSession.EstablishLcSessionL" ) - } - -void CLcVtSession::TerminateLcSessionL() - { - __VTPRINTENTER( "CLcVtSession.TerminateLcSessionL" ) - HandleCommandL( EPluginCmdEndActiveCall ); - __VTPRINTEXIT( "CLcVtSession.TerminateLcSessionL" ) - } - -MLcVideoPlayer* CLcVtSession::RemoteVideoPlayer() - { - return iRemoteVideoPlayer; - } - -MLcVideoPlayer* CLcVtSession::LocalVideoPlayer() - { - return iLocalVideoPlayer; - } - -MLcSession::TLcSessionState CLcVtSession::LcSessionState() const - { - return iSessionState; - } - -const TDesC& CLcVtSession::LocalDisplayName() - { - return KNullDesC; - } -const TDesC& CLcVtSession::RemoteDisplayName() - { - if ( iRemoteDisplayName ) - { - return *iRemoteDisplayName; - } - return KNullDesC; - } - -TInt CLcVtSession::SetParameter( TInt aId, TInt aValue ) - { - if (aId == 0) - iMainWindow = reinterpret_cast(aValue); - - return 0; - } - -TInt CLcVtSession::ParameterValue( TInt aId ) - { - return 0; - } - -const TDesC& CLcVtSession::RemoteDetails() - { - if ( iRemoteDetails ) - { - return *iRemoteDetails; - } - return KNullDesC; - } - -void CLcVtSession::UpdateLcSessionL() - { - __VTPRINTENTER( "CLcVtSession.UpdateLcSessionL" ) - - if(iLcVtStates->ExecState() != TLcVtStates::EExecStateRunning ) - { - __VTPRINTEXIT( "CLcVtSession.UpdateLcSessionL -- State Not OK" ) - return; - } -#if 0 - if(iLocalVideoPlayer->IsOrientationChanged()) - HandleLayoutChanged(); - else - UpdateRenderingParametersL(); -#endif - UpdateRenderingParametersL(); - __VTPRINTEXIT( "CLcVtSession.UpdateLcSessionL" ) - } - -// ----------------------------------------------------------------------------- -// From MLcAudioControl -// ----------------------------------------------------------------------------- -// -TBool CLcVtSession::IsLcAudioMutedL() - { - return EFalse; - } - -// ----------------------------------------------------------------------------- -// From MLcAudioControl -// ----------------------------------------------------------------------------- -// -void CLcVtSession::MuteLcAudioL( TBool aMute ) - { - } - -// ----------------------------------------------------------------------------- -// From MLcAudioControl -// ----------------------------------------------------------------------------- -// -TBool CLcVtSession::IsLcMicMutedL() - { - TBool result = !(iLcVtStates->AudioState().IsAudio()); - __VTPRINT2( DEBUG_GEN, "CLcVtSession.IsLcMicMutedL = %d", result ) - return result; - } - -// ----------------------------------------------------------------------------- -// From MLcAudioControl -// ----------------------------------------------------------------------------- -// -void CLcVtSession::MuteLcMicL( TBool aMute ) - { - __VTPRINT2( DEBUG_GEN, "CLcVtSession.MuteLcMicL aMute = %d", aMute ) - - if(aMute) - { - HandleCommandL(EPluginCmdDisableAudio); - } - else - { - HandleCommandL(EPluginCmdEnableAudio); - } - } - -// ----------------------------------------------------------------------------- -// From MLcAudioControl -// ----------------------------------------------------------------------------- -// -TBool CLcVtSession::IsEnablingLcLoudspeakerAllowed() - { - return ETrue; - } - -// ----------------------------------------------------------------------------- -// From MLcAudioControl -// ----------------------------------------------------------------------------- -// -void CLcVtSession::EnableLcLoudspeakerL( TBool aEnabled ) - { - __VTPRINT2( DEBUG_GEN, "CLcVtSession.EnableLcLoudspeakerL aEnabled = %d", aEnabled ) - - if(aEnabled) - { - HandleCommandL(EPluginCmdActivateLoudspeaker); - } - else - { - HandleCommandL(EPluginCmdDeactivateLoudspeaker); - } - } - -// ----------------------------------------------------------------------------- -// From MLcAudioControl -// ----------------------------------------------------------------------------- -// -TBool CLcVtSession::IsLcLoudspeakerEnabled() - { - TBool result = !(iLcVtStates->AudioState().CanActivateLoudspeaker()); - __VTPRINT2( DEBUG_GEN, "CLcVtSession.IsLcLoudspeakerEnabled = %d", result ) - return result; - } - -// ----------------------------------------------------------------------------- -// From MLcAudioControl -// ----------------------------------------------------------------------------- -// -TInt CLcVtSession::LcVolumeL() - { - MVtEngAudio& audio = iModel->Audio(); - MVtEngAudio::TAudioRoutingState audioRouting; - User::LeaveIfError( audio.GetRoutingState( audioRouting ) ); - const TInt volume( audio.OutputVolume( - !( audioRouting == MVtEngAudio::EAudioLoudspeaker ) ) ); - - return volume; - } - -// ----------------------------------------------------------------------------- -// From MLcAudioControl -// ----------------------------------------------------------------------------- -// -void CLcVtSession::SetLcVolumeL( TInt aValue ) - { - __VTPRINTENTER( "CLcVtSession.SetLcVolumeL" ) - MVtEngAudio& audio = iModel->Audio(); - const TInt HandsetVolume( audio.OutputVolume(ETrue) ); - const TInt HandsfreeVolume( audio.OutputVolume(EFalse) ); - MVtEngAudio::TVtEngOutputVolume volume; - volume.iHandsetVolume = HandsetVolume; - volume.iHandsfreeVolume = HandsfreeVolume; - - MVtEngAudio::TAudioRoutingState audioRouting; - User::LeaveIfError( audio.GetRoutingState( audioRouting ) ); - if(audioRouting == MVtEngAudio::EAudioHandset) - volume.iHandsetVolume = aValue; - else - volume.iHandsfreeVolume = aValue; - - ExecuteCmdL( KVtEngSetAudioVolume, volume ); - __VTPRINTEXIT( "CLcVtSession.SetLcVolumeL" ) - } - -// ----------------------------------------------------------------------------- -// From MLcAudioControl -// ----------------------------------------------------------------------------- -// -void CLcVtSession::IncreaseLcVolumeL() - { - ExecuteCmdL( KVtEngIncreaseAudioVolume ); - } - -// ----------------------------------------------------------------------------- -// From MLcAudioControl -// ----------------------------------------------------------------------------- -// -void CLcVtSession::DecreaseLcVolumeL() - { - ExecuteCmdL( KVtEngDecreaseAudioVolume ); - } - -CVtEngModel& CLcVtSession::Model() - { - return *iModel; - } - - -void CLcVtSession::HandleCommandL(const TInt aCommand) - { - - __VTPRINTENTER( "CLcVtSession.HandleCommandL" ) - - if ( iLcVtStates->ExecState() != TLcVtStates::EExecStateRunning ) - { - __VTPRINTEXIT( "CLcVtSession.HandleCommandL NOT ready" ) - return; - } - - if ( iState->HandleCommandL( aCommand ) == TLcVtStateBase::EEventHandled ) - { - __VTPRINTEXIT( "CLcVtSession.HandleCommandL 0" ) - return; - } - - __VTPRINT2( DEBUG_GEN, "CLcVtSession.HandleCommandL command = %d", aCommand ) - - switch ( aCommand ) - { - case EPluginCmdEnableAudio: - CmdEnableAudioL(); - break; - - case EPluginCmdDisableAudio: - CmdDisableAudioL(); - break; - - case EPluginCmdUsePrimaryCamera: - CmdUseCameraL( ETrue ); - break; - - case EPluginCmdUseSecondaryCamera: - CmdUseCameraL( EFalse ); - break; - - case EPluginCmdEnableVideo: - CmdEnableVideoL(); - break; - - case EPluginCmdDisableVideo: - CmdDisableVideoL(); - break; - - case EPluginCmdActivateLoudspeaker: - CmdActivateLoudspeakerL(); - break; - - case EPluginCmdDeactivateLoudspeaker: - CmdDeactivateLoudspeakerL(); - break; - - } - - __VTPRINTEXIT( "CLcVtSession.HandleCommandL" ) - - iLcVtStates->Update(); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::CmdEnableAudioL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::CmdEnableAudioL() - { - ExecuteCmdL( KVtEngUnmuteOutgoingAudio ); - iLcVtStates->Update(); - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::CmdDisableAudioL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::CmdDisableAudioL() - { - ExecuteCmdL( KVtEngMuteOutgoingAudio ); - iLcVtStates->Update(); - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::CmdUseCameraL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::CmdUseCameraL( const TBool aPrimaryCamera ) - { - - MVtEngMedia& media = iModel->Media(); - - MVtEngMedia::TMediaSource selectedSource = - ( aPrimaryCamera ) ? - MVtEngMedia::EMediaCameraPri : MVtEngMedia::EMediaCameraSec; - - TInt available = 0; - LcVtUtility::GetOutgoingMediaState( media, available ); - if ( available & MVtEngMedia::EMediaVideo ) - { - ExecuteCmdL( KVtEngStopViewFinder ); - - TRAPD( err, ExecuteCmdL( KVtEngSetSource, selectedSource ) ); - - if ( err == KErrNone ) - { - ExecuteCmdL( KVtEngStartViewFinder ); - } - else - { - //ShowOtherCameraNotUsableNoteL(); - } - } - else - { - /* - MVtEngMedia::TPrepareCameraParams params; - params.iMediaSource = selectedSource; - params.iInitialize = EFalse; - TRAPD( err, ExecuteCmdL( KVtEngPrepareCamera, params ) ); - if ( err != KErrNone ) - { - ShowOtherCameraNotUsableNoteL(); - } - */ - } - - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::CmdEnableVideoL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::CmdEnableVideoL() - { - // if outgoing video is frozen - MVtEngMedia& media = iModel->Media(); - if ( LcVtUtility::GetFreezeState( media ) ) - { - ExecuteCmdL( KVtEngUnfreeze ); - // swap images if needed - //RestoreViewFinderL(); - } - else - { - ExecuteCmdL( KVtEngStopViewFinder ); - //iUplinkWindow->SetStreamBitmap( NULL ); - MVtEngMedia::TMediaSource source = MVtEngMedia::EMediaCamera; - ExecuteCmdL( KVtEngSetSource, source ); - MVtEngMedia::TCameraId id; - if ( iModel->Media().GetCurrentCameraId( id ) == KErrInUse ) - { - //ShowCameraInUseNoteL(); - } - ExecuteCmdL( KVtEngStartViewFinder ); - } - // update VB settings - //UpdateVBSettingL(); - iLcVtStates->Update(); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::CmdDisableVideoL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::CmdDisableVideoL() - { - ExecuteCmdL( KVtEngStopViewFinder ); - - //iUplinkWindow->SetStreamBitmap( NULL ); - - TInt err = KErrNotFound; - if ( LcVtUtility::HasStillImage( iModel->Media() ) ) - { - __VTPRINT( DEBUG_GEN, "CLcVtSession.CmdDisableVideoL.HasStill" ) - MVtEngMedia::TMediaSource source = MVtEngMedia::EMediaStillImage; - TRAP( err, ExecuteCmdL( KVtEngSetSource, source ) ); - } - if ( ( err != KErrNone ) ) - { - __VTPRINT( DEBUG_GEN, "CLcVtSession.CmdDisableVideoL.MediaNone" ) - MVtEngMedia::TMediaSource source = MVtEngMedia::EMediaNone; - ExecuteCmdL( KVtEngSetSource, source ); - } - - ExecuteCmdL( KVtEngStartViewFinder ); - iLcVtStates->Update(); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::CmdActivateLoudspeakerL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::CmdActivateLoudspeakerL() - { - MVtEngAudio::TVtEngRoutingSetting audioSetting = - MVtEngAudio::EActivateHandsfree; - ExecuteCmdL( KVtEngSetAudioRouting, audioSetting ); - iLcVtStates->Update(); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::CmdDeactivateLoudspeakerL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::CmdDeactivateLoudspeakerL() - { - MVtEngAudio::TVtEngRoutingSetting audioSetting = - MVtEngAudio::EDeactivateHansfree; - ExecuteCmdL( KVtEngSetAudioRouting, audioSetting ); - iLcVtStates->Update(); - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::SetZoomFactorL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::SetZoomFactorL( TInt aZoomStep ) - { - __VTPRINTENTER( "CLcVtSessionCLcVtSession.SetZoomFactorL" ) - MVtEngMedia& media = iModel->Media(); - if ( LcVtUtility::IsZoomAllowed( media ) ) - { - ExecuteCmdL( KVtEngSetZoomStep, aZoomStep ); - } - __VTPRINTEXIT( "CLcVtSession.SetZoomFactorL" ) - } - -#ifndef NGA_VIDEO_RENDER -//local video display, VT use bitmaps vf now, and maybe replace by direct vf later -void CLcVtSession::vtHandleFrameL( CFbsBitmap* aBitmap ) - { - __VTPRINTENTER( "CLcVtSession.vtHandleFrameL" ) - - /* - TRect VFRect = LocalVideoPlayer()->LcWindow()->LcWindowRect(); - const TPoint KVFcordinate( VFRect.iTl.iX, VFRect.iTl.iY ); - iMainWindow->Invalidate(); - iMainWindow->BeginRedraw(); - iGc->Activate( *iMainWindow ); - aBitmap->BeginDataAccess(); - aBitmap->EndDataAccess(); - iGc->BitBlt( KVFcordinate , aBitmap ); - iGc->Deactivate(); - iMainWindow->EndRedraw(); - */ - - /* - TRect VFRect = LocalVideoPlayer()->LcWindow()->LcWindowRect(); - const TPoint KVFcordinate( VFRect.iTl.iX -2 , VFRect.iTl.iY - 168 ); - iLocalVideoWindow->Invalidate(); - iLocalVideoWindow->BeginRedraw(); - iGc->Activate( *iLocalVideoWindow ); - iGc->BitBlt( KVFcordinate , aBitmap ); - iGc->Deactivate(); - iLocalVideoWindow->EndRedraw(); - */ - - __VTPRINTEXIT("CLcVtSession.vtHandleFrameL") - } -#endif - -TInt CLcVtSession::SetForegroundStatus( TBool aIsForeground ) -{ - __VTPRINTENTER( "CLcVtSession.SetForegroundStatus" ) - __VTPRINT2( DEBUG_MEDIA , " foreground: %d", aIsForeground ) - - if ( iRwGroup ) - { - TInt priority = aIsForeground ? ECoeWinPriorityNormal : ECoeWinPriorityNeverAtFront; - iRwGroup->SetOrdinalPosition( 1 , priority ); - iRemoteVideoWindow->SetOrdinalPosition( 1 , priority ); - iLocalVideoWindow->SetOrdinalPosition( 1 , priority ); - iRwSession.Flush(); - } - if ( aIsForeground ) - { - iIndicatorCtr->disableActiveCallIndicator(); - } - else { - iIndicatorCtr->enableActiveCallIndicator(); - } - - __VTPRINTEXIT( "CLcVtSession.SetForegroundStatus" ) - - return KErrNone; -} - -// ----------------------------------------------------------------------------- -// CLcVtSession::ShutdownL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ShutdownL() - { - __VTPRINTENTER( "CLcVtSession.ShutdownL" ) - iActiveExec->Start( EVtSessionShutdown, *this ); - __VTPRINTEXIT( "CLcVtSession.ShutdownL" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::StartupPhase1L -// ----------------------------------------------------------------------------- -// -void CLcVtSession::StartupPhase1L() - { - __VTPRINTENTER( "CLcVtSession.StartupPhase1L" ) - iActiveExec->Start( EVtSessionStartup, *this ); - __VTPRINTEXIT( "CLcVtSession.StartupPhase1L" ) - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::StartupPhase2L -// ----------------------------------------------------------------------------- -// -void CLcVtSession::StartupPhase2L() - { - __VTPRINTENTER( "CLcVtSession.StartupPhase2L" ) - iActiveExec->Start( EVtSessionAnswered, *this ); - __VTPRINTEXIT( "CLcVtSession.StartupPhase2L" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecExecuteL -// ----------------------------------------------------------------------------- -// -TBool CLcVtSession::ActiveExecExecuteL( - CLcVtActiveExec& /*aActiveExec*/, - const TInt aState, - TInt& aNextState, - TRequestStatus& aRequest ) - { - return ActiveExecInitExecuteL( - aState, - aNextState, - aRequest ); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecContinue -// ----------------------------------------------------------------------------- -// -TBool CLcVtSession::ActiveExecContinue( - CLcVtActiveExec& /*aActiveExec*/, - TInt& aState, - const TInt aError ) - { - return ActiveExecInitContinue( aState, aError ); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecCancel -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ActiveExecCancel( - CLcVtActiveExec& /*aActiveExec*/, - TInt aState ) - { - ActiveExecInitCancel( aState ); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecDone -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ActiveExecDone( - CLcVtActiveExec& /*aActiveExec*/, - const TInt aInitialState ) - { - ActiveExecInitDone( aInitialState ); - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecInitCancel -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ActiveExecInitCancel( - const TInt /*aState*/ ) - { - __VTPRINTENTER( "CLcVtSession.InitExecCancel" ) - - delete iCmdExecutor; - - if ( iShutdownRequest ) - { - User::RequestComplete( iShutdownRequest, KErrCancel ); - iShutdownRequest = NULL; - } - __VTPRINTEXIT( "CLcVtSession.InitExecCancel" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecInitDone -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ActiveExecInitDone( - const TInt aInitialState ) - { - __VTPRINTENTER( "CLcVtSession.ExecInitDone" ) - __VTPRINT2( DEBUG_GEN, "CLcVtSession.InitExecDone.ini=%d", aInitialState ) - // Operation succeeded - - // Now we have finished. - if ( iState ) - { - if ( aInitialState == EVtSessionAnswered ) - { - TRAP_IGNORE( iState->LcVtStartupPhase2DoneL() ); - iSessionState = EOpen; - iObserver->StateChanged( *this ); - } - else if ( aInitialState == EVtSessionShutdown ) - { - TRAP_IGNORE( iState->ShutdownDoneL() ); - } - else // EVtSessionStartup - { - TRAP_IGNORE( iState->LcVtStartupPhase1DoneL() ); - } - } - __VTPRINTEXIT( "CLcVtSession.ExecInitDone" ) - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecInitExecuteL -// ----------------------------------------------------------------------------- -// -TBool CLcVtSession::ActiveExecInitExecuteL( - const TInt aState, - TInt& aNextState, - TRequestStatus& aRequest ) - { - __VTPRINTENTER( "CLcVtSession.ActiveExecInitExecuteL" ) - __VTPRINT2( DEBUG_GEN, "CLcVtSession.ActiveExecInitExecuteL.st=%d", aState ) - - TBool synch = EFalse; - - switch ( aState ) - { - // Startup chain: - case EVtSessionStartupInitEngine: - //ChangeApplicationFocus(ETrue); -#if defined (__WINS__) - ActiveExecInitExecuteCommandL( KVtEngInitializeEngineDiag, aRequest ); -#else - ActiveExecInitExecuteCommandL( KVtEngInitializeEngine, aRequest ); -#endif - aNextState = EVtSessionStartupPrepareViewfinder; - //aNextState = EVtSessionStartupFinish; - break; - - case EVtSessionStartupPrepareViewfinder: - //iSessionState = EOpen; - //iObserver->StateChanged( *this ); - -#ifdef NGA_VIDEO_RENDER - CreateVideoWindowsL(); -#endif - ActiveExecInitPrepareViewFinderL( aRequest ); - aNextState = EVtSessionStartupPrepareRemoteRender; - break; - - case EVtSessionStartupPrepareRemoteRender: - ActiveExecInitPrepareRemoteRenderL( aRequest ); - aNextState = EVtSessionStartupFinish; - break; - - case EVtSessionStartupFinish: - aNextState = EVtSessionNone; - synch = ETrue; - break; - - - // Shutdown chain: - case EVtSessionShutdownHideApplication: - ChangeApplicationFocus( EFalse ); - synch = ETrue; - aNextState = EVtSessionShutdownResetEngine; - break; - case EVtSessionShutdownResetEngine: - { - aRequest = KRequestPending; - - MVtEngCommandHandler& command = iModel->CommandHandler(); - // There should not be any commands ongoing because - // we have canceled all dialogs (and this should - // be the only command without dialog). - command.CancelCommand( command.PendingCommand() ); // ignore error - command.ExecuteL( KVtEngResetEngine, NULL ); - iShutdownRequest = &aRequest; - - aNextState = EVtSessionNone; - } - break; - - - - // Answered chain: - case EVtSessionAnsweredStartRemoteRender: - { - ActiveExecInitExecuteCommandL( KVtEngStartRenderRemote, aRequest ); - //TRequestStatus* status = &aRequest; - //User::RequestComplete( status, KErrNone ); - - MVtEngSessionInfo::TDirection direction; - if ( iModel->Session().GetDirection( direction ) != KErrNone ) - { - direction = MVtEngSessionInfo::EDirectionMT; - } - - MVtEngMedia& media = iModel->Media(); - if ( LcVtUtility::HasCameras( media ) ) - { - if ( direction == MVtEngSessionInfo::EDirectionMT ) - { - if ( VideoSendingKey == KAllwaysAllow) - { - aNextState = EVtSessionAnsweredDoPrepareCamera; - } - else - { - aNextState = EVtSessionAnsweredSetlectNone; - } - } - else - { - //MVtEngSessionInfo::EDirectionMO - aNextState = EVtSessionAnsweredDoPrepareCamera; - } - } - else - { - aNextState = EVtSessionAnsweredSetlectNone; - } - } - break; - - case EVtSessionAnsweredSetlectNone: - { - ActiveExecInitSetSourceL( MVtEngMedia::EMediaNone, aRequest ); - aNextState = EVtSessionAnsweredStartViewFinder; - } - break; - case EVtSessionAnsweredDoPrepareCamera: - { - MVtEngMedia& media = iModel->Media(); - MVtEngMedia::TMediaSource source = MVtEngMedia::EMediaCamera; - ActiveExecInitPrepareCameraL( source, aRequest ); - aNextState = EVtSessionAnsweredSetlectCamera; - } - break; - - case EVtSessionAnsweredSetlectCamera: - ActiveExecInitSetSourceL( MVtEngMedia::EMediaCamera, aRequest ); - aNextState = EVtSessionAnsweredStartViewFinder; - break; - - case EVtSessionAnsweredStartViewFinder: - ActiveExecInitExecuteCommandL( KVtEngStartViewFinder, aRequest ); - aNextState = EVtSessionAnsweredBringToForeground; - break; - - case EVtSessionAnsweredBringToForeground: - { - //CreateVideoWindowsL(); - - ChangeApplicationFocus(ETrue); - TRequestStatus* status = &aRequest; - User::RequestComplete( status, KErrNone ); - aNextState = EVtSessionAnsweredFinish; - } - break; - - case EVtSessionAnsweredFinish: - { - //iRwGroup->SetOrdinalPosition( 1 , ECoeWinPriorityNormal ); - - TBool handleAsForeground( ETrue ); - TPtrC8 params( reinterpret_cast< TUint8* >( &handleAsForeground ), sizeof( TBool ) ); - MVtEngCommandHandler& command = iModel->CommandHandler(); - TRAPD( err, command.ExecuteL( KVtEngSetUIForeground, ¶ms )); - if(err != KErrNone) - { - err = KErrNone; - } - - iLcVtStates->Update(); - - iObserver->StateChanged( *iLocalVideoPlayer ); - iObserver->StateChanged( *iRemoteVideoPlayer ); - - synch = ETrue; - aNextState = EVtSessionNone; - } - break; - } - - __VTPRINT2( DEBUG_GEN, "CLcVtSession.ActiveExecInitExecuteL.sync=%d", synch ) - __VTPRINT2( DEBUG_GEN, "CLcVtSession.ActiveExecInitExecuteL.next=%d", aNextState ) - __VTPRINTEXITR( "CLcVtSession.ActiveExecInitExecuteL %d", synch ) - return synch; - - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecInitContinue -// ----------------------------------------------------------------------------- -// -TBool CLcVtSession::ActiveExecInitContinue( - TInt& aState, - const TInt /*aError*/ ) - { - __VTPRINTENTER( "CLcVtSession.InitExecCont" ) - __VTPRINT2( DEBUG_GEN, "CLcVtSession.InitExecCont.st=%d", aState ) - - const TBool cont = EFalse; - __VTPRINT2( DEBUG_GEN, "VtUi.InitExecCont.cont=%d", cont ) - - if ( !cont ) - { - // Operation failed. - if ( iState ) - { - TRAP_IGNORE( iState->LcVtStartupFailedL() ); - } - } - __VTPRINTEXITR( "VtUi.InitExecCont %d", cont ) - return cont; - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecInitExecuteCommandL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ActiveExecInitExecuteCommandL( - const TVtEngCommandId aCommand, - TRequestStatus& aRequest ) - { - iCmdExecutor = - ExecuteCmdAsyncL( - &iCmdExecutor, - aCommand, - aRequest ); - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecInitPrepareViewFinderL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ActiveExecInitPrepareViewFinderL( - TRequestStatus& aRequest ) - { - - __VTPRINTENTER( "CLcVtSession.ActiveExecInitPrepareViewFinderL" ) - - TRect VFRect = LocalVideoPlayer()->LcWindow()->LcWindowRect(); - TSize size (VFRect.Size()); - -#ifdef NGA_VIDEO_RENDER - - __VTPRINT3(DEBUG_GEN, "CLcVtSession.ActiveExecInitPrepareViewFinderL size(%d,%d)", size.iWidth, size.iHeight ) - - iLocalVideoWindow->SetPosition( VFRect.iTl ); - iLocalVideoWindow->SetSize( VFRect.Size() ); - - iRwSession.Flush(); - - __VTPRINT2( DEBUG_MEDIA , " LocalVideoPlayer.VFRect.iTl.iX: %d", VFRect.iTl.iX ) - __VTPRINT2( DEBUG_MEDIA , " LocalVideoPlayer.VFRect.iTl.iY: %d", VFRect.iTl.iY ) - __VTPRINT2( DEBUG_MEDIA , " LocalVideoPlayer.VFRect.iWidth: %d", VFRect.Width() ) - __VTPRINT2( DEBUG_MEDIA , " LocalVideoPlayer.VFRect.iHeight: %d", VFRect.Height() ) - - TVtEngRenderingOptionsNGA configViewfinder( *iLocalVideoWindow, iRwSession ); - iCmdExecutor = - ExecuteCmdAsyncL( - &iCmdExecutor, - KVtEngPrepareViewFinder, - configViewfinder, - aRequest ); - - - /* - TPoint point( 0, 0 ); - TRect vfRect( point, size ); - - TVtEngRenderingOptionsDSA configViewfinder(*iEventObserver, iRwSession ,*iDev, *iLocalVideoWindow, vfRect, vfRect); - - iCmdExecutor = - ExecuteCmdAsyncL( - &iCmdExecutor, - KVtEngPrepareViewFinderDSA, - configViewfinder, - aRequest ); - */ - -#else - - __VTPRINT3(DEBUG_GEN, "CLcVtSession.ActiveExecInitPrepareViewFinderL size(%d,%d)", size.iWidth, size.iHeight ) - - TVtEngRenderingOptions configViewfinder(*iEventObserver, size); - - iCmdExecutor = - ExecuteCmdAsyncL( - &iCmdExecutor, - KVtEngPrepareViewFinder, - configViewfinder, - aRequest ); - -#endif - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecInitPrepareRemoteRenderL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ActiveExecInitPrepareRemoteRenderL( - TRequestStatus& aRequest ) - { - - TRect RMRect = RemoteVideoPlayer()->LcWindow()->LcWindowRect(); - const TSize KRMsize( RMRect.Size()); - TRect screen( KRMsize ); - TRect clip( KRMsize ); - -#ifdef NGA_VIDEO_RENDER - - iRemoteVideoWindow->SetPosition( RMRect.iTl ); - iRemoteVideoWindow->SetSize( RMRect.Size() ); - - iRwSession.Flush(); - - __VTPRINT2( DEBUG_MEDIA , " RemoteVideoPlayer.RMRect.iTl.iX: %d", RMRect.iTl.iX ) - __VTPRINT2( DEBUG_MEDIA , " RemoteVideoPlayer.RMRect.iTl.iY: %d", RMRect.iTl.iY ) - __VTPRINT2( DEBUG_MEDIA , " RemoteVideoPlayer.RMRect.iWidth: %d", RMRect.Width() ) - __VTPRINT2( DEBUG_MEDIA , " RemoteVideoPlayer.RMRect.iHeight: %d", RMRect.Height() ) - - - TVtEngRenderingOptionsNGA configRemoteRender( *iRemoteVideoWindow, iRwSession ); - iCmdExecutor = - ExecuteCmdAsyncL( - &iCmdExecutor, - KVtEngPrepareRemoteRenderNGA, - configRemoteRender, - aRequest ); - -#else - - const TPoint KRMcordinate( RMRect.iTl.iX, RMRect.iTl.iY ); - - TVtEngRenderingOptionsDP configRemoteRender(*iEventObserver, *iWsSession ,*iWsSessionScreenDev, *iMainWindow, screen, clip, KRMcordinate ); - - iCmdExecutor = - ExecuteCmdAsyncL( - &iCmdExecutor, - KVtEngPrepareRemoteRenderDP, - configRemoteRender, - aRequest ); - -#endif - - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecInitPrepareCameraL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ActiveExecInitPrepareCameraL( - const MVtEngMedia::TMediaSource aSource, - TRequestStatus& aRequest ) - { - MVtEngMedia::TPrepareCameraParams params; - params.iMediaSource = aSource; - params.iInitialize = ETrue; - iCmdExecutor = - ExecuteCmdAsyncL( - &iCmdExecutor, - KVtEngPrepareCamera, - params, - aRequest ); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::ActiveExecInitSetSourceL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ActiveExecInitSetSourceL( - const MVtEngMedia::TMediaSource aSource, - TRequestStatus& aRequest ) - { - MVtEngMedia::TMediaSource source = - aSource; - iCmdExecutor = - ExecuteCmdAsyncL( - &iCmdExecutor, - KVtEngSetSource, - source, - aRequest ); - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::ExecuteCmdAsyncL -// ----------------------------------------------------------------------------- -// -CLcVtCmdExecutor* CLcVtSession::ExecuteCmdAsyncL( - CLcVtCmdExecutor** aDialogPtr, - const TVtEngCommandId aCommand, - TRequestStatus& aStatus ) - { - return DoExecuteCmdAsyncL( aDialogPtr, aCommand, NULL, aStatus ); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::ExecuteCmdAsyncL -// ----------------------------------------------------------------------------- -// -template< class T > -CLcVtCmdExecutor* CLcVtSession::ExecuteCmdAsyncL( - CLcVtCmdExecutor** aDialogPtr, - const TVtEngCommandId aCommand, - T& aParam, - TRequestStatus& aStatus ) - { - TPtrC8 params( reinterpret_cast< TUint8* >( &aParam ), sizeof( T ) ); - return DoExecuteCmdAsyncL( aDialogPtr, aCommand, ¶ms, aStatus ); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::DoExecuteCmdAsyncL -// ----------------------------------------------------------------------------- -// -CLcVtCmdExecutor* CLcVtSession::DoExecuteCmdAsyncL( - CLcVtCmdExecutor** aDialogPtr, - const TVtEngCommandId aCommand, - TDesC8* aParams, - TRequestStatus& aStatus ) - { - __VTPRINT2( DEBUG_GEN, "CLcVtSession.DoExecAsync.cmd=%d", aCommand ) - MVtEngCommandHandler& command = iModel->CommandHandler(); - const TInt caps = command.GetCommandCaps( aCommand ); - - if ( caps >= KErrNone ) - { - const TBool asynchronous = - ( caps & MVtEngCommandHandler::EAttribAsync ); - - if ( asynchronous ) - { - CLcVtCmdExecutor* executor = - new ( ELeave ) CLcVtCmdExecutor( - aDialogPtr, - iModel->CommandHandler(), - *iEventObserver ); - executor->ExecuteCmdL( aCommand, aParams, &aStatus ); - return executor; - } - else - { - command.ExecuteL( aCommand, aParams ); - RefreshStatesL(); - TRequestStatus* status = &aStatus; - User::RequestComplete( status, KErrNone ); - } - } - else - { - // Failed. - User::Leave( caps ); - } - - return NULL; - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::ExecuteCmdL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ExecuteCmdL( const TVtEngCommandId aCommand ) - { - DoExecuteCmdL( aCommand, NULL ); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::ExecuteCmdL -// ----------------------------------------------------------------------------- -// -template< class T > -void CLcVtSession::ExecuteCmdL( - const TVtEngCommandId aCommand, - T& aParam ) - { - TPtrC8 params( reinterpret_cast< TUint8* >( &aParam ), sizeof( T ) ); - DoExecuteCmdL( aCommand, ¶ms ); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::DoExecuteCmdL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::DoExecuteCmdL( - const TVtEngCommandId aCommand, - TDesC8* aParams ) - { - __VTPRINT2( DEBUG_GEN, "CLcVtSession.DoExec.cmd=%d", aCommand ) - MVtEngCommandHandler& command = iModel->CommandHandler(); - const TInt caps = command.GetCommandCaps( aCommand ); - - if ( caps >= KErrNone ) - { - const TBool asynchronous = - ( caps & MVtEngCommandHandler::EAttribAsync ); - - if ( asynchronous ) - { - CLcVtCmdExecutor* executor = - new ( ELeave ) CLcVtCmdExecutor( - NULL, - iModel->CommandHandler(), - *iEventObserver ); - iUiProvider->BlockUi(ETrue); - //executor->ExecuteCmdL( aCommand, aParams, NULL ); - TRAPD( err, executor->ExecuteCmdL( aCommand, aParams, NULL ) ); - iUiProvider->BlockUi(EFalse); - if(err != KErrNone) - User::Leave(err); - - } - else - { - command.ExecuteL( aCommand, aParams ); - RefreshStatesL(); - } - } - else - { - // Failed. - User::Leave( caps ); - } - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::Execute -// ----------------------------------------------------------------------------- -// -TInt CLcVtSession::Execute( const TVtEngCommandId aCommand, TDesC8* aParam ) - { - MVtEngCommandHandler& command = iModel->CommandHandler(); - TRAPD( err, command.ExecuteL( aCommand, aParam ) ); -#ifdef VTDEBUG - if ( err != KErrNone ) - { - __VTPRINT3( DEBUG_GEN, "CLcVtSession.Execute.Nok.cmd=%d,err=%d", aCommand, err ) - } -#endif // VTDEBUG - return err; - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::ChangeApplicationFocus -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ChangeApplicationFocus( const TBool aForeground ) - { - __VTPRINTENTER( "CLcVtSession.ChangeApplicationFocus" ) - if ( iUiProvider ){ - iUiProvider->HandleForegroundStatus(aForeground); - } - __VTPRINTEXIT( "CLcVtSession.ChangeApplicationFocus" ) - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::ChangeState -// ----------------------------------------------------------------------------- -// -void CLcVtSession::ChangeState( TLcVtStateBase* aState ) - { - __VTPRINTENTER( "CLcVtSession.ChangeState" ) - iState = aState; - __VTPRINTEXIT( "CLcVtSession.ChangeState" ) - } - -#if 0 -// ----------------------------------------------------------------------------- -// CLcVtSession::StartDtmfTone -// ----------------------------------------------------------------------------- -// -void CLcVtSession::StartDtmfTone( const TChar& aTone ) - { - // should be called only through current application state - iDtmfTone = aTone; - __VTPRINT2( DEBUG_GEN, "CLcVtSession.DTMF.Start.%d", iDtmfTone() ) - if ( Execute( KVtEngStartDtmfTone, &iDtmfTone ) != KErrNone ) - { - iDtmfTone = 0; - } - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::StopDtmfTone -// ----------------------------------------------------------------------------- -// -void CLcVtSession::StopDtmfTone() - { - // should be called only through current application state - if ( iDtmfTone() ) - { - __VTPRINT( DEBUG_GEN, "CLcVtSession.DTMF.STOP" ) - (void) Execute( KVtEngStopDtmfTone, NULL ); - iDtmfTone = 0; - } - } -#endif -// ----------------------------------------------------------------------------- -// CLcVtSession::SetCallIdL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::SetCallIdL( const TInt aCallId ) - { - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::SetCallNameL -// ----------------------------------------------------------------------------- -// -TBool CLcVtSession::SetCallNameL( const TDesC& aName ) - { - HBufC* name = aName.AllocL(); - delete iRemoteDisplayName; - iRemoteDisplayName = name; - return ETrue; - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::SetCallNameL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::SetCallNumberL( const TDesC& aNumber ) - { - HBufC* number = aNumber.AllocL(); - delete iRemoteDetails; - iRemoteDetails = number; - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::StartShutdown -// ----------------------------------------------------------------------------- -// -void CLcVtSession::StartShutdown() - { - __VTPRINTENTER( "CLcVtSession.StartShutdown" ) - iSessionState = EClosing; - if ( iObserver != NULL ) - { - iObserver->StateChanged( *this ); - } - //iUiProvider->BlockUi(ETrue); - __VTPRINTEXIT( "CLcVtSession.StartShutdown" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::NumberSource -// ----------------------------------------------------------------------------- -// -TDesC* CLcVtSession::NumberSource() const - { - return NULL; - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::RefreshL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::RefreshL( const TInt aRefreshFlags ) - { - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::RefreshStatesL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::RefreshStatesL() - { - __VTPRINTENTER( "CLcVtSession.RefreshStatesL" ) - // If transaction (set of commands) is pending refresh in delayed until - // all of them are processed. - __VTPRINTEXIT( "CLcVtSession.RefreshStatesL" ) - } - -#if 0 -// ----------------------------------------------------------------------------- -// CLcVtSession::HandleLayoutChanged -// ----------------------------------------------------------------------------- -// -TInt CLcVtSession::HandleLayoutChanged() - { - __VTPRINTENTER( "CLcVtSession.HandleLayoutChanged" ) - iLayoutChangeCallback->CallBack(); - __VTPRINTEXIT( "CLcVtSession.HandleLayoutChanged" ) - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::DelayedHandleLayoutChanged -// ----------------------------------------------------------------------------- -// -TInt CLcVtSession::DelayedHandleLayoutChanged( TAny* aPtr ) - { - __VTPRINTENTER( "CLcVtSession.DelayedHandleLayoutChanged" ) - CLcVtSession* self = reinterpret_cast< CLcVtSession* > ( aPtr ); - //self->iUiStates->SetDisableBlindSetting( ETrue ); - TRAPD( err, self->HandleLayoutChangedL() ); - //self->iUiStates->SetDisableBlindSetting( EFalse ); - //self->RefreshBlind(); - __VTPRINTENTER( "CLcVtSession.DelayedHandleLayoutChanged" ) - return err; - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::HandleLayoutChangedL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::HandleLayoutChangedL() - { - __VTPRINTENTER( "CLcVtSession.LayoutChg" ) - - if ( iState ) - { - iState->HandleLayoutChangedL(); - } - - /* - if ( !iAllowVideoDlgShowed ) - { - if ( iState ) - { - iState->HandleLayoutChangedL(); - } - } - else - { - iUiStates->SetLayoutChangeNeeded( EFalse ); - DoHandleLayoutChangedL(); - } - */ - __VTPRINTEXIT( "CLcVtSession.LayoutChg" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::DoHandleLayoutChangedL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::DoHandleLayoutChangedL() - { - __VTPRINTENTER( "CLcVtSession.DoLayoutChg" ) - - // Fully update rendering parameters - UpdateRenderingParametersL(); - // Notify engine about layout change - //iLayoutChg = ETrue; - TRAPD( error, ExecuteCmdL( KVtEngHandleLayoutChange ) ); - //iLayoutChg = EFalse; - - // Not ready error is allowed to happen (e.g. when sharing) - if ( error && ( error != KErrNotReady ) ) - { - User::Leave( error ); - } - else - { - __VTPRINT( DEBUG_GEN, - "CLcVtSession.DoLayoutChg KVtEngHandleLayoutChange == KErrNotReady (ok)" ) - } - - __VTPRINTEXIT( "CLcVtSession.DoLayoutChg" ) - } -#endif - -// ----------------------------------------------------------------------------- -// CLcVtSession::UpdateRenderingParametersL -// ----------------------------------------------------------------------------- -// -#ifdef NGA_VIDEO_RENDER - -void CLcVtSession::UpdateRenderingParametersL() - { - __VTPRINTENTER( "CLcVtSession.UpdateRenderingParametersL" ) - - iRwGroup->SetOrdinalPosition( 1 , ECoeWinPriorityNormal ); - - TRect RMRect = RemoteVideoPlayer()->LcWindow()->LcWindowRect(); - iRemoteVideoWindow->SetExtent( RMRect.iTl, RMRect.Size() ); - iRemoteVideoWindow->SetOrdinalPosition( 1 , ECoeWinPriorityNeverAtFront ); - iRemoteVideoWindow->SetTransparencyAlphaChannel(); - - __VTPRINT2( DEBUG_MEDIA , " RemoteVideoPlayer.RMRect.iTl.iX: %d", RMRect.iTl.iX ) - __VTPRINT2( DEBUG_MEDIA , " RemoteVideoPlayer.RMRect.iTl.iY: %d", RMRect.iTl.iY ) - __VTPRINT2( DEBUG_MEDIA , " RemoteVideoPlayer.RMRect.iWidth: %d", RMRect.Width() ) - __VTPRINT2( DEBUG_MEDIA , " RemoteVideoPlayer.RMRect.iHeight: %d", RMRect.Height() ) - - - TRect VFRect = LocalVideoPlayer()->LcWindow()->LcWindowRect(); - iLocalVideoWindow->SetExtent( VFRect.iTl, VFRect.Size() ); - iLocalVideoWindow->SetOrdinalPosition( 1, ECoeWinPriorityNeverAtFront ); - iLocalVideoWindow->SetTransparencyAlphaChannel(); - - __VTPRINT2( DEBUG_MEDIA , " LocalVideoPlayer.VFRect.iTl.iX: %d", VFRect.iTl.iX ) - __VTPRINT2( DEBUG_MEDIA , " LocalVideoPlayer.VFRect.iTl.iY: %d", VFRect.iTl.iY ) - __VTPRINT2( DEBUG_MEDIA , " LocalVideoPlayer.VFRect.iWidth: %d", VFRect.Width() ) - __VTPRINT2( DEBUG_MEDIA , " LocalVideoPlayer.VFRect.iHeight: %d", VFRect.Height() ) - - iRwSession.Flush(); - - __VTPRINTEXIT( "CLcVtSession.UpdateRenderingParametersL" ) - - } - - -#else - -void CLcVtSession::UpdateRenderingParametersL() - { - - __VTPRINTENTER( "CLcVtSession.UpdateRenderingParametersL" ) - - MVtEngMedia& media = iModel->Media(); - const TBool viewFinderStarted = - media.RenderingStarted( MVtEngMedia::EMediaOutgoing ); - const TBool remoteRenderStarted = - media.RenderingStarted( MVtEngMedia::EMediaIncoming ); - - // Stop viewfinder & remote render. - if( viewFinderStarted ) - { - ExecuteCmdL( KVtEngStopViewFinder ); - } - ExecuteCmdL( KVtEngStopRenderRemote ); - - TRect VFRect = LocalVideoPlayer()->LcWindow()->LcWindowRect(); - TSize size (VFRect.Size()); - - TVtEngRenderingOptions configViewfinder(*iEventObserver,size); - - ExecuteCmdL( KVtEngPrepareViewFinder, configViewfinder ); - - // Prepare remote render. - TRect RMRect = RemoteVideoPlayer()->LcWindow()->LcWindowRect(); - const TSize KRMsize( RMRect.Size()); - TRect screen( KRMsize ); - TRect clip( KRMsize ); - const TPoint KRMcordinate( RMRect.iTl.iX, RMRect.iTl.iY ); - - TVtEngRenderingOptionsDP configRemoteRender(*iEventObserver, *iWsSession ,*iWsSessionScreenDev, *iMainWindow, screen, clip, KRMcordinate ); - - TRAPD ( err, ExecuteCmdL( - KVtEngPrepareRemoteRenderDP, - configRemoteRender ) ); - - if ( err != KErrNone ) - { - if ( viewFinderStarted ) - { - // Start viewfinder. - ExecuteCmdL( KVtEngStartViewFinder ); - } - User::Leave ( err ); - } - - // Start remote render. - TRAP_IGNORE( ExecuteCmdL( KVtEngStartRenderRemote ) ); - - if ( viewFinderStarted ) - { - // Start viewfinder. - ExecuteCmdL( KVtEngStartViewFinder ); - } - - __VTPRINTEXIT( "CLcVtSession.UpdateRenderingParametersL" ) - - } - -#endif - -// ----------------------------------------------------------------------------- -// CLcVtSession::HandleEngineResetL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::HandleEngineResetL() - { - __VTPRINTENTER( "CLcVtSession.HandleEngineResetL" ) - if ( iShutdownRequest ) - { - __VTPRINT( DEBUG_GEN, " CLcVtSession.HandleEngineResetL shutdown" ) - User::RequestComplete( iShutdownRequest, KErrNone ); - iShutdownRequest = NULL; - } - __VTPRINTEXIT( "CLcVtSession.HandleEngineResetL" ) - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::HandleShutdownReady -// ----------------------------------------------------------------------------- -// -void CLcVtSession::HandleShutdownReady() - { - __VTPRINTENTER( "CLcVtSession.HandleShutdownReady" ) - - if(iAsyncCallback->IsActive()) - { - iAsyncCallback->Cancel(); - } - - iAsyncCallback->Set( - TCallBack( &DoExit, this ) ); - iAsyncCallback->CallBack(); - __VTPRINTEXIT( "CLcVtSession.HandleShutdownReady" ) - } - - -// ----------------------------------------------------------------------------- -// CLcVtSession::DoExit -// ----------------------------------------------------------------------------- -// -TInt CLcVtSession::DoExit( TAny* aSession ) - { - __VTPRINTENTER( "CLcVtSession.DoExit" ) - CLcVtSession* self = static_cast< CLcVtSession* >( aSession ); - self->iAsyncCallback->Cancel(); - // Before exiting ensure there are no pending actions. - self->ActiveExecInitCancel( 0 ); - self->CloseApp(); - __VTPRINTEXIT( "CLcVtSession.DoExit" ) - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::CloseApp -// ----------------------------------------------------------------------------- -// -void CLcVtSession::CloseApp() - { - __VTPRINTENTER( "CLcVtSession.CloseApp" ) - //iUiProvider->BlockUi(EFalse); -#if 0 - if(iEventObserver) - { - delete iEventObserver; - iEventObserver = NULL; - } -#endif - iSessionState = EClosed; - iObserver->StateChanged( *this ); - __VTPRINTEXIT( "CLcVtSession.CloseApp" ) - } - -// Implementation of CLcVtSession::CEventObserver - -// ----------------------------------------------------------------------------- -// CLcVtSession::CEventObserver::CEventObserver -// ----------------------------------------------------------------------------- -// -CLcVtSession::CEventObserver::CEventObserver( CLcVtSession& aSession ) - :iSession(aSession), - iCommandObservers( KLcVtCommandObserverArrayGranularity ) - { - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::CEventObserver::ConstructL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::CEventObserver::ConstructL() - { - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::CEventObserver::NewL -// ----------------------------------------------------------------------------- -// -CLcVtSession::CEventObserver* CLcVtSession::CEventObserver::NewL( CLcVtSession& aSession ) - { - CEventObserver* self = new ( ELeave ) CEventObserver(aSession ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::CEventObserver::~CEventObserver -// ----------------------------------------------------------------------------- -// -CLcVtSession::CEventObserver::~CEventObserver() - { - iCommandObservers.Close(); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::CEventObserver::AddObserverL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::CEventObserver::AddObserverL( - MVtEngCommandObserver& aObserver ) - { - User::LeaveIfError( - iCommandObservers.Append( &aObserver ) ); - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::CEventObserver::RemoveObserver -// ----------------------------------------------------------------------------- -// -void CLcVtSession::CEventObserver::RemoveObserver( - MVtEngCommandObserver& aObserver ) - { - const TInt pos = iCommandObservers.Find( &aObserver ); - if ( pos != KErrNotFound ) - { - if ( !iInCommandPerformed ) - { - iCommandObservers.Remove( pos ); - } - else - { - iCommandObservers[ pos ] = NULL; - } - } - } - - -void CLcVtSession::CEventObserver::HandleVtEventL( TInt aEvent ) - { - __VTPRINTENTER( "CEventObserver.HandleVtEventL" ) - __VTPRINT2( DEBUG_GEN, "CEventObserver.HandleVtEventL event=%d ",aEvent ); - - /** Allow application state to handle event first. It may also deny further - * handling by indicating the event was handled */ - if ( iSession.iState && - iSession.iState->HandleVtEventL( aEvent ) - == TLcVtStateBase::EEventHandled ) - { - __VTPRINTEXITR( "CEventObserver.HandleVtEventL %d", 0 ) - return; - } - - iSession.iLcVtStates->Update(); - - iSession.iObserver->Updated(*(iSession.iLocalVideoPlayer)); - iSession.iObserver->Updated(*(iSession.iRemoteVideoPlayer)); - - __VTPRINTEXIT( "CEventObserver.HandleVtEventL" ) - } - -void CLcVtSession::CEventObserver::HandleVTCommandPerformedL( - TVtEngCommandId aCommand, - const TInt aError ) - { - __VTPRINTENTER( "CEventObserver.HandleVTCommandPerformedL" ) - __VTPRINT3( DEBUG_GEN, "CEventObserver.HandleVTCommandPerformedL cmd=%d , result=%d",aCommand, aError ); - - if ( iSession.iState && - iSession.iState->HandleVTCommandPerformedL( aCommand, aError ) == - TLcVtStateBase::EEventHandled ) - { - // state didn't allow further processing of command completion - __VTPRINTEXITR( "CEventObserver.HandleVTCommandPerformedL %d", 0 ) - return; - } - - iSession.RefreshStatesL(); - - iSession.iLcVtStates->Update(); - - const TInt count = iCommandObservers.Count(); - TInt nullPosition = KErrNotFound; - - iInCommandPerformed = ETrue; - - // iInCommandPerformed equals ETrue while inside the following loop; - // Exceptions must not be raised. - for ( TInt index = 0; index < count; index++ ) - { - MVtEngCommandObserver* obs = iCommandObservers[ index ]; - if ( obs ) - { - TRAP_IGNORE( obs->HandleVTCommandPerformedL( aCommand, aError ) ); - } - else - { - // We store only one position; eventually all NULL elements of the - // array will be removed. - nullPosition = index; - } - } - iInCommandPerformed = EFalse; - - if ( nullPosition != KErrNotFound ) - { - iCommandObservers.Remove( nullPosition ); - } - - - // Specific handling of some commands: - if ( aCommand == KVtEngResetEngine ) // Engine has been reset - { - //__ASSERT_ALWAYS( !aError, VtUiPanic::Panic( EVtUiPanicResetFailed ) ); - iSession.HandleEngineResetL(); - } - - - __VTPRINTEXITR( "CEventObserver.HandleVTCommandPerformedL %d", 1 ) - - } - -#ifndef NGA_VIDEO_RENDER -void CLcVtSession::CEventObserver::vtHandleFrameL( - TFrameType aType, - CFbsBitmap* aBitmap ) - { - iSession.vtHandleFrameL( aBitmap); - } - -void CLcVtSession::CEventObserver::vtSetFrame( - TFrameType aType, - CFbsBitmap* aBitmap ) - { - } -#endif - -TBool CLcVtSession::IsFeatureSupported( CLcEngine::TLcFeature aLcFeature ) -{ - __VTPRINT2( DEBUG_GEN, "CLcVtSession.IsFeatureSupported feature=%d", aLcFeature) - TBool flag = EFalse; - - switch ( aLcFeature ) - { - case CLcEngine::ELcSendVideoQuery: - { - //MO call: return false; MT call: return true if key = Ask first, return false if key = No or Yes. - MVtEngSessionInfo::TDirection direction; - if ( iModel->Session().GetDirection( direction ) != KErrNone ) - { - direction = MVtEngSessionInfo::EDirectionMT; - } - __VTPRINT2( DEBUG_GEN, "CLcVtSession.IsFeatureSupported direction=%d", direction ) - - if ( direction == MVtEngSessionInfo::EDirectionMT - && VideoSendingKey == KAllwaysQuery ) - { - flag = ETrue; - } - } - break; - - default: - break; - } - - // return feature not supported if not handled - return flag; -} - -// End of file - -/* - * -// ----------------------------------------------------------------------------- -// CLcVtSession::UpdateLocalVideoRenderParamL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::UpdateLocalVideoRenderParamL() - { - __VTPRINTENTER( "CLcVtSession.UpdateLocalVideoRenderParamL" ) - - if(iLcVtStates->ExecState() != TLcVtStates::EExecStateRunning ) - { - __VTPRINTEXIT( "CLcVtSession.UpdateLocalVideoRenderParamL -- not running state" ) - return; - } - - MVtEngMedia& media = Model().Media(); - const TBool viewFinderStarted = - media.RenderingStarted( MVtEngMedia::EMediaOutgoing ); - - if( viewFinderStarted ) - { - ExecuteCmdL( KVtEngStopViewFinder ); - } - - TRect VFRect = LocalVideoPlayer()->LcWindow()->LcWindowRect(); - TSize size (VFRect.Size()); - - TVtEngRenderingOptions configViewfinder(*iEventObserver,size); - - ExecuteCmdL( KVtEngPrepareViewFinder, configViewfinder ); - - if ( viewFinderStarted ) - { - // Start viewfinder. - ExecuteCmdL( KVtEngStartViewFinder ); - } - - __VTPRINTEXIT( "CLcVtSession.UpdateLocalVideoRenderParamL" ) - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::UpdateRemoteVideoRenderParamL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::UpdateRemoteVideoRenderParamL() - { - __VTPRINTENTER( "CLcVtSession.UpdateRemoteVideoRenderParamL" ) - - if(iLcVtStates->ExecState() != TLcVtStates::EExecStateRunning ) - { - __VTPRINTEXIT( "CLcVtSession.UpdateRemoteVideoRenderParamL -- not running state" ) - return; - } - - MVtEngMedia& media = Model().Media(); - const TBool remoteRenderStarted = - media.RenderingStarted( MVtEngMedia::EMediaIncoming ); - - ExecuteCmdL( KVtEngStopRenderRemote ); - - TRect RMRect = RemoteVideoPlayer()->LcWindow()->LcWindowRect(); - const TSize KRMsize( RMRect.Size()); - TRect screen( KRMsize ); - TRect clip( KRMsize ); - const TPoint KRMcordinate( RMRect.iTl.iX, RMRect.iTl.iY ); - - __VTPRINT2( DEBUG_MEDIA , " RMRect.iTl.iX: %d", RMRect.iTl.iX) - __VTPRINT2( DEBUG_MEDIA , " RMRect.iTl.iY: %d", RMRect.iTl.iY ) - __VTPRINT2( DEBUG_MEDIA , " RMRect.iWidth: %d", RMRect.Width() ) - __VTPRINT2( DEBUG_MEDIA , " RMRect.iHeight: %d", RMRect.Height() ) - - TVtEngRenderingOptionsDP configRemoteRender(*iEventObserver, *iWsSession ,*iWsSessionScreenDev, *iMainWindow, screen, clip, KRMcordinate ); - - ExecuteCmdL( - KVtEngPrepareRemoteRenderDP, - configRemoteRender ); - - TRAP_IGNORE( ExecuteCmdL( KVtEngStartRenderRemote ) ); - - __VTPRINTEXIT( "CLcVtSession.UpdateRemoteVideoRenderParamL" ) - - } - -// ----------------------------------------------------------------------------- -// CLcVtSession::LayoutChangedL -// ----------------------------------------------------------------------------- -// -void CLcVtSession::LayoutChangedL() - { - __VTPRINTENTER( "CLcVtSession.LayoutChangedL" ) - - if(iLcVtStates->ExecState() != TLcVtStates::EExecStateRunning ) - { - __VTPRINTEXIT( "CLcVtSession.LayoutChangedL -- not running state" ) - return; - } - - TRAPD( error, ExecuteCmdL( KVtEngHandleLayoutChange ) ); - - __VTPRINTEXIT( "CLcVtSession.LayoutChangedL" ) - } - - */ diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/base/dllmain.cpp --- a/vtuis/lcvtplugin/src/base/dllmain.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* ============================================================================== -* Name : dllmain.cpp -* Part of : -* Description : -* Version : -* -* Copyright ?2004 Nokia Corporation. -* This material, including documentation and any related -* computer programs, is protected by copyright controlled by -* Nokia Corporation. All rights are reserved. Copying, -* including reproducing, storing, adapting or translating, any -* or all of this material requires the prior written consent of -* Nokia Corporation. This material also contains confidential -* information which may not be disclosed to others without the -* prior written consent of Nokia Corporation. -* ============================================================================== -*/ -#include -#include -#include "clcvtengine.h" - -// Map the interface UIDs to implementation factory functions -const TImplementationProxy Implementations[] = - { - IMPLEMENTATION_PROXY_ENTRY( 0x20021342, CLcVtEngine::NewL ) - }; - -// ----------------------------------------------------------------------------- -// ImplementationGroupProxy -// -// Exported proxy for instantiation method resolution -// ----------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aCount ) - { - aCount = sizeof( Implementations ) / sizeof( TImplementationProxy ); - return Implementations; - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/common/lcvtutility.cpp --- a/vtuis/lcvtplugin/src/common/lcvtutility.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,319 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of the VtUiUtility class. -* -*/ - - - -// INCLUDE FILES -#include "lcvtutility.h" -#include -#include -#include - -// Characters to open number entry. -//_LIT( KVtUiDTMFCharacters, "0123456789*#" ); - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// LcVtUtility::GetAudioRoutingAvailability -// ----------------------------------------------------------------------------- -// -void LcVtUtility::GetAudioRoutingAvailability( - MVtEngAudio& aAudio, - TInt& aAvailable ) - { - aAvailable = 0; - //const TBool bluetoothAudioSupported = ETrue; - - MVtEngAudio::TAudioRoutingState routingState; - if ( aAudio.GetRoutingState( routingState ) == KErrNone ) - { - // Deactivate BT handsfree. - if ( /*bluetoothAudioSupported &&*/ - IsAudioRoutingAvailable( - aAudio, - routingState, - MVtEngAudio::EAudioBT, - MVtEngAudio::EAudioHandset ) ) - { - aAvailable |= EDeactivateBtHandsfree; - } - - // Activate BT handsfree. - if ( /*bluetoothAudioSupported &&*/ - ( IsAudioRoutingAvailable( - aAudio, - routingState, - MVtEngAudio::EAudioHandset, - MVtEngAudio::EAudioBT ) || - IsAudioRoutingAvailable( - aAudio, - routingState, - MVtEngAudio::EAudioLoudspeaker, - MVtEngAudio::EAudioBT ) ) ) - { - aAvailable |= EActivateBtHandsfree; - } - - // Deactivate loudspeaker - if ( IsAudioRoutingAvailable( - aAudio, - routingState, - MVtEngAudio::EAudioLoudspeaker, - MVtEngAudio::EAudioHandset ) ) - { - aAvailable |= EDeactivateLoudspeaker; - } - - // Activate loudspeaker - if ( IsAudioRoutingAvailable( - aAudio, - routingState, - MVtEngAudio::EAudioHandset, - MVtEngAudio::EAudioLoudspeaker ) || - ( /*bluetoothAudioSupported &&*/ - IsAudioRoutingAvailable( - aAudio, - routingState, - MVtEngAudio::EAudioBT, - MVtEngAudio::EAudioLoudspeaker ) ) ) - { - aAvailable |= EActivateLoudspeaker; - } - } - } - -// ----------------------------------------------------------------------------- -// LcVtUtility::GetOutgoingMediaState -// ----------------------------------------------------------------------------- -// -void LcVtUtility::GetOutgoingMediaState( - MVtEngMedia& aMedia, - TInt& aAvailable ) - { - TInt outgoingMediaState; - const TInt err = - aMedia.GetMediaState( - MVtEngMedia::EMediaOutgoing, - outgoingMediaState ); - if ( err == KErrNone ) - { - // If source is still image, then video sending is off. - MVtEngMedia::TMediaSource source; - if ( aMedia.GetSource( source ) == KErrNone ) - { - if ( source == MVtEngMedia::EMediaStillImage ) - { - outgoingMediaState &= ~MVtEngMedia::EMediaVideo; - } - } - TBool freezeSupported; - if( aMedia.GetFreezeSupported( freezeSupported ) == KErrNone ) - { - TBool isFrozen; - if( freezeSupported && aMedia.GetFreezeState( isFrozen ) == KErrNone ) - { - if( isFrozen ) - { - outgoingMediaState &= ~MVtEngMedia::EMediaVideo; - } - } - } - } - else - { - outgoingMediaState = - ( MVtEngMedia::EMediaAudio | MVtEngMedia::EMediaVideo ); - } - aAvailable = outgoingMediaState; - } - -// ----------------------------------------------------------------------------- -// LcVtUtility::GetIncomingMediaState -// ----------------------------------------------------------------------------- -// -void LcVtUtility::GetIncomingMediaState( - MVtEngMedia& aMedia, - TInt& aAvailable ) - { - TInt mediaState; - const TInt err = - aMedia.GetMediaState( - MVtEngMedia::EMediaIncoming, - mediaState ); - if ( err != KErrNone ) - { - mediaState = - ( MVtEngMedia::EMediaAudio | MVtEngMedia::EMediaVideo ); - } - - aAvailable = mediaState; - } - -// ----------------------------------------------------------------------------- -// LcVtUtility::HasStillImage -// ----------------------------------------------------------------------------- -// -TBool LcVtUtility::HasStillImage( - MVtEngMedia& aMedia ) - { - TInt caps; - const TInt capsErr = aMedia.GetSourcesCaps( caps ); - return ( capsErr == KErrNone ) && - ( caps & MVtEngMedia::ESourceCapsStillImage ); - } - -// ----------------------------------------------------------------------------- -// LcVtUtility::GetFreezeState -// ----------------------------------------------------------------------------- -// -TBool LcVtUtility::GetFreezeState( - MVtEngMedia& aMedia ) - { - TBool isFrozen; - const TInt err = aMedia.GetFreezeState( isFrozen ); - if ( err == KErrNone ) - { - return isFrozen; - } - else //provider was not ready - { - return EFalse; - } - } - -// ----------------------------------------------------------------------------- -// LcVtUtility::IsFreezeSupported -// ----------------------------------------------------------------------------- -// -TBool LcVtUtility::IsFreezeSupported( - MVtEngMedia& aMedia ) - { - TBool isFreezeSupported; - const TInt err = aMedia.GetFreezeSupported( isFreezeSupported ); - if ( err == KErrNone ) - { - return isFreezeSupported; - } - else //provider was not ready - { - return EFalse; - } - } - -// ----------------------------------------------------------------------------- -// LcVtUtility::GetVideoQuality -// ----------------------------------------------------------------------------- -// -void LcVtUtility::GetVideoQuality( - MVtEngMedia& aMedia, - MVtEngMedia::TVideoQuality& aVideoQuality ) - { - aMedia.GetVideoQuality( aVideoQuality ); - } - -// ----------------------------------------------------------------------------- -// LcVtUtility::GetObjectSharingState -// ----------------------------------------------------------------------------- -// -void LcVtUtility::GetObjectSharingState( - MVtEngMedia& aMedia, - MVtEngMedia::TShareObjectState& aShareObjectState ) - { - aMedia.GetObjectSharingState( aShareObjectState ); - } - - -// ----------------------------------------------------------------------------- -// LcVtUtility::IsZoomAllowed -// ----------------------------------------------------------------------------- -// -TBool LcVtUtility::IsZoomAllowed( - MVtEngMedia& aMedia ) - { - TBool result = EFalse; - - TInt currentStep; - if ( aMedia.GetCurrentZoomStep( currentStep ) == KErrNone ) - { - TInt max; - if ( aMedia.GetMaxZoomStep( max ) == KErrNone ) - { - // Zooming is allowed if maximum zoom step is greater than - // zero and camera is in use (and not still image / none). - TInt avail; - GetOutgoingMediaState( aMedia, avail ); - - result = ( max > 0 ) && ( avail & MVtEngMedia::EMediaVideo ); - } - } - - __VTPRINT2( DEBUG_GEN, "Ui.AllowZoom.%d", result ) - return result; - } - -// ----------------------------------------------------------------------------- -// LcVtUtility::HasCameras -// ----------------------------------------------------------------------------- -// -TBool LcVtUtility::HasCameras( MVtEngMedia& aMedia ) - { - TInt sourceCaps; - if ( aMedia.GetSourcesCaps( sourceCaps ) != KErrNone ) - { - sourceCaps = 0; - } - return ( sourceCaps & MVtEngMedia::ESourceCapsPrimaryCamera ) || - ( sourceCaps & MVtEngMedia::ESourceCapsSecondaryCamera ); - } - -// ----------------------------------------------------------------------------- -// LcVtUtility::IsAudioRoutingAvailable -// ----------------------------------------------------------------------------- -// -TBool LcVtUtility::IsAudioRoutingAvailable( - MVtEngAudio& aAudio, - const MVtEngAudio::TAudioRoutingState aCurrent, - const MVtEngAudio::TAudioRoutingState aSource, - const MVtEngAudio::TAudioRoutingState aTarget ) - { - TBool result = EFalse; - if ( aCurrent == aSource ) - { - TBool available = EFalse; - TInt err = aAudio.GetRoutingAvailability( aTarget, available ); - - result = ( ( err == KErrNone ) && ( available ) ); - } - - return result; - } - -// ----------------------------------------------------------------------------- -// LcVtUtility::IsDTMFCharacter -// ----------------------------------------------------------------------------- -// -TBool LcVtUtility::IsDTMFCharacter( const TChar aChar ) - { - return EFalse; - /* - return - ( KVtUiDTMFCharacters().Locate( aChar ) != KErrNotFound ); - */ - } - -// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/common/tlcvtaudiostate.cpp --- a/vtuis/lcvtplugin/src/common/tlcvtaudiostate.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2008 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: Audio state class. -* -*/ - - -#include - -#include "tlcvtaudiostate.h" -#include "lcvtutility.h" - -// ----------------------------------------------------------------------------- -// TLcVtAudioState::UpdateFlags -// ----------------------------------------------------------------------------- -// -void TLcVtAudioState::UpdateFlags() - { - TInt avail( 0 ); - - LcVtUtility::GetAudioRoutingAvailability( iModel.Audio(), avail ); - - const TBool videoCallConnected ( iModel.Media().VideoCallConnected()); - //Before update AudioRouting, video call state must to be checked. - //AudioRouting can not be changed if call is not in EConnected state. - if ( videoCallConnected ) - { - if ( avail & LcVtUtility::EDeactivateBtHandsfree ) - { - SetFlag( ECanDeactivateBtHf ); - } - if ( avail & LcVtUtility::EActivateBtHandsfree ) - { - SetFlag( ECanActivateBtHf ); - } - if ( avail & LcVtUtility::EDeactivateLoudspeaker ) - { - SetFlag( ECanDeactivateLoudspeaker ); - } - if ( avail & LcVtUtility::EActivateLoudspeaker ) - { - SetFlag( ECanActivateLoudspeaker ); - } - } - - LcVtUtility::GetOutgoingMediaState( iModel.Media(), avail ); - - if ( avail & MVtEngMedia::EMediaAudio ) - { - SetFlag( EIsAudio ); - } - - TInt status ( 0 ); - iModel.Media().GetMediaState( MVtEngMedia::EMediaOutgoing, status ); - if ( !(status & MVtEngMedia::EMediaAudioChannelOpen ) ) - { - SetFlag( EIsAudioPermanentlyStopped ); - } - - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/common/tlcvtmediastate.cpp --- a/vtuis/lcvtplugin/src/common/tlcvtmediastate.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* Copyright (c) 2008 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: Media state class. -* -*/ - - -#include -#include -#include - -#include "tlcvtmediastate.h" -#include "lcvtutility.h" - -// ----------------------------------------------------------------------------- -// TLcVtMediaState::UpdateFlags -// ----------------------------------------------------------------------------- -// -void TLcVtMediaState::UpdateFlags() - { - __VTPRINTENTER( "MediaState.UpdateFlags" ) - TInt avail( 0 ); - - LcVtUtility::GetOutgoingMediaState( iMedia, avail ); - - if ( avail & MVtEngMedia::EMediaVideo ) - { - SetFlag( EIsVideo ); - } - - if ( LcVtUtility::HasCameras( iMedia ) ) - { - SetFlag( EHasCamera ); - } - - if ( LcVtUtility::IsFreezeSupported( iMedia ) ) - { - SetFlag( EIsFreezeSupported ); - } - - if ( LcVtUtility::GetFreezeState( iMedia ) ) - { - SetFlag( EIsFrozen ); - } - - MVtEngMedia::TShareObjectState shareObjectState; - LcVtUtility::GetObjectSharingState( iMedia, shareObjectState ); - - if ( shareObjectState == MVtEngMedia::ESharingImage ) - { - SetFlag( EIsSharing ); - } - else if ( ( shareObjectState == MVtEngMedia::EInitializingShareImage ) || - ( shareObjectState == MVtEngMedia::EInitializingShareVideoClip ) ) - { - SetFlag( EIsInitializingShare ); - } - else if ( shareObjectState == MVtEngMedia::ENotAbleToShare ) - { - SetFlag( EIsNotAbleToShare ); - } - // Camera configuration - - MVtEngMedia::TCameraId cameraId; - TInt err = iMedia.GetCurrentCameraId( cameraId ); - - // Don't care if camera is not ready, just what is selected camera - if ( err == KErrNone || err == KErrNotReady ) - { - SetFlag( ( cameraId == MVtEngMedia::EPrimaryCamera ) ? - EIsPrimaryCameraInUse : EIsSecondaryCameraInUse ); - } - - TInt sourcesCaps( 0 ); - iMedia.GetSourcesCaps( sourcesCaps ); - if ( sourcesCaps & MVtEngMedia::ESourceCapsPrimaryCamera ) - { - SetFlag( EHasPrimaryCamera ); - } - if ( sourcesCaps & MVtEngMedia::ESourceCapsSecondaryCamera ) - { - SetFlag( EHasSecondaryCamera ); - } - - TInt status ( 0 ); - iMedia.GetMediaState( MVtEngMedia::EMediaOutgoing, status ); - if ( !( status & MVtEngMedia::EMediaVideoChannelOpen ) ) - { - SetFlag( EIsVideoPermanentlyStopped ); - } - - __VTPRINTEXITR( "MediaState.UpdateFlags bits = %b", Value() ) - - // Video preferences -/* - TInt caps( iCommandHandler.GetCommandCaps( KVtEngSetContrast ) ); - if ( caps & MVtEngCommandHandler::EAttribEnabled ) - { - SetFlag( EIsContrastSupported ); - } - - caps = iCommandHandler.GetCommandCaps( KVtEngSetBrightness ); - if ( caps & MVtEngCommandHandler::EAttribEnabled ) - { - SetFlag( EIsBrightnessSupported ); - } - - caps = iCommandHandler.GetCommandCaps( KVtEngSetWhiteBalance ); - if ( caps & MVtEngCommandHandler::EAttribEnabled ) - { - SetFlag( EIsWhiteBalanceSupported ); - } - - caps = iCommandHandler.GetCommandCaps( KVtEngSetColorTone ); - if ( caps & MVtEngCommandHandler::EAttribEnabled ) - { - SetFlag( EIsColorToneSupported ); - } - -*/ - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/common/tlcvtstates.cpp --- a/vtuis/lcvtplugin/src/common/tlcvtstates.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* Copyright (c) 2008 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: Video UI states class. -* -*/ - - -#include -#include -#include - -#include "tlcvtstates.h" - -// ----------------------------------------------------------------------------- -// TLcVtStates::TLcVtStates -// ----------------------------------------------------------------------------- -// -TLcVtStates::TLcVtStates( CVtEngModel& aModel ) - : iMediaState( aModel.Media(), aModel.CommandHandler() ), iAudioState( aModel ), - iModel( aModel ), iExecState( EExecStateStarting) - { - // get camera preferences - iCameraPref = static_cast - ( iModel.Extension( KVtEngExtensionCameraPreferences ) ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::Update -// ----------------------------------------------------------------------------- -// -void TLcVtStates::Update() - { - __VTPRINTENTER( "TLcVtStates.Update" ) - iMediaState.Update(); - iAudioState.Update(); - __VTPRINTEXIT( "TLcVtStates.Update" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsColorToneSettingAvailable -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsColorToneSettingAvailable() const - { - __VTPRINTENTER( "TLcVtStates.IsColorToneSettingAvailable" ) - TUint32 supportedModes; - // Get supported whitebalance modes - if ( iCameraPref ) - { - if ( iCameraPref->GetSupportedColorTones( supportedModes ) ) - { - // error occured - __VTPRINTEXIT( "TLcVtStates.IsColorToneSettingAvailableErr" ) - return EFalse; - } - } - - // Clean the flag, flags that are possible are - // A bitfield of suported colortones - // ENormal = 0x00, - // ESepia = 0x01, - // EGrayscale = 0x02, - // ENegative = 0x04 - supportedModes &= 0x07; - - // If supported modes is 0 automatic,then return EFalse - __VTPRINTEXIT( "TLcVtStates.IsColorToneSettingAvailable" ) - return supportedModes; - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsWhiteBalanceSettingAvailable -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsWhiteBalanceSettingAvailable() const - { - __VTPRINTENTER( "TLcVtStates.IsWhiteBalanceSettingAvailable" ) - TUint32 supportedModes; - // Get supported whitebalance modes - if ( iCameraPref ) - { - if ( iCameraPref->GetSupportedWhiteBalanceModes( supportedModes ) ) - { - // error occured - __VTPRINTEXIT( "TLcVtStates.IsWhiteBalanceSettingAvailableErr" ) - return EFalse; - } - } - __VTPRINT2( DEBUG_GEN, "IsWhiteBalanceSettingAvailable=%d", supportedModes ) - // If supported modes is 0 ,then return EFalse - __VTPRINTEXIT( "TLcVtStates.IsWhiteBalanceSettingAvailable2" ) - return supportedModes; - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsContrastSettingAvailable -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsContrastSettingAvailable() const - { - __VTPRINTENTER( "TLcVtStates.IsContrastSettingAvailable" ) - TBool ret( ETrue ); - if ( iCameraPref ) - { - TInt temp; - ret = !iCameraPref->GetContrast( temp ); - } - return ret; - } - -// ----------------------------------------------------------------------------- -// TLcVtStates::IsBrightnessSettingAvailable -// ----------------------------------------------------------------------------- -// -TBool TLcVtStates::IsBrightnessSettingAvailable() const - { - __VTPRINTENTER( "TLcVtStates.IsBrightnessSettingAvailable" ) - TBool ret( ETrue ); - if ( iCameraPref ) - { - TInt temp; - ret = !iCameraPref->GetBrightness( temp ); - } - return ret; - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/control/clcvtlocalvideoplayer.cpp --- a/vtuis/lcvtplugin/src/control/clcvtlocalvideoplayer.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* -* Copyright (c) 2008 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: LiveComm Videotelephony's Local Video Player -* -*/ - -#include "clcvtlocalvideoplayer.h" -#include "tlcvtcamerahandler.h" -#include "lcvtplugincommand.h" - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// - -CLcVtLocalVideoPlayer* CLcVtLocalVideoPlayer::NewL( - CLcVtSession* avtSession, - MLcAudioControl& aLcAudioControl, - TVtCameraHandler& aCameraHandler) - { - CLcVtLocalVideoPlayer* self = - new( ELeave )CLcVtLocalVideoPlayer( - avtSession, - aLcAudioControl, - aCameraHandler); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CLcVtLocalVideoPlayer::CLcVtLocalVideoPlayer( - CLcVtSession* avtSession, - MLcAudioControl& aLcAudioControl, - TVtCameraHandler& aCameraHandler) : - CLcVtVideoPlayerBase( avtSession, aLcAudioControl ), - iCameraHandler( aCameraHandler ) - { - iOrientationChanged = EFalse; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CLcVtLocalVideoPlayer::ConstructL() - { - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CLcVtLocalVideoPlayer::~CLcVtLocalVideoPlayer() - { - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -MLcVideoPlayer::TLcVideoPlayerState -CLcVtLocalVideoPlayer::LcVideoPlayerState() const - { - TLcVideoPlayerState playerState; - if ( ivtSession->LcVtStates().MediaState().IsVideo() ) - { - playerState = MLcVideoPlayer::EPlaying; - } - else - { - playerState = MLcVideoPlayer::EPaused; - } - __VTPRINT2( DEBUG_GEN, "CLcVtLocalVideoPlayer.LcVideoPlayerState = %d", playerState ) - return playerState; - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -TBool CLcVtLocalVideoPlayer::LcIsPlayingL() - { - TBool result = (LcVideoPlayerState() == MLcVideoPlayer::EPlaying); - __VTPRINT2( DEBUG_GEN, "CLcVtLocalVideoPlayer.LcIsPlayingL = %d", result ) - return result; - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -void CLcVtLocalVideoPlayer::LcPlayL(TLcVideoPlayerSource /*aSource*/) - { - __VTPRINT( DEBUG_GEN, "CLcVtLocalVideoPlayer.LcPlayL" ) - ivtSession->HandleCommandL(EPluginCmdEnableVideo); - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -void CLcVtLocalVideoPlayer::LcPauseL() - { - __VTPRINT( DEBUG_GEN, "CLcVtLocalVideoPlayer.LcPauseL" ) - ivtSession->HandleCommandL(EPluginCmdDisableVideo); - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -MLcCameraControl* CLcVtLocalVideoPlayer::LcCameraControl() - { - return &iCameraHandler; - } - - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -MLcZoomControl* CLcVtLocalVideoPlayer::LcZoomControl() - { - return &iCameraHandler; - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -MLcBrightnessControl* CLcVtLocalVideoPlayer::LcBrightnessControl() - { - return &iCameraHandler; - } - -// ----------------------------------------------------------------------------- -// From MLcWindow -// ----------------------------------------------------------------------------- -// -void CLcVtLocalVideoPlayer::SetLcWindowRectL( TRect aRect ) - { - __VTPRINT2( DEBUG_MEDIA , " LocalVideoPlayer.RMRect.iTl.iX: %d", aRect.iTl.iX ) - __VTPRINT2( DEBUG_MEDIA , " LocalVideoPlayer.RMRect.iTl.iY: %d", aRect.iTl.iY ) - __VTPRINT2( DEBUG_MEDIA , " LocalVideoPlayer.RMRect.iWidth: %d", aRect.Width() ) - __VTPRINT2( DEBUG_MEDIA , " LocalVideoPlayer.RMRect.iHeight: %d", aRect.Height() ) - - CLcVtVideoPlayerBase::SetLcWindowRectL( aRect ); - } - -// ----------------------------------------------------------------------------- -// From MLcWindow -// ----------------------------------------------------------------------------- -// -void CLcVtLocalVideoPlayer::SetLcWindowOrientationL( TLcWindowOrientation aOrientation ) - { - __VTPRINT2( DEBUG_MEDIA , "CLcVtLocalVideoPlayer.SetLcWindowOrientationL: %d", aOrientation ) - iOrientationChanged = EFalse; - if( aOrientation != iWindowOrientation ) - iOrientationChanged = ETrue; - CLcVtVideoPlayerBase::SetLcWindowOrientationL( aOrientation ); - } - -TBool CLcVtLocalVideoPlayer::IsOrientationChanged() - { - return iOrientationChanged; - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/control/clcvtremotevideoplayer.cpp --- a/vtuis/lcvtplugin/src/control/clcvtremotevideoplayer.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2008 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: LiveComm Videotelephony's Remte Video Player -* -*/ - -#include "clcvtremotevideoplayer.h" -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CLcVtRemoteVideoPlayer* CLcVtRemoteVideoPlayer::NewL( - CLcVtSession* avtSession, - MLcAudioControl& aLcAudioControl ) - { - CLcVtRemoteVideoPlayer* self = - new( ELeave ) CLcVtRemoteVideoPlayer( avtSession, aLcAudioControl ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CLcVtRemoteVideoPlayer::CLcVtRemoteVideoPlayer( - CLcVtSession* avtSession, - MLcAudioControl& aLcAudioControl ) : - CLcVtVideoPlayerBase( avtSession, aLcAudioControl ) - { - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CLcVtRemoteVideoPlayer::ConstructL() - { - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CLcVtRemoteVideoPlayer::~CLcVtRemoteVideoPlayer() - { - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -MLcVideoPlayer::TLcVideoPlayerState -CLcVtRemoteVideoPlayer::LcVideoPlayerState() const - { - TLcVideoPlayerState playerState = MLcVideoPlayer::EPlaying; - return playerState; - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -TBool CLcVtRemoteVideoPlayer::LcIsPlayingL() - { - return ETrue; - } - -// ----------------------------------------------------------------------------- -// From MLcWindow -// ----------------------------------------------------------------------------- -// -void CLcVtRemoteVideoPlayer::SetLcWindowRectL( TRect aRect ) - { - __VTPRINT2( DEBUG_MEDIA , " RemoteVideoPlayer.RMRect.iTl.iX: %d", aRect.iTl.iX ) - __VTPRINT2( DEBUG_MEDIA , " RemoteVideoPlayer.RMRect.iTl.iY: %d", aRect.iTl.iY ) - __VTPRINT2( DEBUG_MEDIA , " RemoteVideoPlayer.RMRect.iWidth: %d", aRect.Width() ) - __VTPRINT2( DEBUG_MEDIA , " RemoteVideoPlayer.RMRect.iHeight: %d", aRect.Height() ) - - CLcVtVideoPlayerBase::SetLcWindowRectL( aRect ); - } - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/control/clcvtvideoplayerbase.cpp --- a/vtuis/lcvtplugin/src/control/clcvtvideoplayerbase.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* -* Copyright (c) 2008 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: LiveComm Videotelephony's Video Player Base Class -* -*/ - -#include "clcvtvideoplayerbase.h" -#include "clcvtsession.h" - - -CLcVtVideoPlayerBase::CLcVtVideoPlayerBase( - CLcVtSession* avtSession, - MLcAudioControl& aLcAudioControl ) : - ivtSession( avtSession ), - iLcAudioControl( aLcAudioControl ) - { - iIsWindowEnabled = ETrue; - iWindowOrientation = MLcWindow::EPortrait; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CLcVtVideoPlayerBase::~CLcVtVideoPlayerBase() - { - } - - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -#if 0 -MLcVideoPlayer::TLcVideoPlayerState -CLcVtVideoPlayerBase::LcVideoPlayerState() const - { - return MLcVideoPlayer::EUnavailable; - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -TBool CLcVtVideoPlayerBase::LcIsPlayingL() - { - return EFalse; - } -#endif -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -void CLcVtVideoPlayerBase::LcPlayL( TLcVideoPlayerSource /*aSource*/ ) - { - // NOP - __VTPRINT( DEBUG_GEN, "CLcVtVideoPlayerBase.LcPlayL" ) - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -void CLcVtVideoPlayerBase::LcPauseL() - { - // NOP - __VTPRINT( DEBUG_GEN, "CLcVtVideoPlayerBase.LcPauseL" ) - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -MLcWindow* CLcVtVideoPlayerBase::LcWindow() - { - return this; - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -MLcCameraControl* CLcVtVideoPlayerBase::LcCameraControl() - { - return NULL; - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -MLcSourceFileControl* CLcVtVideoPlayerBase::LcSourceFileControl() - { - return NULL; - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -MLcDestinationFileControl* CLcVtVideoPlayerBase::LcDestinationFileControl() - { - return NULL; - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -MLcAudioControl* CLcVtVideoPlayerBase::LcAudioControl() - { - return &iLcAudioControl; - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -MLcZoomControl* CLcVtVideoPlayerBase::LcZoomControl() - { - return NULL; - } - -// ----------------------------------------------------------------------------- -// From MLcVideoPlayer -// ----------------------------------------------------------------------------- -// -MLcBrightnessControl* CLcVtVideoPlayerBase::LcBrightnessControl() - { - return NULL; - } - -// ----------------------------------------------------------------------------- -// From MLcWindow -// ----------------------------------------------------------------------------- -// -void CLcVtVideoPlayerBase::EnableLcWindowL( TBool aEnable ) - { - iIsWindowEnabled = aEnable; - } - -// ----------------------------------------------------------------------------- -// From MLcWindow -// ----------------------------------------------------------------------------- -// -TBool CLcVtVideoPlayerBase::IsLcWindowEnabled() - { - return iIsWindowEnabled; - } - -// ----------------------------------------------------------------------------- -// From MLcWindow -// ----------------------------------------------------------------------------- -// -void CLcVtVideoPlayerBase::SetLcWindowRectL( TRect aRect ) - { - iWindowRect = aRect; - } - - -// ----------------------------------------------------------------------------- -// From MLcWindow -// ----------------------------------------------------------------------------- -// -TRect CLcVtVideoPlayerBase::LcWindowRect() - { - return iWindowRect; - } - -// ----------------------------------------------------------------------------- -// From MLcWindow -// ----------------------------------------------------------------------------- -// -void CLcVtVideoPlayerBase::SetLcWindowOrientationL( - TLcWindowOrientation aOrientation ) - { - iWindowOrientation = aOrientation; - } - -// ----------------------------------------------------------------------------- -// From MLcWindow -// ----------------------------------------------------------------------------- -// -MLcWindow::TLcWindowOrientation CLcVtVideoPlayerBase::LcWindowOrientationL() - { - return iWindowOrientation; - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/control/tlcvtcamerahandler.cpp --- a/vtuis/lcvtplugin/src/control/tlcvtcamerahandler.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ -/* -* Copyright (c) 2008 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: LiveComm Videotelephony's Camera Handler -* -*/ - - -#include "tlcvtcamerahandler.h" -#include "clcvtsession.h" -#include "tlcvtstates.h" -#include "lcvtplugincommand.h" -#include "lcvtutility.h" -#include "cvtengmodel.h" - - -TVtCameraHandler::TVtCameraHandler() : -ivtSession( NULL ) - { - } - -// ----------------------------------------------------------------------------- -// From MLcCameraControl -// ----------------------------------------------------------------------------- -// -TInt TVtCameraHandler::LcCameraCountL() - { - return 2; - } - -// ----------------------------------------------------------------------------- -// From MLcCameraControl -// ----------------------------------------------------------------------------- -// -TInt TVtCameraHandler::CurrentLcCameraIndex() - { - if(ivtSession->LcVtStates().MediaState().IsPrimaryCameraInUse()) - return EFrontCamera; - - return EBackCamera; - } - -// ----------------------------------------------------------------------------- -// From MLcCameraControl -// ----------------------------------------------------------------------------- -// -void TVtCameraHandler::ToggleLcCameraL() - { - if(ivtSession->LcVtStates().MediaState().IsPrimaryCameraInUse()) - ivtSession->HandleCommandL(EPluginCmdUseSecondaryCamera); - else - ivtSession->HandleCommandL(EPluginCmdUsePrimaryCamera); - } - -// ----------------------------------------------------------------------------- -// From MLcBrightnessControl -// ----------------------------------------------------------------------------- -// -TInt TVtCameraHandler::MinLcBrightnessL() - { - return 0; - } - -// ----------------------------------------------------------------------------- -// From MLcBrightnessControl -// ----------------------------------------------------------------------------- -// -TInt TVtCameraHandler::MaxLcBrightnessL() - { - return 0; - } - -// ----------------------------------------------------------------------------- -// From MLcBrightnessControl -// ----------------------------------------------------------------------------- -// -TInt TVtCameraHandler::LcBrightnessL() - { - return 0; - } - -// ----------------------------------------------------------------------------- -// From MLcBrightnessControl -// ----------------------------------------------------------------------------- -// -void TVtCameraHandler::SetLcBrightnessL( TInt aValue ) - { - } - -// ----------------------------------------------------------------------------- -// From MLcBrightnessControl -// ----------------------------------------------------------------------------- -// -void TVtCameraHandler::IncreaseLcBrightnessL() - { - } - -// ----------------------------------------------------------------------------- -// From MLcBrightnessControl -// ----------------------------------------------------------------------------- -// -void TVtCameraHandler::DecreaseLcBrightnessL() - { - } - -// ----------------------------------------------------------------------------- -// From MLcZoomControl -// ----------------------------------------------------------------------------- -// -TInt TVtCameraHandler::MinLcZoomL() - { - return 0; - } - -// ----------------------------------------------------------------------------- -// From MLcZoomControl -// ----------------------------------------------------------------------------- -// -TInt TVtCameraHandler::MaxLcZoomL() - { - MVtEngMedia& media = ivtSession->Model().Media(); - - if(!LcVtUtility::IsZoomAllowed(media)) - { - __VTPRINT( DEBUG_GEN, "TVtCameraHandler.MaxLcZoomL ZoomNotAllow" ) - return 0; - } - - TInt max( 0 ); - const TInt error( media.GetMaxZoomStep( max ) ); - max = ( error ? 0 : max ); - - __VTPRINT2( DEBUG_GEN, "TVtCameraHandler.MaxLcZoomL value=%d", max ) - - return max; - } - -// ----------------------------------------------------------------------------- -// From MLcZoomControl -// ----------------------------------------------------------------------------- -// -TInt TVtCameraHandler::LcZoomValueL() - { - MVtEngMedia& media = ivtSession->Model().Media(); - - if(!LcVtUtility::IsZoomAllowed(media)) - { - __VTPRINT( DEBUG_GEN, "TVtCameraHandler.LcZoomValueL ZoomNotAllow" ) - return 0; - } - - TInt current( 0 ); - const TInt error( media.GetCurrentZoomStep( current ) ); - current = ( error ? 0 : current ); - __VTPRINT2( DEBUG_GEN, "TVtCameraHandler.LcZoomValueL value=%d", 0 ) - return current; - } - -// ----------------------------------------------------------------------------- -// From MLcZoomControl -// ----------------------------------------------------------------------------- -// -void TVtCameraHandler::SetLcZoomValueL( TInt aValue ) - { - MVtEngMedia& media = ivtSession->Model().Media(); - - if(!LcVtUtility::IsZoomAllowed(media)) - { - __VTPRINT( DEBUG_GEN, "TVtCameraHandler.SetLcZoomValueL ZoomNotAllow" ) - return; - } - - if( aValue < 0 || aValue > MaxLcZoomL() ) - { - __VTPRINT( DEBUG_GEN, "TVtCameraHandler.SetLcZoomValueL - Invalidate value" ) - return; - } - - __VTPRINT2( DEBUG_GEN, "TVtCameraHandler.SetLcZoomValueL Call SetZoomFactorL(%d)" , aValue ); - ivtSession->SetZoomFactorL( aValue ); - - } - -// ----------------------------------------------------------------------------- -// From MLcZoomControl -// ----------------------------------------------------------------------------- -// -void TVtCameraHandler::LcZoomInL() - { - MVtEngMedia& media = ivtSession->Model().Media(); - - if(!LcVtUtility::IsZoomAllowed(media)) - { - __VTPRINT( DEBUG_GEN, "TVtCameraHandler.LcZoomInL ZoomNotAllow" ) - return; - } - - __VTPRINT( DEBUG_GEN, "TVtCameraHandler.LcZoomInL Call SetLcZoomValueL" ) - SetLcZoomValueL(LcZoomValueL() + 1); - } - -// ----------------------------------------------------------------------------- -// From MLcZoomControl -// ----------------------------------------------------------------------------- -// -void TVtCameraHandler::LcZoomOutL() - { - MVtEngMedia& media = ivtSession->Model().Media(); - - if(!LcVtUtility::IsZoomAllowed(media)) - { - __VTPRINT( DEBUG_GEN, "TVtCameraHandler.LcZoomOutL ZoomNotAllow" ) - return; - } - - __VTPRINT( DEBUG_GEN, "TVtCameraHandler.LcZoomOutL Call SetLcZoomValueL" ) - SetLcZoomValueL(LcZoomValueL() - 1); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void TVtCameraHandler::SetSession( CLcVtSession* aSession ) - { - ivtSession = aSession; - } - - diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/states/tlcvtstatebase.cpp --- a/vtuis/lcvtplugin/src/states/tlcvtstatebase.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,382 +0,0 @@ -/* -* Copyright (c) 2008 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: base class for lc vt plugin states -* -*/ - - -#include "tlcvtstatebase.h" -#include "tlcvtstates.h" -#include "tlcvtpluginstates.h" -#include "clcvtappshutter.h" -#include "mlcvtstatecontext.h" -#include -#include -#include -#include -#include - -// By default call ending command is allowed to send to call handling. - -// Initially no shutdown request -TBool TLcVtStateBase::iShutdownRequested = EFalse; - -// ----------------------------------------------------------------------------- -// c++ constructor -// ----------------------------------------------------------------------------- -// -TLcVtStateBase::TLcVtStateBase( - MLcVtStateContext& aCtx, - TLcVtStates& aUiStates ) : iCtx(aCtx), iUiStates( aUiStates ) - { - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -TLcVtStateBase::~TLcVtStateBase() - { - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::LcVtStartupPhase1DoneL -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::LcVtStartupPhase1DoneL() - { - // no default behavior - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::LcVtStartupPhase2DoneL -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::LcVtStartupPhase2DoneL() - { - // no default behavior - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::ShutdownDoneL -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::ShutdownDoneL() - { - // no default behavior - } -#if 0 -// ----------------------------------------------------------------------------- -// TLcVtStateBase::HandleForegroundChangedL -// ----------------------------------------------------------------------------- -// -TBool TLcVtStateBase::HandleForegroundChangedL( - const TBool /*aIsForegroung*/ ) - { - // no default behavior - return EFalse; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::PreHandleForegroundChangedL -// ----------------------------------------------------------------------------- -// -TBool TLcVtStateBase::PreHandleForegroundChangedL( - const TBool /*aIsForegroung*/ ) - { - // no default behavior - return EFalse; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::StartDtmfTone -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::StartDtmfTone( const TChar& /*aTone*/ ) - { - // no default behavior - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::StopDtmfTone -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::StopDtmfTone() - { - // no default behavior - } -#endif - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::SetInitialStateL -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::SetInitialStateL( - MLcVtStateContext& aCtx, - TLcVtStates& aUiStates ) - { - __VTPRINTENTER( "TLcVtStateBase.SetInitialState" ) - TLcVtStateBase* initialState = - TLcVtStateStarting::InstanceL( aCtx, aUiStates ); - aCtx.ChangeState( initialState ); - initialState->OpenL(); - __VTPRINTEXIT( "TLcVtStateBase.SetInitialState" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::LcVtStartupFailedL -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::LcVtStartupFailedL() - { - __VTPRINTENTER( "TLcVtStateBase.AppUiStartupFailedL" ) - // Shutdown - ChangeStateL( *TLcVtStateResetting::InstanceL( iCtx, iUiStates ) ); - __VTPRINTEXIT( "TLcVtStateBase.AppUiStartupFailedL" ) - } -#if 0 -// ----------------------------------------------------------------------------- -// TLcVtStateBase::OpenL -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::OpenL() - { - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::Close -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::Close() - { - } -#endif - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::ChangeStateL -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::ChangeStateL( TLcVtStateBase& aNewState ) - { - __VTPRINTENTER( "TLcVtStateBase.ChangeStateL" ) - - // Check for transition to already active state. - TLcVtStateBase* state = &aNewState; - if ( state == this ) - { - __VTPRINTEXITR( "TLcVtStateBase.ChangeStateL %d", 0 ) - return; - } - const TVtEngCommandId pending = - iCtx.Model().CommandHandler().PendingCommand(); - if ( pending != KVtEngCommandNone && - state == TLcVtStateResetting::InstanceL( iCtx, iUiStates ) ) - { - // delay shutdown until engine command completes - __VTPRINT2( DEBUG_GEN, "TLcVtStateBase.ChangeStateL, pengind command is: %d", pending ); - TLcVtStateBase::iShutdownRequested = ETrue; - - if ( pending == KVtEngInitializeShareImage ) - { - iCtx.Model().CommandHandler().CancelCommand( pending ); - } - - __VTPRINTEXITR( "TLcVtStateBase.ChangeStateL %d", KErrNotReady ) - return; - } - __VTPRINT( DEBUG_GEN, - " TLcVtStateBase.ChangeStateL !! STATE TRANSITION !!" ) - iCtx.ChangeState( &aNewState ); - Close(); - // perform entry action for new state - aNewState.OpenL(); - __VTPRINTEXITR( "TLcVtStateBase.ChangeStateL %d", 1 ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::CleanupResetPushL -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::CleanupResetPushL() - { - // Shutdown if leave occurs in critical ops. - CleanupStack::PushL( - TCleanupItem( TransitionToReset, this ) ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::TransitionToReset -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::TransitionToReset( TAny* aAny ) - { - TLcVtStateBase* state = reinterpret_cast< TLcVtStateBase* >( aAny ); - TRAP_IGNORE( state->ChangeStateL( *TLcVtStateResetting::InstanceL( - state->iCtx, state->iUiStates ) ) ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::HandleVTCommandPerformedL -// ----------------------------------------------------------------------------- -// -TLcVtStateBase::TEventResponse TLcVtStateBase::HandleVTCommandPerformedL( - TVtEngCommandId /*aCommand*/, - const TInt /*aError*/ ) - { - __VTPRINTENTER( "TLcVtStateBase.HandleVTCommandPerformedL" ) - // By default all UI is allowed to handle all command completions. - TEventResponse handled = EEventNotHandled; - - // check if shutdown requested while command was pending - const TVtEngCommandId pending = iCtx.Model().CommandHandler().PendingCommand(); - if ( pending == KVtEngCommandNone && - TLcVtStateBase::iShutdownRequested ) - { - __VTPRINT( DEBUG_GEN, "Handling delayed shutdown" ); - ChangeStateL( *TLcVtStateResetting::InstanceL( - iCtx, iUiStates ) ); - } - __VTPRINTEXIT( "TLcVtStateBase.HandleVTCommandPerformedL" ) - return handled; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::HandleVtEventL -// ----------------------------------------------------------------------------- -// -TLcVtStateBase::TEventResponse TLcVtStateBase::HandleVtEventL( - const TInt aEvent ) - { - __VTPRINTENTER( "TLcVtStateBase.HandleVtEventL" ) - TEventResponse handled = EEventHandled; - switch ( aEvent ) - { - case KVtEngDeviceLockOn: - case KVtEngDeviceLockOff: - HandleDeviceLockEventL( aEvent == KVtEngDeviceLockOn ); - break; - case KVtEngRemoteDisconnect: - /** Don't allow sending of end active call command to call handling - * because requesting disconnect from the network after NW originated - * termination violates standards. - */ - break; - default: - handled = EEventNotHandled; - break; - } - __VTPRINTEXIT( "TLcVtStateBase.HandleVtEventL" ) - return handled; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::HandleCommandL -// ----------------------------------------------------------------------------- -// -TLcVtStateBase::TEventResponse TLcVtStateBase::HandleCommandL( - const TInt /*aCommand*/ ) - { - __VTPRINTENTER( "TLcVtStateBase.HandleCommandL" ) - TEventResponse handled = EEventNotHandled; - __VTPRINTEXITR( "TLcVtStateBase.HandleCommandL %d", handled ) - return handled; - } -#if 0 -// ----------------------------------------------------------------------------- -// TLcVtStateBase::HandleLayoutChangedL -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::HandleLayoutChangedL( ) - { - __VTPRINTENTER( "TLcVtStateBase.HandleLayoutChangedL" ) - // By default only indicate that layout change needs to be handled. - iUiStates.SetLayoutChangeNeeded( ETrue ); - __VTPRINTEXIT( "TLcVtStateBase.HandleLayoutChangedL" ) - } -#endif -// ----------------------------------------------------------------------------- -// TLcVtStateBase::HandleShutdownReady -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::HandleShutdownReady() - { - __VTPRINTENTER( "TLcVtStateBase.HandleShutdownReady" ) - // forwarded to AppUi which handles UI framework exit - iCtx.HandleShutdownReady(); - iCtx.ChangeState( NULL ); - // deletes current state - Close(); - __VTPRINTEXIT( "TLcVtStateBase.HandleShutdownReady" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::HandleDeviceLockEventL -// -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::HandleDeviceLockEventL( const TBool aDeviceIsLocked ) - { - __VTPRINTENTER( "TLcVtStateBase.HandleDeviceLockEventL" ) - iUiStates.SetDeviceLockOn( aDeviceIsLocked ); - if ( aDeviceIsLocked ) - { - iCtx.ChangeApplicationFocus( EFalse ); - } - __VTPRINTEXITR( "TLcVtStateBase.HandleDeviceLockEventL lock state=%d", - aDeviceIsLocked ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::CheckEndActiveCallL -// ----------------------------------------------------------------------------- -// -TBool TLcVtStateBase::CheckEndActiveCallL() - { - __VTPRINTENTER( "TLcVtStateBase.CheckEndActiveCallL" ) - const MVtEngSessionInfo::TSessionState state = SessionState( EFalse ); - TBool shutdownStarted( EFalse ); - if ( state == MVtEngSessionInfo::EIdle ) - { - __VTPRINT( DEBUG_GEN, "VtUi.Release bearer" ) - // h.245 session is ended - ChangeStateL( *TLcVtStateResetting::InstanceL( iCtx, iUiStates ) ); - shutdownStarted = ETrue; - } - __VTPRINTEXITR( "TLcVtStateBase.CheckEndActiveCallL %d", - shutdownStarted ) - return shutdownStarted; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::SessionState -// ----------------------------------------------------------------------------- -// -MVtEngSessionInfo::TSessionState TLcVtStateBase::SessionState( - const TBool aUpdate ) const - { - const CVtEngModel& model = iCtx.Model(); - const MVtEngSessionInfo& session = model.Session(); - return session.State( aUpdate ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStateBase::SetExecState -// ----------------------------------------------------------------------------- -// -void TLcVtStateBase::SetExecState( const TLcVtStates::TLcVtExecState aState ) - { - __VTPRINTENTER( "TLcVtStateBase.SetExecState" ) - iUiStates.SetExecState( aState ); - __VTPRINTEXITR( "TLcVtStateBase.SetExecState %d", aState ) - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/states/tlcvtstateresetting.cpp --- a/vtuis/lcvtplugin/src/states/tlcvtstateresetting.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,254 +0,0 @@ -/* -* Copyright (c) 2008 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: waiting details application state -* -*/ - - -#include "tlcvtstates.h" -#include "tlcvtpluginstates.h" -#include "mlcvtstatecontext.h" -#include "clcvtappshutter.h" -#include -#include - -TLcVtStateResetting* TLcVtStateResetting::iInstance = NULL; - -// c++ constructor -TLcVtStateResetting::TLcVtStateResetting( - MLcVtStateContext& aCtx, - TLcVtStates& aUiStates, - const TVtEngCommandId aCommand ) - : TLcVtStateBase( aCtx, aUiStates ), - iCommand( aCommand ) - { - __VTPRINT2( DEBUG_GEN, "TLcVtStateResetting.ctr iCommand=%d", iCommand ) - iCtx.StartShutdown(); - } - -// Destructor -TLcVtStateResetting::~TLcVtStateResetting() - { - } - -// ----------------------------------------------------------------------------- -// TLcVtStateResetting:: -// ----------------------------------------------------------------------------- -// -TLcVtStateResetting* TLcVtStateResetting::InstanceL( - MLcVtStateContext& aCtx, - TLcVtStates& aUiStates, - const TVtEngCommandId aCommand ) - { - __VTPRINTENTER( "TLcVtStateResetting.InstanceL" ) - if ( iInstance == NULL ) - { - iInstance = new ( ELeave ) TLcVtStateResetting( - aCtx, aUiStates, aCommand ); - } - else if ( aCommand != KVtEngCommandNone ) - { // if call ending is UI originated, command is given - iInstance->iCommand = aCommand; - __VTPRINT2( DEBUG_GEN, "TLcVtStateResetting.InstanceL iCommand=%d", - iInstance->iCommand ) - } - __VTPRINTEXIT( "TLcVtStateResetting.InstanceL" ) - return iInstance; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateResetting::ShutdownDoneL -// AppUi has finished its own shutdown steps. Notify app shutter that it may -// proceed. -// -// ----------------------------------------------------------------------------- -// -void TLcVtStateResetting::ShutdownDoneL() - { - __VTPRINTENTER( "TLcVtStateResetting.ShutdownDone" ) - CLcVtAppShutter* shutter = CLcVtAppShutter::InstanceL( *this ); - shutter->StartShutdown(); - __VTPRINTEXIT( "TLcVtStateResetting.ShutdownDone" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateResetting::AppUiStartupFailedL -// ----------------------------------------------------------------------------- -// -void TLcVtStateResetting::LcVtStartupFailedL() - { - __VTPRINTENTER( "TLcVtStateResetting.LcVtStartupFailedL" ) - // no-op (overrides default behavior) - __VTPRINTEXIT( "TLcVtStateResetting.LcVtStartupFailedL" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateResetting::HandleVTCommandPerformedL -// ----------------------------------------------------------------------------- -// -TLcVtStateBase::TEventResponse TLcVtStateResetting::HandleVTCommandPerformedL - ( - TVtEngCommandId aCommand, - const TInt /*aError*/ ) - { - __VTPRINTENTER( "TLcVtStateResetting.HandleVTCommandPerformedL" ) - // By default responses to commands are ignored while resetting - TEventResponse handled = EEventHandled; - switch ( aCommand ) - { - case KVtEngResetEngine: - // Allow UI to process reset command response - handled = EEventNotHandled; - break; - case KVtEngTerminateSession: - case KVtEngSwitchToVoice: - // - handled = EEventNotHandled; - iCtx.ShutdownL(); - break; - default: - break; - } - __VTPRINTEXIT( "TLcVtStateResetting.HandleVTCommandPerformedL" ) - return handled; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateResetting::HandleVtEventL -// ----------------------------------------------------------------------------- -// -TLcVtStateBase::TEventResponse TLcVtStateResetting::HandleVtEventL( - const TInt aEvent ) - { - __VTPRINTENTER( "TLcVtStateResetting.HandleVtEventL" ) - TEventResponse handled = EEventHandled; - switch ( aEvent ) - { - // While resetting appUi should not handle these events. - case KVtEngSourceChanged: - case KVtEngCameraChanged: - case KVtEngSourceCapsChanged: - case KVtEngSessionStateChanged: - case KVtEngDurationSettingChanged: - case KVtEngAudioOutputVolumeChanged: - case KVtEngAudioRoutingAvailabilityChanged: - case KVtEngAudioRoutingChanged: - case KVtEngAudioMuted: - case KVtEngAudioUnmuted: - case KVtEngRemoteVideoStopped: - case KVtEngSessionWaitingCallActive: - case KVtEngSessionWaitingCallInactive: - break; - default: - // allow appUi to handle other events - handled = EEventNotHandled; - break; - } - __VTPRINTEXIT( "TLcVtStateResetting.HandleVtEventL" ) - return handled; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateResetting::HandleCommandL -// ----------------------------------------------------------------------------- -// -TLcVtStateBase::TEventResponse TLcVtStateResetting::HandleCommandL( - const TInt /*aCommand*/ ) - { - __VTPRINTENTER( "TLcVtStateResetting.HandleCommandL" ) - /* All commands ignored while resetting. CAknAppUi::Exit() is called - when shutdown is completed with asistance of CVtUiAppShutter */ - __VTPRINTEXIT( "TLcVtStateResetting.HandleCommandL" ) - return EEventHandled; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateResetting::HandleForegroundChangedL -// ----------------------------------------------------------------------------- -// -TBool TLcVtStateResetting::HandleForegroundChangedL( - const TBool /*aIsForeground*/ ) - { - __VTPRINTENTER( "TLcVtStateResetting.HandleForegroundChangedL" ) - __VTPRINTEXIT( "TLcVtStateResetting.HandleForegroundChangedL" ) - // not on "foreground" while resetting - return EFalse; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateResetting::PreHandleForegroundChangedL -// ----------------------------------------------------------------------------- -// -TBool TLcVtStateResetting::PreHandleForegroundChangedL( - const TBool /*aIsForegroung*/ ) - { - // no default behavior - return EFalse; - } - -#if 0 -// ----------------------------------------------------------------------------- -// TLcVtStateResetting::HandleLayoutChangedL -// ----------------------------------------------------------------------------- -// -void TLcVtStateResetting::HandleLayoutChangedL() - { - __VTPRINTENTER( "TLcVtStateResetting.HandleLayoutChangedL" ) - // no-op (overrides default behavior) - __VTPRINTEXIT( "TLcVtStateResetting.HandleLayoutChangedL" ) - } -#endif -// ----------------------------------------------------------------------------- -// TLcVtStateResetting::OpenL -// ----------------------------------------------------------------------------- -// -void TLcVtStateResetting::OpenL() - { - __VTPRINTENTER( "TLcVtStateResetting.OpenL" ) - SetExecState( TLcVtStates::EExecStateResetting ); - //iCtx.StopDtmfTone(); - iCtx.ChangeApplicationFocus( EFalse ); - - if ( iCommand != KVtEngCommandNone ) - { - // Command is either KVtEngTerminateSession or KVtEngSwitchToVoice - // Need to wait for callback before ShutdownL can be called on context. - iCtx.DoExecuteCmdL( iCommand, NULL ); - } - else - { - // This branch is executed when resetting state is opened due - // to emergency call or state change to one causing shutdown. - // No need to wait for any callbacks (emergency call callback - // handled by CVtUiAppShutter). - iCtx.ShutdownL(); - } - __VTPRINTEXIT( "TLcVtStateResetting.OpenL" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateResetting::Close -// ----------------------------------------------------------------------------- -// -void TLcVtStateResetting::Close() - { - __VTPRINTENTER( "TLcVtStateResetting.Close" ) - SetExecState( TLcVtStates::EExecStateFinalized ); - if ( TLcVtStateResetting::iInstance ) - { - delete TLcVtStateResetting::iInstance; - TLcVtStateResetting::iInstance = NULL; - } - __VTPRINTEXIT( "TLcVtStateResetting.Close" ) - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/states/tlcvtstaterunning.cpp --- a/vtuis/lcvtplugin/src/states/tlcvtstaterunning.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,291 +0,0 @@ -/* -* Copyright (c) 2008 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: running (normal operation) application state -* -*/ - - -#include "tlcvtstates.h" -#include "tlcvtpluginstates.h" -#include "mlcvtstatecontext.h" -#include "clcvtappshutter.h" -#include -#include -#include -#include "lcvtplugincommand.h" - -TLcVtStateRunning* TLcVtStateRunning::iInstance = NULL; - -// c++ constructor -TLcVtStateRunning::TLcVtStateRunning( - MLcVtStateContext& aCtx, TLcVtStates& aUiStates ) - : TLcVtStateBase( aCtx, aUiStates ) - { - } - -// Destructor -TLcVtStateRunning::~TLcVtStateRunning() - { - } - -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::InstanceL -// ----------------------------------------------------------------------------- -// -TLcVtStateRunning * TLcVtStateRunning::InstanceL( - MLcVtStateContext& aCtx, - TLcVtStates& aUiStates ) - { - __VTPRINTENTER( "TLcVtStateRunning.InstanceL" ) - if ( iInstance == NULL ) - iInstance = new ( ELeave ) TLcVtStateRunning( aCtx, aUiStates ); - __VTPRINTEXIT( "TLcVtStateRunning.InstanceL" ) - return iInstance; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::HandleVtEventL -// ----------------------------------------------------------------------------- -// -TLcVtStateBase::TEventResponse TLcVtStateRunning::HandleVtEventL( - const TInt aEvent ) - { - __VTPRINTENTER( "TLcVtStateRunning.HandleVtEventL" ) - // let TVtUiAppStateBase base class do common tasks - TEventResponse handled = TLcVtStateBase::HandleVtEventL( aEvent ); - switch ( aEvent ) - { - case KVtEngDeviceLockOn: - case KVtEngDeviceLockOff: - TLcVtStateBase::HandleVtEventL( aEvent ); - if ( aEvent == KVtEngDeviceLockOff ) - { - iCtx.ChangeApplicationFocus( ETrue ); - } - break; - case KVtEngSessionStateChanged: - if ( CheckEndActiveCallL() ) - { - // At this point shutdown is in progress. Don't allow - // appUi to do actions due to this event. - handled = EEventHandled; - } - break; - default: - break; - } - __VTPRINTEXIT( "TLcVtStateRunning.HandleVtEventL" ) - return handled; - } - - -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::HandleCommandL -// ----------------------------------------------------------------------------- -// -TLcVtStateBase::TEventResponse TLcVtStateRunning::HandleCommandL( - const TInt aCommand ) - { - __VTPRINTENTER( "TLcVtStateRunning.HandleCommandL" ) - /** By default all commands are enabled by running state. - * Other details command validations are done elsewhere - */ - TEventResponse handled = EEventHandled; - - switch ( aCommand ) - { - case EPluginCmdEndActiveCall: - ShutdownWithEngineCommandL( KVtEngTerminateSession ); - break; - case EPluginCmdCreateVoice: - CreateVoiceCallL(); - break; - case EPluginCmdDialEmergency: - // Attempt emergency call. Note that emergency number check is done - // after calling DialEmergencyCallL and if supplied number is not - // emergency leave occurs. - TRAP_IGNORE( DialEmergencyCallL() ); - break; - default: - handled = TLcVtStateBase::HandleCommandL( aCommand ); - break; - } - - __VTPRINTEXITR( "TLcVtStateRunning.HandleCommandL %d", handled ) - return handled; - } - - -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::HandleForegroundChangedL -// ----------------------------------------------------------------------------- -// -TBool TLcVtStateRunning::HandleForegroundChangedL( const TBool aIsForeground ) - { - __VTPRINTENTER( "TLcVtStateRunning.HandleForegroundChangedL" ) - - iCtx.RefreshL( MLcVtStateContext::ENaviPane ); - - TBool handleAsForeground( aIsForeground ); - TPtrC8 params( reinterpret_cast< TUint8* >( &handleAsForeground ), - sizeof( TBool ) ); - iCtx.DoExecuteCmdL( KVtEngSetUIForeground, ¶ms ); - __VTPRINTEXIT( "TLcVtStateRunning.HandleForegroundChangedL" ) - return handleAsForeground; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::PreHandleForegroundChangedL -// ----------------------------------------------------------------------------- -// -TBool TLcVtStateRunning::PreHandleForegroundChangedL( const TBool aIsForeground ) - { - __VTPRINTENTER( "TLcVtStateRunning.PreHandleForegroundChangedL" ) - TBool handleAsForeground( aIsForeground ); - TPtrC8 params( reinterpret_cast< TUint8* >( &handleAsForeground ), sizeof( TBool ) ); - iCtx.DoExecuteCmdL( KVtEngSetUIForeground, ¶ms ); - __VTPRINTEXIT( "TLcVtStateRunning.PreHandleForegroundChangedL" ) - return handleAsForeground; - } -#if 0 -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::HandleLayoutChangedL -// ----------------------------------------------------------------------------- -// -void TLcVtStateRunning::HandleLayoutChangedL( ) - { - __VTPRINTENTER( "TLcVtStateRunning.HandleLayoutChangedL" ) - iUiStates.SetLayoutChangeNeeded( EFalse ); - iCtx.DoHandleLayoutChangedL(); - __VTPRINTEXIT( "TLcVtStateRunning.HandleLayoutChangedL" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::StartDtmfTone -// ----------------------------------------------------------------------------- -// -void TLcVtStateRunning::StartDtmfTone( const TChar& aTone ) - { - iCtx.StartDtmfTone( aTone ); - } - -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::StopDtmfTone -// ----------------------------------------------------------------------------- -// -void TLcVtStateRunning::StopDtmfTone() - { - iCtx.StopDtmfTone(); - } -#endif -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::CreateVoiceCallL -// ----------------------------------------------------------------------------- -// -void TLcVtStateRunning::CreateVoiceCallL() - { - __VTPRINTENTER( "TLcVtStateRunning.CreateVoiceCallL" ) - - //TInt result( KErrNone ); - /* - HBufC* prompt = - StringLoader::LoadLC( R_VIDEOTELUI_QTN_QUERY_CREATE_VOICE_CALL ); - - // Create and initialize query dialog - CAknQueryDialog* createVoiceCallDlg = CAknQueryDialog::NewL(); - CleanupStack::PushL( createVoiceCallDlg ); - createVoiceCallDlg->SetPromptL( *prompt ); - CleanupStack::Pop(); // createVoiceCallDlg - - iCreateVoiceCallDlg = createVoiceCallDlg; - TInt result( KErrNone ); - TRAPD( error, result = iCreateVoiceCallDlg->ExecuteLD( - R_VIDEOTELUI_CREATE_VOICE_QUERY ) ); - // Just set to NULL because ExecuteLD() deletes instance - iCreateVoiceCallDlg = NULL; - // Leave if ExecuteLD() left - User::LeaveIfError( error ); - CleanupStack::PopAndDestroy( ); // prompt - if ( result ) - { - //user answered yes - iCtx.DoExecuteCmdL( KVtEngSwitchToVoice, NULL ); - } - */ - __VTPRINTEXITR( "TLcVtStateRunning.CreateVoiceCallL %d", KErrNone ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::ShutdownWithEngineCommandL -// Starts shutdown with command to engine. -// ----------------------------------------------------------------------------- -// -void TLcVtStateRunning::ShutdownWithEngineCommandL( const TInt aCommand ) - { - __VTPRINTENTER( - "TLcVtStateRunning.ShutdownWithEngineCommandL" ) - TLcVtStateBase* resetState = - TLcVtStateResetting::InstanceL( iCtx, iUiStates, aCommand ); - CLcVtAppShutter* shutter = CLcVtAppShutter::InstanceL( *resetState ); - - // open resetting state, handles engine command request/reply - ChangeStateL( *resetState ); - - __VTPRINTEXIT( "TLcVtStateRunning.ShutdownWithEngineCommandL" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::DialEmergencyCallL -// ----------------------------------------------------------------------------- -// -void TLcVtStateRunning::DialEmergencyCallL() - { - __VTPRINTENTER( - "TLcVtStateRunning.DialEmergencyCallL" ) - TLcVtStateBase* resetState = - TLcVtStateResetting::InstanceL( iCtx, iUiStates ); - CLcVtAppShutter* shutter = CLcVtAppShutter::InstanceL( *resetState ); - if ( shutter ) - { - // Make emergency call and proceed when 1) state has given permission - // and 2) callback from emergency call api is received - shutter->ShutdownWithEmergencyCallL( iCtx ); - ChangeStateL( *resetState ); - } - __VTPRINTEXIT( "TLcVtStateRunning.DialEmergencyCallL" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::OpenL -// ----------------------------------------------------------------------------- -// -void TLcVtStateRunning::OpenL() - { - __VTPRINTENTER( "TLcVtStateRunning.OpenL" ) - SetExecState( TLcVtStates::EExecStateRunning ); - iCtx.RefreshStatesL(); - __VTPRINTEXIT( "TLcVtStateRunning.OpenL" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateRunning::Close -// ----------------------------------------------------------------------------- -// -void TLcVtStateRunning::Close() - { - __VTPRINTENTER( "TLcVtStateRunning.Close" ) - delete TLcVtStateRunning::iInstance; - TLcVtStateRunning::iInstance = NULL; - __VTPRINTEXIT( "TLcVtStateRunning.Close" ) - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/lcvtplugin/src/states/tlcvtstatestarting.cpp --- a/vtuis/lcvtplugin/src/states/tlcvtstatestarting.cpp Tue Aug 31 15:16:10 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,317 +0,0 @@ -/* -* Copyright (c) 2008 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: waiting details application state -* -*/ - - -#include "tlcvtstates.h" -#include "tlcvtpluginstates.h" -#include "mlcvtstatecontext.h" -#include "clcvtappshutter.h" -#include -#include -#include -#include -#include - - -TLcVtStateStarting* TLcVtStateStarting::iInstance = NULL; - -// c++ constructor -TLcVtStateStarting::TLcVtStateStarting( - MLcVtStateContext& aCtx, TLcVtStates& aUiStates ) - : TLcVtStateBase( aCtx, aUiStates ) - { - iPreconditions.Set( EWaitingCLI ); - iPreconditions.Set( EWaitingPhase1ToComplete ); - iStartCallback = NULL; - } - -// Destructor - TLcVtStateStarting::~TLcVtStateStarting() - { - delete iStartCallback; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::InstanceL -// -// ----------------------------------------------------------------------------- -// -TLcVtStateStarting * TLcVtStateStarting::InstanceL( - MLcVtStateContext& aCtx, TLcVtStates& aUiStates ) - { - __VTPRINTENTER( "TLcVtStateStarting.InstanceL" ) - if ( iInstance == NULL ) - { - iInstance = new ( ELeave ) TLcVtStateStarting( aCtx, aUiStates ); - } - __VTPRINTEXIT( "TLcVtStateStarting.InstanceL" ) - return iInstance; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::LcVtStartupPhase1DoneL -// -// Phase 1 of application startup is completed, check if we can proceed to -// phase 2. -// ----------------------------------------------------------------------------- -// -void TLcVtStateStarting::LcVtStartupPhase1DoneL() - { - __VTPRINTENTER( "TLcVtStateStarting.LcVtStartupPhase1DoneL" ) - // From startup phase point of view we're ready to proceed - // to phase 2. Clear that precondition and proceed if otherwise ready. - CheckPhase2StartupL( EWaitingPhase1ToComplete ); - __VTPRINTEXIT( "TLcVtStateStarting.LcVtStartupPhase1DoneL" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::LcVtStartupPhase2DoneL -// -// ----------------------------------------------------------------------------- -// -void TLcVtStateStarting::LcVtStartupPhase2DoneL() - { - __VTPRINTENTER( "TLcVtStateStarting.LcVtStartupPhase2DoneL" ) - // Phase 2 completed, proceed to next state - ChangeStateL( *TLcVtStateRunning::InstanceL( iCtx, iUiStates ) ); - __VTPRINTEXIT( "TLcVtStateStarting.LcVtStartupPhase2DoneL" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::HandleVtEventL -// -// ----------------------------------------------------------------------------- -// -TLcVtStateBase::TEventResponse TLcVtStateStarting::HandleVtEventL( - const TInt aEvent ) - { - __VTPRINTENTER( "TLcVtStateStarting.HandleVtEventL" ) - TEventResponse handled = EEventHandled; - switch ( aEvent ) - { - case KVtEngRemoteDisconnect: - // base class handles this. - handled = TLcVtStateBase::HandleVtEventL( aEvent ); - break; - case KVtEngSessionStateChanged: - { - // check if session state is proper for proceeding to next phase - // in startup. - CheckSessionStateL(); - } - break; - case KVtEngRemoteVideoStarted: - // allow to start remote video rendering - case KVtEngSourceChanged: - // allow handling of source changed event - handled = EEventNotHandled; - break; - case KVtEngCLIAvailable: - HandleCLIReceivedL(); - break; - - case KVtEngDeviceLockOn: - case KVtEngDeviceLockOff: - default: - handled = TLcVtStateBase::HandleVtEventL( aEvent ); - break; - } - __VTPRINTEXIT( "TLcVtStateStarting.HandleVtEventL" ) - return handled; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::HandleCommandL -// -// ----------------------------------------------------------------------------- -// -TLcVtStateBase::TEventResponse TLcVtStateStarting::HandleCommandL( - const TInt /*aCommand*/ ) - { - __VTPRINTENTER( "TLcVtStateStarting.HandleCommandL" ) - __VTPRINTEXIT( "TLcVtStateStarting.HandleCommandL" ) - //return EEventNotHandled; - return EEventHandled; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::HandleForegroundChangedL -// -// ----------------------------------------------------------------------------- -// -TBool TLcVtStateStarting::HandleForegroundChangedL( const TBool aIsForeground ) - { - __VTPRINTENTER( "TLcVtStateStarting.HandleForegroundChangedL" ) - - iCtx.RefreshL( MLcVtStateContext::ENaviPane ); - - // behave as in background if CLI (=details) has not yet received - TBool handleAsForeground( aIsForeground && iUiStates.IsDetailsReceived() ); - TLcVtStateBase::ExecuteEngineCommand( KVtEngSetUIForeground, - handleAsForeground ); - - __VTPRINTEXIT( "TLcVtStateStarting.HandleForegroundChangedL" ) - return handleAsForeground; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::PreHandleForegroundChangedL -// ----------------------------------------------------------------------------- -// -TBool TLcVtStateStarting::PreHandleForegroundChangedL( - const TBool /*aIsForegroung*/ ) - { - // no default behavior - return EFalse; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::OpenL -// ----------------------------------------------------------------------------- -// -void TLcVtStateStarting::OpenL() - { - __VTPRINTENTER( "TLcVtStateStarting.OpenL" ) - iStartCallback = new ( ELeave ) CAsyncCallBack ( - TCallBack( &AsynchOpen, this ), - CActive::EPriorityStandard ); - iStartCallback->CallBack(); - __VTPRINTEXIT( "TLcVtStateStarting.OpenL" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::AsynchOpen -// asynchronous entry to the state. -// ----------------------------------------------------------------------------- -// -TInt TLcVtStateStarting::AsynchOpen( TAny* aAny ) - { - __VTPRINTENTER( "TLcVtStateStarting.AsynchOpen" ) - TLcVtStateStarting* state = reinterpret_cast( aAny ); - delete state->iStartCallback; - state->iStartCallback = NULL; - TRAPD( res, state->DoOpenL() ); - __VTPRINTEXITR( "TLcVtStateStarting.AsynchOpen err=%d", res ) - return res; - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::DoOpenL -// ----------------------------------------------------------------------------- -// -void TLcVtStateStarting::DoOpenL() - { - __VTPRINTENTER( "TLcVtStateStarting.DoOpenL" ) - if ( !CheckEndActiveCallL() ) - { - // not shutting down, proceed to phase 1 - iCtx.StartupPhase1L(); - } - __VTPRINTEXIT( "TLcVtStateStarting.DoOpenL" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::CheckSessionStateL -// Resolve action based on session state change in the engine. -// ----------------------------------------------------------------------------- -// -void TLcVtStateStarting::CheckSessionStateL() - { - __VTPRINTENTER( "TLcVtStateStarting.CheckSessionStateL" ) - const MVtEngSessionInfo::TSessionState state = SessionState( EFalse ); - switch ( state ) - { - case MVtEngSessionInfo::EConnected: - case MVtEngSessionInfo::ENegotiating: - case MVtEngSessionInfo::EOpen: - // From session state point of view we're ready to proceed. - // Clear precondition and proceed if otherwise ready. - CheckPhase2StartupL( EWaitingSessionState ); - break; - default: - // Is session state such that we need to shutdown? - CheckEndActiveCallL(); - break; - } - __VTPRINTEXIT( "TLcVtStateStarting.CheckSessionStateL" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::CheckPhase2StartupL -// -// mark precondition passed and if no more preconditions exist proceed -// in startup. -// ----------------------------------------------------------------------------- -// -void TLcVtStateStarting::CheckPhase2StartupL( - const TPreconditions aCond ) - { - __VTPRINTENTER( "TLcVtStateStarting.CheckPhase2StartupL" ) - // First check that at least one precondition holds - if ( iPreconditions.Value() ) - { - iPreconditions.Clear( aCond ); - if ( !iPreconditions.Value() ) - { - CleanupResetPushL(); // start shutdown if StartupPhase2L leaves - iCtx.StartupPhase2L(); - CleanupStack::Pop(); // CleanupResetPushL - } - } -#ifdef VTDEBUG - else { - __VTPRINT( DEBUG_GEN, "TLcVtStateStarting.CheckPhase2StartupL NoOp!" ) - } -#endif // VTDEBUG - __VTPRINTEXITR( "TLcVtStateStarting.CheckPhase2StartupL cond=%d", - (TInt) iPreconditions.Value() ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::HandleCLIReceivedL -// CLI reception from engine is one of the two preconditions for proceeding -// to phase2 startup. -// ----------------------------------------------------------------------------- -// -void TLcVtStateStarting::HandleCLIReceivedL() - { - __VTPRINTENTER( "TLcVtStateStarting.HandleCLIReceivedL" ) - const MVtEngSessionInfo& session = iCtx.Model().Session(); - MVtEngSessionInfo::TCLI cli; - if ( session.GetCLI( cli ) == KErrNone ) - { - iUiStates.SetDetailsReceived( ETrue ); - iUiStates.SetCLIReceived( cli.iVoiceCallPossible ); - iCtx.SetCallIdL( cli.iCallId ); - iCtx.SetCallNameL( cli.iName ); - iCtx.SetCallNumberL( cli.iCallNumber ); - } - CheckPhase2StartupL( EWaitingCLI ); - __VTPRINTEXIT( "TLcVtStateStarting.HandleCLIReceivedL" ) - } - -// ----------------------------------------------------------------------------- -// TLcVtStateStarting::Close -// ----------------------------------------------------------------------------- -// -void TLcVtStateStarting::Close() - { - __VTPRINTENTER( "TLcVtStateStarting.Close" ) - delete TLcVtStateStarting::iInstance; - TLcVtStateStarting::iInstance = NULL; - __VTPRINTEXIT( "TLcVtStateStarting.Close" ) - } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/aif/videoteluiaif.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/aif/videoteluiaif.rss Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2004 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: AIF resource for Video Telephone. +* +*/ + + + +// INCLUDES +#include + + +// RESOURCE DEFINITIONS + +// ----------------------------------------------------------------------------- +// +// AIF_DATA +// Resource for AIF. +// +// ----------------------------------------------------------------------------- +// +RESOURCE AIF_DATA + { + app_uid = 0x101F8681; + num_icons = 1; + hidden = KAppIsHidden; + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/cenrep/keys_s60videotelephony.xls Binary file vtuis/videotelui/cenrep/keys_s60videotelephony.xls has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/conf/s60videotelephony.confml Binary file vtuis/videotelui/conf/s60videotelephony.confml has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/conf/s60videotelephony_102072D0.crml Binary file vtuis/videotelui/conf/s60videotelephony_102072D0.crml has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/conf/s60videotelephony_10281872.crml Binary file vtuis/videotelui/conf/s60videotelephony_10281872.crml has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/data/VtStartRecord.wav Binary file vtuis/videotelui/data/VtStartRecord.wav has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/data/VtStopRecord.wav Binary file vtuis/videotelui/data/VtStopRecord.wav has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/data/videotelui.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/data/videotelui.rss Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,1932 @@ +/* +* Copyright (c) 2004, 2005 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: Resources for Video Telephone application. +* +*/ + + + +// RESOURCE IDENTIFIER +NAME VTUI + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "videotelui.hrh" + + +#include + +// CONSTANTS +#define KVtStartSoundFile "z:\\system\\sounds\\digital\\VtStartRecord.wav" +#define KVtStopSoundFile "z:\\system\\sounds\\digital\\VtStopRecord.wav" +// RESOURCE DEFINITIONS + +// ----------------------------------------------------------------------------- +// +// Resource file signature. +// +// ----------------------------------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// ----------------------------------------------------------------------------- +// +// Default name of the document. No such document, so empty. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF + { + buf = ""; + } + +// ----------------------------------------------------------------------------- +// +// Application information. +// +// ----------------------------------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + status_pane = r_videotelui_status_pane; + menubar = r_videotelui_menubar; + cba = r_videotelui_softkeys_end_call; + custom_app_info_extension = r_videotelui_info_extension; + } +// ----------------------------------------------------------------------------- +// +// Info extension +// r_videotelui_info_extension +// +// ----------------------------------------------------------------------------- +// +RESOURCE EIK_APP_INFO_EXT r_videotelui_info_extension + { + popup_toolbar = r_videotelui_fixed _toolbar; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_localisable_app_info +// Captions for this application. +// +// ----------------------------------------------------------------------------- +// +RESOURCE LOCALISABLE_APP_INFO r_videotelui_localisable_app_info + { + short_caption = qtn_apps_videophone_grid; + caption_and_icon = + CAPTION_AND_ICON_INFO + { + caption = qtn_apps_videophone_grid; +#ifdef __SCALABLE_ICONS + number_of_icons = 1; + + + icon_file = + "Z:"APP_BITMAP_DIR"\\videotelui_aif.mif"; +#else + number_of_icons = 1; + icon_file = + "Z:"APP_BITMAP_DIR"\\videotelui_aif.mbm"; + + +#endif // __SCALABLE_ICONS + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_status_pane +// Status pane for the application. +// +// ----------------------------------------------------------------------------- +// +RESOURCE STATUS_PANE_APP_MODEL r_videotelui_status_pane + { + layout = R_AVKON_STATUS_PANE_LAYOUT_USUAL; + panes = + { + SPANE_PANE + { + id = EEikStatusPaneUidTitle; + type = EAknCtTitlePane; + resource = r_videotelui_title_pane; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_menubar +// Menubar for the application. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_BAR r_videotelui_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_videotelui_menu; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_ok_menubar +// Menubar for the application. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_BAR r_videotelui_ok_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_videotelui_ok_menu; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_menu +// Options menu for the application. This menu is opened when Options softkey +// is pressed. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_videotelui_menu + { + items = + { + MENU_ITEM // Enable + { + command = EVtUiCmdEnableMain; + txt = qtn_incal_enable_main_option; + cascade = r_videotelui_enable_menu; + }, + MENU_ITEM // Disable + { + command = EVtUiCmdDisableMain; + txt = qtn_incal_disable_main_option; + cascade = r_videotelui_disable_menu; + }, + MENU_ITEM // Use primary camera + { + command = EVtUiCmdUsePrimaryCamera; + txt = qtn_incal_camera_1_option; + }, + MENU_ITEM // Use secondary camera + { + command = EVtUiCmdUseSecondaryCamera; + txt = qtn_incal_camera_2_option; + }, + MENU_ITEM // Swap images places + { + command = EVtUiCmdSwapImagesPlaces; + txt = qtn_incal_swap_vt_images; + }, + MENU_ITEM // Snapshot + { + command = EVtUiCmdSnapshot; + txt = qtn_incal_snapshot_option; + }, + MENU_ITEM // Send DTMF + { + command = EVtUiCmdSendDTMF; + txt = qtn_incal_send_dtmf_tone_option; + }, + MENU_ITEM // Share file + { + command = EVtUiCmdShareObjectImage; + txt = qtn_incal_video_call_share_file; + }, + MENU_ITEM // Handset (deactivate loudspeaker) + { + command = EVtUiCmdDeactivateLoudspeaker; + txt = qtn_incal_deact_ihf_option; + }, + MENU_ITEM // Loudspeaker + { + command = EVtUiCmdActivateLoudspeaker; + txt = qtn_incal_act_ihf_option; + }, + MENU_ITEM // BT handsfree + { + command = EVtUiCmdActivateBT; + txt = qtn_incal_bt_handsfree_option; + }, + MENU_ITEM // Handset (deactivate BT) + { + command = EVtUiCmdDeactivateBT; + txt = qtn_incal_handset_option; + }, + MENU_ITEM // Video to voice + { + command = EVtUiCmdCreateVoice; + txt = qtn_incal_video_to_voice; + }, + MENU_ITEM + { + command = EVtUiCmdAdjustVideo; + txt = qtn_incal_video_adjust_option; + cascade = r_videotelui_video_adjust_menu; + }, + MENU_ITEM // Zoom + { + command = EVtUiCmdZoom; + txt = qtn_incal_zoom_own_video; + }, + MENU_ITEM // End active call + { + command = EVtUiCmdEndActiveCall; + txt = qtn_incal_drop_option; + }, + MENU_ITEM // Go to Idle + { + command = EVtUiCmdGoToIdle; +#ifdef RD_BOOT_CUSTOMIZABLE_AI + txt = qtn_incal_goto_idle; +#else + txt = qtn_incal_goto_active_idle; +#endif // RD_BOOT_CUSTOMIZABLE_AI + }, + MENU_ITEM // Help + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM // Exit + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_ok_menu +// Options menu for the application. This menu is opened when selection key +// is pressed. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_videotelui_ok_menu + { + items = + { + MENU_ITEM // Disable + { + command = EVtUiCmdDisableMain; + txt = qtn_incal_disable_main_option; + cascade = r_videotelui_disable_menu; + }, + MENU_ITEM // Snapshot + { + command = EVtUiCmdSnapshot; + txt = qtn_incal_snapshot_option; + }, + MENU_ITEM // End active call + { + command = EVtUiCmdEndActiveCall; + txt = qtn_incal_drop_option; + }, + MENU_ITEM // Use primary camera + { + command = EVtUiCmdUsePrimaryCamera; + txt = qtn_incal_camera_1_option; + }, + MENU_ITEM // Use secondary camera + { + command = EVtUiCmdUseSecondaryCamera; + txt = qtn_incal_camera_2_option; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_enable_menu +// "Enable" submenu for the application. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_videotelui_enable_menu + { + items = + { + MENU_ITEM + { + command = EVtUiCmdEnableVideo; + txt = qtn_incal_change_video_option; + }, + MENU_ITEM + { + command = EVtUiCmdEnableAudio; + txt = qtn_incal_change_audio_option; + }, + MENU_ITEM + { + command = EVtUiCmdEnableBoth; + txt = qtn_incal_change_both_option; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_disable_menu +// "Disable" submenu for the application. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_videotelui_disable_menu + { + items = + { + MENU_ITEM + { + command = EVtUiCmdDisableVideo; + txt = qtn_incal_change_video_option; + }, + MENU_ITEM + { + command = EVtUiCmdDisableAudio; + txt = qtn_incal_change_audio_option; + }, + MENU_ITEM + { + command = EVtUiCmdDisableBoth; + txt = qtn_incal_change_both_option; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_video_adjust_menu +// "Adjust video" submenu for the application. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_videotelui_video_adjust_menu + { + items = + { + MENU_ITEM + { + command = EVtUiCmdAdjustVideoVideoQuality; + txt = qtn_incal_video_prefer_option; + }, + MENU_ITEM + { + command = EVtUiCmdAdjustVideoWhiteBalance; + txt = qtn_incal_video_white_balance_option; + }, + MENU_ITEM + { + command = EVtUiCmdAdjustVideoBrightness; + txt = qtn_incal_video_brightness_option; + }, + MENU_ITEM + { + command = EVtUiCmdAdjustVideoContrast; + txt = qtn_incal_video_contrast_option; + }, + MENU_ITEM + { + command = EVtUiCmdAdjustVideoColourTone; + txt = qtn_incal_video_colour_tone_option; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_softkeys_enable_video +// Options & Enable video softkeys +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_enable_video + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EVtUiCmdEnableVideo; + txt = qtn_incal_softk_enable_video; + }, + CBA_BUTTON + { + id = EAknSoftkeyContextOptions; + txt = text_softkey_empty; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_softkeys_enable_audio +// Options & Enable audio softkeys +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_enable_audio + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EVtUiCmdEnableAudio; + txt = qtn_incal_softk_enable_audio; + }, + CBA_BUTTON + { + id = EAknSoftkeyContextOptions; + txt = text_softkey_empty; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_softkeys_handset_b +// Options & Handset both softkeys +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_handset_b + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EVtUiCmdDeactivateLoudspeaker; + txt = qtn_incal_softk_handset; + }, + CBA_BUTTON + { + id = EAknSoftkeyContextOptions; + txt = text_softkey_empty; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_softkeys_loudspeaker +// Options & Handset both softkeys +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_loudspeaker + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EVtUiCmdActivateLoudspeaker; + txt = qtn_incal_softk_laudspek; + }, + CBA_BUTTON + { + id = EAknSoftkeyContextOptions; + txt = text_softkey_empty; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_softkeys_bt_handsfree +// Options & Handset both softkeys +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_bt_handsfree + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EVtUiCmdActivateBT; + txt = qtn_incal_softk_bt_handsfree; + }, + CBA_BUTTON + { + id = EAknSoftkeyContextOptions; + txt = text_softkey_empty; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_softkeys_end_call +// Options & End call softkeys +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_end_call + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EVtUiCmdEndActiveCall; + txt = qtn_incal_softk_end_this; + }, + CBA_BUTTON + { + id = EAknSoftkeyContextOptions; + txt = text_softkey_empty; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_softkeys_capture_video +// Capture & Cancel video softkeys +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_capture_video + { + buttons = + { + CBA_BUTTON + { + id = EVtUiCmdCapture; + txt = qtn_softk_capture; + }, + CBA_BUTTON + { + id = EVtUiCmdCancelCapture; + txt = text_softkey_cancel; + }, + CBA_BUTTON + { + id = EVtUiCmdCapture; + txt = qtn_softk_capture; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_softkeys_share_object_image +// Options & Stop image object sharing +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_share_object_image + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EVtUiCmdStopSharingObjectImage; + txt = qtn_softk_disable_share; + }, + CBA_BUTTON + { + id = EAknSoftkeyContextOptions; + txt = text_softkey_empty; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_blank_dlg +// Blank dialog. +// +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_videotelui_blank_dlg + { + flags = ( EEikDialogFlagNoDrag | + EEikDialogFlagNoTitleBar | + EEikDialogFlagFillAppClientRect | + EEikDialogFlagCbaButtons | + EEikDialogFlagWait ); + + buttons = r_videotelui_softkeys_empty; + + items = + { + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_blank_nowait_dlg +// Blank dialog, no wait flag. +// +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_videotelui_blank_nowait_dlg + { + flags = ( EEikDialogFlagNoDrag | + EEikDialogFlagNoTitleBar | + EEikDialogFlagFillAppClientRect | + EEikDialogFlagCbaButtons ); + + buttons = r_videotelui_softkeys_empty; + + items = + { + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_softkeys_empty +// +// Empty softkeys. Note that AVKON empty softkey +// resource can not be used, because flags are needed. +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_empty + { + flags = EAknCBAFlagRespondWhenInvisible; + + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyEmpty; + txt = text_softkey_empty; + }, + CBA_BUTTON + { + id = EAknSoftkeyEmpty; + txt = text_softkey_empty; + }, + CBA_BUTTON + { + id = EAknSoftkeyEmpty; + txt = text_softkey_empty; + } + }; + } + + +// ----------------------------------------------------------------------------- +// +// r_videotelui_qtn_incal_muted_pane +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_videotelui_qtn_incal_muted_pane + { + buf = qtn_incal_muted_pane; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_allow_video_query +// +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_videotelui_allow_video_query + { + flags = + EEikDialogFlagNoDrag | + EEikDialogFlagNoTitleBar | + EEikDialogFlagCbaButtons | + EEikDialogFlagNotifyEsc ; + buttons = R_AVKON_SOFTKEYS_YES_NO; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationLayout; + label = ""; + }; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_switch_to_voice_query +// +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_videotelui_create_voice_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationLayout; + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_videotelui_qtn_send_video_image +// +// --------------------------------------------------------- +// +RESOURCE TBUF r_videotelui_qtn_send_video_image + { + buf = qtn_incal_send_video_image; + } + +// --------------------------------------------------------- +// +// r_videotelui_qtn_call_number_video +// +// --------------------------------------------------------- +// +RESOURCE TBUF r_videotelui_qtn_call_number_video + { + buf = qtn_call_number_video; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_title_pane +// It defines default title pane. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TITLE_PANE r_videotelui_title_pane + { + txt = " "; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_qtn_incal_waiting_image +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_videotelui_qtn_incal_waiting_image + { + buf = qtn_incal_waiting_image; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_emergency_note +// +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_videotelui_emergency_note + { + flags = EEikDialogFlagNoDrag | + EEikDialogFlagNoTitleBar | + EEikDialogFlagCbaButtons; + + buttons = R_AVKON_SOFTKEYS_CANCEL; + + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EGeneralLayout; + }; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_information_note +// It defines note template for information notes. Text +// must be replaced to correct in code. Note does not have wait +// flag. +// +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_videotelui_information_note + { + flags = + EEikDialogFlagNoDrag | + EEikDialogFlagNoTitleBar | + EEikDialogFlagCbaButtons; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = + AVKON_NOTE + { + layout = EGeneralLayout; + singular_label = " "; + plural_label = ""; + animation = R_QGN_NOTE_INFO_ANIM; + }; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_qtn_incal_close_camcorder +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_videotelui_qtn_incal_close_camcorder + { + buf = qtn_incal_close_camcorder; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_bthf_connect_wait_note +// +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_videotelui_bthf_connect_wait_note + { + flags = EEikDialogFlagNoDrag | + EEikDialogFlagNoTitleBar | + EEikDialogFlagCbaButtons | + EEikDialogFlagWait; + + buttons = R_AVKON_SOFTKEYS_EMPTY; + + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + singular_label = qtn_wait_connecting_to_bt; + plural_label = ""; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + }; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_qtn_bt_device_not_avail +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_videotelui_qtn_bt_device_not_avail + { + buf = qtn_bt_device_not_avail; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_text_not_allowed +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_videotelui_text_not_allowed + { + buf = text_not_allowed; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_text_call_not_allowed +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_videotelui_text_call_not_allowed + { + buf = text_call_not_allowed; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_qtn_err_cam_swap +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_videotelui_qtn_err_cam_swap + { + buf = qtn_err_cam_swap; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_qtn_query_create_voice_call +// +// +RESOURCE TBUF r_videotelui_qtn_query_create_voice_call + { + buf = qtn_query_create_voice_call; + } +//---------------------------------------------------- +// +// r_videotelui_qtn_err_unable_to_open_image +// +//---------------------------------------------------- +// +RESOURCE TBUF r_videotelui_qtn_err_unable_to_open_image + { + buf = qtn_tel_info_unable_open_image; + } + +//---------------------------------------------------- +// +// r_videotelui_qtn_incal_note_decoding_failed +// +//---------------------------------------------------- +// +RESOURCE TBUF r_videotelui_qtn_incal_note_decoding_failed + { + buf = qtn_incal_note_decoding_failed; + } + +//---------------------------------------------------- +// +// r_videotelui_qtn_err_drm_not_allowed +// +//---------------------------------------------------- +// +RESOURCE TBUF r_videotelui_qtn_err_drm_not_allowed + { + buf = qtn_drm_not_allowed; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_tooltip_zoom +// +// +RESOURCE TBUF r_videotelui_tooltip_zoom + { + buf = qtn_vt_tooltip_zoom; + } + +//---------------------------------------------------- +// +// r_image_load_wait_note +// Image initialization wait note. +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_progress_decoding_image_wait_note + { + flags = EAknWaitNoteFlags; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + singular_label = qtn_vt_progress_decoding_image; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_videotelui_context_options_cba_button +// Cba button resource for number entry. +// +//---------------------------------------------------- +// +RESOURCE CBA_BUTTON r_videotelui_context_options_cba_button + { + id=EAknSoftkeyContextOptions; + txt=text_softkey_empty; + } + +//---------------------------------------------------- +// +// r_videotelui_select_cba_button +// Empty cba button resource for toolbar. +// +//---------------------------------------------------- +// +RESOURCE CBA_BUTTON r_videotelui_select_cba_button + { + id = EAknSoftkeySelect; + txt= text_softkey_select; + } + +//---------------------------------------------------- +// +// r_videotelui_empty_cba_button +// Empty cba button resource for number entry. +// +//---------------------------------------------------- +// +RESOURCE CBA_BUTTON r_videotelui_empty_cba_button + { + id = EAknSoftkeyEmpty; + txt= text_softkey_empty; + } + +//---------------------------------------------------- +// +// r_videotelui_floating_toolbar +// Empty resource for floating toolbar. +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_videotelui_floating_toolbar + { + flags = KAknToolbarWithoutCba | KAknToolbarAlwaysFocusing | + KAknToolbarFlexiblePosition; + items = + { + }; + } + +//---------------------------------------------------- +// +// r_videotelui_fixed_toolbar +// Empty resource for fixed toolbar. +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_videotelui_fixed_toolbar + { + flags = KAknToolbarFixed; + items = + { + }; + } + +//---------------------------------------------------- +// +// r_videotelui_video_record_start_sound_path +// Path to a sound file to play when starting video recording +// +//---------------------------------------------------- +// +RESOURCE TBUF r_videotelui_video_record_start_sound_path + { + buf = KVtStartSoundFile; + } + + +//---------------------------------------------------- +// +// r_videotelui_video_record_stop_sound_path +// Path to a sound file to play when stopping video recording +// +//---------------------------------------------------- +// +RESOURCE TBUF r_videotelui_video_record_stop_sound_path + { + buf = KVtStopSoundFile; + } + +//---------------------------------------------------- +// +// r_disable_video_button_state_extension +// +//---------------------------------------------------- +// +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_disable_video_button_state_extension + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiTbVideoDisable; + //skinid = KAknsIIDQgnIndiTbVideoDisable; + } + +//---------------------------------------------------- +// +// r_enable_video_button_state_extension +// +//---------------------------------------------------- +// +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_enable_video_button_state_extension + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiTbVideo; + //skinid = KAknsIIDQgnIndiTbVideo; + } + +//---------------------------------------------------- +// +// r_mute_microphone_button_state_extension +// +//---------------------------------------------------- +// +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mute_microphone_button_state_extension + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiTbMicrophoneMute; + //skinid = KAknsIIDQgnIndiTbMicrophoneMute; + } + +//---------------------------------------------------- +// +// r_unmute_microphone_button_state_extension +// +//---------------------------------------------------- +// +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_unmute_microphone_button_state_extension + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiTbMicrophoneUnmute; + //skinid = KAknsIIDQgnIndiTbMicrophoneUnmute; + } + +//---------------------------------------------------- +// +// r_primary_cam_button_state_extension +// +//---------------------------------------------------- +// +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_primary_cam_button_state_extension + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiTbCameraMain ; + //skinid = KAknsIIDQgnIndiTbCameraMain; + } + +//---------------------------------------------------- +// +// r_secondary_cam_button_state_extension +// +//---------------------------------------------------- +// +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_secondary_cam_button_state_extension + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiTbCameraSecondary; + //skinid = KAknsIIDQgnIndiTbCameraSecondary; + } + +//---------------------------------------------------- +// +// r_zoom_button_state_extension +// +//---------------------------------------------------- +// +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_zoom_button_state_extension + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiTbZoom; + //skinid = KAknsIIDQgnIndiTbZoom; + } + +//---------------------------------------------------- +// +// r_share_button_state_extension +// +//---------------------------------------------------- +// +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_swap_button_state_extension + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiTbSwapImages; + //skinid = KAknsIIDQgnIndiTbSwapImages; + } + +//---------------------------------------------------- +// +// r_share_button_state_extension +// +//---------------------------------------------------- +// +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_share_button_state_extension + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiTbGallery; + //skinid = KAknsIIDQgnIndiTbGallery; + } + +//---------------------------------------------------- +// +// r_handset_button_state_extension +// +//---------------------------------------------------- +// +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_handset_button_state_extension + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiTbHandset; + //skinid = KAknsIIDQgnIndiTbHandset; + } + +//---------------------------------------------------- +// +// r_ihf_on_button_state_extension +// +//---------------------------------------------------- +// +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_ihf_on_button_state_extension + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiTbIhfOn; + //skinid = KAknsIIDQgnIndiTbIhfOn; + } + +//---------------------------------------------------- +// +// r_bt_hf_button_state_extension +// +//---------------------------------------------------- +// +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_bt_hf_button_state_extension + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiTbBthf; + //skinid = KAknsIIDQgnIndiTbBthf; + } + +// ----------------------------------------------------------------------------- +// +// r_avkonbutton_toggle_video_button +// This button disables and enables video. +// This button has two states. +// +// ----------------------------------------------------------------------------- +// +RESOURCE AVKON_BUTTON r_avkonbutton_toggle_video_button + { + flags = 0; + states = + { + AVKON_BUTTON_STATE // disable video button (0) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_video_disable; + bmpmask = EMbmVideoteluiQgn_indi_tb_video_disable_mask; + helptxt = qtn_vt_tooltip_disable_video; + extension = r_disable_video_button_state_extension; + }, + AVKON_BUTTON_STATE // disable video button (dummy state) (1) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_video_disable; + bmpmask = EMbmVideoteluiQgn_indi_tb_video_disable_mask; + extension = r_disable_video_button_state_extension; + }, + AVKON_BUTTON_STATE // enable video button (2) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_video; + bmpmask = EMbmVideoteluiQgn_indi_tb_video_mask; + helptxt = qtn_vt_tooltip_enable_video; + extension = r_enable_video_button_state_extension; + }, + AVKON_BUTTON_STATE // enable video button (dummy state) (3) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_video; + bmpmask = EMbmVideoteluiQgn_indi_tb_video_mask; + extension = r_enable_video_button_state_extension; + } + }; + } +// ----------------------------------------------------------------------------- +// +// r_avkonbutton_toggle_microphone_button +// This button mutes and unmutes microphone. +// This button has two states. +// +// ----------------------------------------------------------------------------- +// +RESOURCE AVKON_BUTTON r_avkonbutton_toggle_microphone_button + { + flags = 0; + states = + { + AVKON_BUTTON_STATE // mute mic button (0) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_microphone_mute; + bmpmask = EMbmVideoteluiQgn_indi_tb_microphone_mute_mask; + helptxt = qtn_vt_tooltip_mute_microphone; + extension = r_mute_microphone_button_state_extension; + }, + AVKON_BUTTON_STATE // mute mic button (dummy state) (1) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_microphone_mute; + bmpmask = EMbmVideoteluiQgn_indi_tb_microphone_mute_mask; + extension = r_mute_microphone_button_state_extension; + }, + AVKON_BUTTON_STATE // unmute mic button (2) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_microphone_unmute; + bmpmask = EMbmVideoteluiQgn_indi_tb_microphone_unmute_mask; + helptxt = qtn_vt_tooltip_unmute_microphone; + extension = r_unmute_microphone_button_state_extension; + }, + AVKON_BUTTON_STATE // unmute mic button (dummy state) (3) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_microphone_unmute; + bmpmask = EMbmVideoteluiQgn_indi_tb_microphone_unmute_mask; + extension = r_unmute_microphone_button_state_extension; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_avkonbutton_toggle_camera_button +// This button changes used camera between primary and secondary. +// This button has two states. +// +// ----------------------------------------------------------------------------- +// +RESOURCE AVKON_BUTTON r_avkonbutton_toggle_camera_button + { + flags = 0; + states = + { + AVKON_BUTTON_STATE // primary camera button (0) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_camera_main; + bmpmask = EMbmVideoteluiQgn_indi_tb_camera_main_mask; + helptxt = qtn_vt_tooltip_primary_cam; + extension = r_primary_cam_button_state_extension; + }, + AVKON_BUTTON_STATE // primary camera button (dummy state) (1) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_camera_main; + bmpmask = EMbmVideoteluiQgn_indi_tb_camera_main_mask; + extension = r_primary_cam_button_state_extension; + }, + AVKON_BUTTON_STATE // secondary camera button (2) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_camera_secondary; + bmpmask = EMbmVideoteluiQgn_indi_tb_camera_secondary_mask; + helptxt = qtn_vt_tooltip_secondary_cam; + extension = r_secondary_cam_button_state_extension; + }, + AVKON_BUTTON_STATE // secondary camera button (dummy state) (3) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_camera_secondary; + bmpmask = EMbmVideoteluiQgn_indi_tb_camera_secondary_mask; + extension = r_secondary_cam_button_state_extension; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_avkonbutton_swap_images_button +// This button swaps images +// +// ----------------------------------------------------------------------------- +// +RESOURCE AVKON_BUTTON r_avkonbutton_swap_images_button + { + flags = 0; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_swap_images; + bmpmask = EMbmVideoteluiQgn_indi_tb_swap_images_mask; + helptxt = qtn_vt_tooltip_swap_images; + extension = r_swap_button_state_extension; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_avkonbutton_activate_zoom_mode_button +// This button activates zoom mode. +// +// ----------------------------------------------------------------------------- +// +RESOURCE AVKON_BUTTON r_avkonbutton_activate_zoom_mode_button + { + flags = 0; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_zoom; + bmpmask = EMbmVideoteluiQgn_indi_tb_zoom_mask; + helptxt = qtn_vt_tooltip_zoom; + extension = r_zoom_button_state_extension; + }, + AVKON_BUTTON_STATE + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_zoom; + bmpmask = EMbmVideoteluiQgn_indi_tb_zoom_mask; + flags = KAknButtonStateHasLatchedFrame; + helptxt = qtn_vt_tooltip_zoom; + extension = r_zoom_button_state_extension; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_avkonbutton_share_file_button +// This button starts the file sharing. +// +// ----------------------------------------------------------------------------- +// +RESOURCE AVKON_BUTTON r_avkonbutton_share_file_button + { + flags = 0; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_gallery; + bmpmask = EMbmVideoteluiQgn_indi_tb_gallery_mask; + helptxt = qtn_vt_tooltip_share; + extension = r_share_button_state_extension; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_avkonbutton_snapshot_button +// This button sets capture mode on. +// +// ----------------------------------------------------------------------------- +// +/* Not in use currently +RESOURCE AVKON_BUTTON r_avkonbutton_snapshot_button + { + flags = 0; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_cams_tb_capture; + bmpmask = EMbmVideoteluiQgn_indi_cams_tb_capture_mask; + helptxt = qtn_vt_tooltip_send_snapshot; + //extension is also needed here + } + }; + } +*/ + + +// ----------------------------------------------------------------------------- +// +// r_mini_dialer_editor +// This is a resource for a hidden focused editor for minidialer (touch input). +// +// ----------------------------------------------------------------------------- +// +RESOURCE SECRETED r_mini_dialer_editor + { + num_letters=255; + } + +//---------------------------------------------------- +// +// video preference options +// +//---------------------------------------------------- +// +RESOURCE TBUF r_videotelui_qtn_incal_normal_list_option + { + buf = qtn_incal_normal_list_option; + } + +RESOURCE TBUF r_videotelui_qtn_incal_details_list_option + { + buf = qtn_incal_details_list_option; + } + +RESOURCE TBUF r_videotelui_qtn_incal_motion_list_option + { + buf = qtn_incal_motion_list_option; + } + +//---------------------------------------------------- +// +// white balance options +// +//---------------------------------------------------- +RESOURCE TBUF r_videotelui_qtn_incal_automatic_option + { + buf = qtn_incal_automatic_option; + } + +RESOURCE TBUF r_videotelui_qtn_incal_sunny_option + { + buf = qtn_incal_sunny_option; + } + +RESOURCE TBUF r_videotelui_qtn_incal_cloudy_option + { + buf = qtn_incal_cloudy_option; + } + +RESOURCE TBUF r_videotelui_qtn_incal_incandescent_option + { + buf = qtn_incal_incandescent_option; + } + +RESOURCE TBUF r_videotelui_qtn_incal_fluorescent_option + { + buf = qtn_incal_fluorescent_option; + } + +//---------------------------------------------------- +// +// colour tone options +// +//---------------------------------------------------- +RESOURCE TBUF r_videotelui_qtn_incal_ct_normal_option + { + buf = qtn_incal_ct_normal_option; + } + +RESOURCE TBUF r_videotelui_qtn_incal_sepia_option + { + buf = qtn_incal_sepia_option; + } + +RESOURCE TBUF r_videotelui_qtn_incal_b_and_w_option + { + buf = qtn_incal_b_and_w_option; + } + +RESOURCE TBUF r_videotelui_qtn_incal_negative_option + { + buf = qtn_incal_negative_option; + } + +// --------------------------------------------------------- +// r_videotelui_white_balance_setting_page +// White balance item array for setting page +// +// --------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_videotelui_white_balance_setting_page + { + label = qtn_incal_video_white_balance_option; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL; + type = EAknSetListBox; + editor_resource_id = r_videotelui_transparent_setting_listbox; + } + +// --------------------------------------------------------- +// r_videotelui_color_tone_setting_page +// White balance item array for setting page +// +// --------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_videotelui_color_tone_setting_page + { + label = qtn_incal_video_colour_tone_option; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL; + type = EAknSetListBox; + editor_resource_id = r_videotelui_transparent_setting_listbox; + } + +//---------------------------------------------------- +// +// r_videotelui_transparent_setting_listbox +// Listbox for transparent setting page +// +//---------------------------------------------------- +// +RESOURCE LISTBOX r_videotelui_transparent_setting_listbox + { + flags = 0x0001; + } + +// --------------------------------------------------------- +// r_videotelui_video_quality_array +// Item array for the selection list dialog +// +// --------------------------------------------------------- +// +RESOURCE ARRAY r_videotelui_video_quality_array + { + items = + { + LBUF + { + txt = qtn_incal_normal_list_option; + }, + LBUF + { + txt = qtn_incal_details_list_option; + }, + LBUF + { + txt = qtn_incal_motion_list_option; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_softkeys_select_cancel +// Videoquality softkeys +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_select_cancel + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyEmpty; + txt= text_softkey_empty; + }, + CBA_BUTTON + { + id = EAknSoftkeyCancel; + txt = text_softkey_cancel; + }, + CBA_BUTTON + { + id = EAknSoftkeySelect; + txt= text_softkey_select; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_softkeys_empty_dialerexit +// Dialer softkeys +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_empty_dialerexit + { + buttons = + { + CBA_BUTTON + { + id = EVtUiCmdDialerEmergencyCall; + txt = qtn_incal_softk_emergency_call; + }, + CBA_BUTTON + { + id = EVtUiDialerExit; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeyEmpty; + txt = text_softkey_empty; + } + }; + } + +// ----------------------------------------------------------------------------- +// +//r_videotelui_softkeys_empty_active_command +// Dialer softkeys +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_empty_active_command + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyEmpty; + txt = text_softkey_empty; + }, + CBA_BUTTON + { + id = EAknSoftkeyEmpty; + txt = text_softkey_empty; + }, + CBA_BUTTON + { + id = EAknSoftkeyEmpty; + txt = text_softkey_empty; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_avkonbutton_audio_routing_button +// This button changes audio routing. +// +// ----------------------------------------------------------------------------- +// +RESOURCE AVKON_BUTTON r_avkonbutton_audio_routing_button + { + flags = 0; + states = + { + AVKON_BUTTON_STATE // Deactivate loudspeaker (0) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_handset; + bmpmask = EMbmVideoteluiQgn_indi_tb_handset_mask; + helptxt = qtn_vt_tooltip_audio_handset; + extension = r_handset_button_state_extension; + }, + AVKON_BUTTON_STATE // Deactivate loudspeaker (dummy state) (1) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_handset; + bmpmask = EMbmVideoteluiQgn_indi_tb_handset_mask; + extension = r_handset_button_state_extension; + }, + AVKON_BUTTON_STATE // Deactivate bthf == Activate loudspkr (2) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_ihf_on; + bmpmask = EMbmVideoteluiQgn_indi_tb_ihf_on_mask; + helptxt = qtn_vt_tooltip_audio_loudspeaker; + extension = r_ihf_on_button_state_extension; + }, + AVKON_BUTTON_STATE // Deactivate bthf (dummy state) (3) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_ihf_on; + bmpmask = EMbmVideoteluiQgn_indi_tb_ihf_on_mask; + extension = r_ihf_on_button_state_extension; + }, + AVKON_BUTTON_STATE // Activate loudspeaker (4) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_ihf_on; + bmpmask = EMbmVideoteluiQgn_indi_tb_ihf_on_mask; + helptxt = qtn_vt_tooltip_audio_loudspeaker; + extension = r_ihf_on_button_state_extension; + }, + AVKON_BUTTON_STATE // Activate loudspeaker (dummy state) (5) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_ihf_on; + bmpmask = EMbmVideoteluiQgn_indi_tb_ihf_on_mask; + extension = r_ihf_on_button_state_extension; + }, + AVKON_BUTTON_STATE // Activate bt hf (6) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_bthf; + bmpmask = EMbmVideoteluiQgn_indi_tb_bthf_mask; + helptxt = qtn_vt_tooltip_audio_bthf; + extension = r_bt_hf_button_state_extension; + }, + AVKON_BUTTON_STATE // Activate bt hf (dummy state) (7) + { + bmpfile = "Z:"APP_BITMAP_DIR"\\videotelui.mif"; + bmpid = EMbmVideoteluiQgn_indi_tb_bthf; + bmpmask = EMbmVideoteluiQgn_indi_tb_bthf_mask; + extension = r_bt_hf_button_state_extension; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_videotelui_softkeys_dialer +// Options & Dialer open softkeys +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_videotelui_softkeys_dialer + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EVtUiCmdSendDTMF; + txt = qtn_incal_softk_dialer; + }, + CBA_BUTTON + { + id = EAknSoftkeyContextOptions; + txt = text_softkey_empty; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// 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 f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/data/videotelui_caption.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/data/videotelui_caption.rss Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2004 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: Captions for Video Telephone application. +* +*/ + + + +// INCLUDES +#include +#include "videotelui.loc" + +// RESOURCE DEFINITIONS + +// ----------------------------------------------------------------------------- +// +// CAPTION_DATA +// Captions for Video Telephone application. +// +// ----------------------------------------------------------------------------- +// +RESOURCE CAPTION_DATA + { + caption = qtn_apps_videophone_grid; + shortcaption = qtn_apps_videophone_grid; + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/data/videotelui_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/data/videotelui_reg.rss Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2004 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: Registration file for Video Telephone application. +* +*/ + + +#include +#include +#include + +UID2 KUidAppRegistrationResourceFile +UID3 0x101F8681 // application UID + +RESOURCE APP_REGISTRATION_INFO + { + app_file = "videotelui"; + hidden = KAppIsHidden; + localisable_resource_file = + APP_RESOURCE_DIR"\\videotelui"; + localisable_resource_id = R_VIDEOTELUI_LOCALISABLE_APP_INFO; + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/data/videotelui_stub.SIS Binary file vtuis/videotelui/data/videotelui_stub.SIS has changed diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/data/videotelui_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/data/videotelui_stub.pkg Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,33 @@ +; +; 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: +; +; Languages +&EN + +; Header +#{"videotelui"}, (0x101F8681), 1, 0, 0, TYPE=SA + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +;Files +""-"z:\sys\bin\videotelui.exe" +""-"z:\resource\apps\videotelui.rsc" +""-"z:\resource\apps\videotelui_aif.mif" +""-"z:\resource\apps\videotelui.mif" +""-"z:\private\10003a3f\import\apps\videotelui_reg.rsc" \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/group/bld.inf Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2004 - 2007 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: Build information for Video Telephone application. +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/VideoTelephonyVariant.hrh |../../../inc/videotelephonyvariant.hrh +../inc/VideoTelephonyInternalCRKeys.h |../../../inc/videotelephonyinternalcrkeys.h +../data/videotelui_stub.SIS /epoc32/data/z/system/install/videotelui_stub.sis + +// Export LOC file +../loc/videotelui.loc APP_LAYER_LOC_EXPORT_PATH(videotelui.loc) + +// Export IBY files +../rom/videotelui.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videotelui.iby) +../rom/videoteluiResources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(videoteluiresources.iby) + +// Generic configuration interface for component cenrep settings + +../conf/s60videotelephony.confml APP_LAYER_CONFML(s60videotelephony.confml) +../conf/s60videotelephony_102072D0.crml APP_LAYER_CRML(s60videotelephony_102072d0.crml) +../conf/s60videotelephony_10281872.crml APP_LAYER_CRML(s60videotelephony_10281872.crml) + + +#if defined ( RD_VT_RTF ) +../Data/VtStartRecord.wav /epoc32/release/winscw/urel/z/system/sounds/digital/VtStartRecord.wav +../Data/VtStartRecord.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/VtStartRecord.wav +../Data/VtStartRecord.wav /epoc32/release/armv5/urel/z/system/sounds/digital/VtStartRecord.wav +../Data/VtStartRecord.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/VtStartRecord.wav + +../Data/VtStopRecord.wav /epoc32/release/winscw/urel/z/system/sounds/digital/VtStopRecord.wav +../Data/VtStopRecord.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/VtStopRecord.wav +../Data/VtStopRecord.wav /epoc32/release/armv5/urel/z/system/sounds/digital/VtStopRecord.wav +../Data/VtStopRecord.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/VtStopRecord.wav +#endif //RD_VT_RTF + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE videotelui.mif + OPTION HEADERFILE videotelui.mbg + OPTION SOURCES \ + -c8,8 qgn_graf_call_video_out_bg -c8 qgn_indi_call_video_blind_in -c8 qgn_indi_call_video_blind_out \ + /1 qgn_graf_zoom_area -c8,1 qgn_indi_zoom_dir -c8 qgn_indi_zoom_min \ + -c8 qgn_indi_zoom_max -8 qgn_indi_call_video_blind_in_mask_icon -8 qgn_indi_call_video_blind_out_mask_icon \ + -c8,8 qgn_indi_tb_camera_main -c8,8 qgn_indi_tb_camera_secondary -c8,8 qgn_indi_tb_gallery \ + -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_button_end_active_call +END + +START EXTENSION s60/mifconv + OPTION TARGETFILE videotelui_aif.mif + OPTION SOURCES -c8,8 qgn_menu_call_video +END + + + +PRJ_MMPFILES +/* +gnumakefile ../group/videotelui_icons_dc.mk +#ifdef __SCALABLE_ICONS +gnumakefile ../group/videotelui_icons_aif_scalable_dc.mk +#else +gnumakefile ../group/videotelui_icons_aif_bitmaps_dc.mk +#endif +*/ +../group/videotelui.mmp + + + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/group/videotelui.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/group/videotelui.mmp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,251 @@ +/* +* Copyright (c) 2004 - 2007 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: Project specification for Video Telephone application. +* +*/ + + +#include +#include + +// Capability assignment. +CAPABILITY CAP_APPLICATION MultiMediaDD NetworkControl CommDD + +// Assign Vendor ID. +VENDORID VID_DEFAULT + +TARGET videotelui.exe +TARGETTYPE exe +EPOCSTACKSIZE 0x5000 +EPOCHEAPSIZE 0x190000 0x500000 +UID 0x100039CE 0x101F8681 + +SOURCEPATH ../src +SOURCE CVtUiApp.cpp +SOURCE CVtUiAppUi.cpp +SOURCE CVtUiDoc.cpp +SOURCE CVtUiMainControl.cpp +SOURCE CVtUiContextControl.cpp +SOURCE CVtUiNaviPane.cpp +SOURCE CVtUiNaviPaneControl.cpp +SOURCE VtUiLayout.cpp +SOURCE VtUiUtility.cpp +SOURCE VtUiPanic.cpp +SOURCE CVtUiBlankControl.cpp +SOURCE CVtUiBlankDialog.cpp +SOURCE CVtUiExecuteCmdDialog.cpp +SOURCE CVtUiMutedControl.cpp +SOURCE CVtUiZoomControl.cpp +SOURCE CVtUiAllowVideoDialog.cpp +SOURCE CVtUiActiveExec.cpp +SOURCE CVtUiActivateBtHfDialog.cpp +SOURCE TVtUiCallParameters.cpp +SOURCE CVtUiNumberEntryActivationControl.cpp +SOURCE CVtUiBitmapManager.cpp +SOURCE CVtUiEndCallButton.cpp +SOURCE CVtUiEndCallButtonPane.cpp + +SOURCE tvtuiappstatebase.cpp +SOURCE tvtuistatestarting.cpp +SOURCE tvtuistaterunning.cpp +SOURCE tvtuistateresetting.cpp +SOURCE cvtuiappshutter.cpp +SOURCE cvtuivideocontrolbase.cpp +SOURCE cvtuidtmfbuffer.cpp +SOURCE CVtUiRemoteVideoControl.cpp + +// COMMAND FW +SOURCEPATH ../src/commands +SOURCE cvtuicmdbase.cpp +SOURCE cvtuifeaturecmdbase.cpp +SOURCE cvtuicmdcontext.cpp +SOURCE cvtuicmdvalidationactionbase.cpp +SOURCE cvtuicmdvalidatorbase.cpp +SOURCE cvtuicommandpolicymanager.cpp +SOURCE cvtuiprimarycmdpolicy.cpp +SOURCE cvtuicommandmanager.cpp +SOURCE tvtuimediastate.cpp +SOURCE tvtuiaudiostate.cpp +SOURCE tvtuilocalvariation.cpp +SOURCE tvtuistates.cpp +SOURCE cvtuicommandmodifybase.cpp +SOURCE cvtuicmdcustomvalidationactionbase.cpp +SOURCE cvtuicmdstatecheckaction.cpp +SOURCE cvtuiexecutioncontext.cpp +SOURCE tVtuifeaturevariation.cpp + +// FEATURE FW +SOURCEPATH ../src/features +SOURCE cvtuifeaturebase.cpp +SOURCE cvtuifeaturemanager.cpp + +SOURCEPATH ../src/features/toolbar +SOURCE cvtuitoolbarbase.cpp +SOURCE cvtuitoolbarcontext.cpp +SOURCE cvtuihidetoolbaritemaction.cpp +SOURCE tvtuitoolbarcommanditerator.cpp +SOURCE cvtuitoolbarskmodifier.cpp +SOURCE cvtuitoolbarbutton.cpp +SOURCE cvtuitoolbarcmdpolicy.cpp +SOURCE cvtuifloatingtoolbar.cpp +SOURCE cvtuifixedtoolbar.cpp + + +SOURCEPATH ../src/features/menu +SOURCE cvtuimenus.cpp +SOURCE cvtuimenucontext.cpp +SOURCE cvtuimenuitemdimmeraction.cpp +SOURCE tvtuimenucommanditerator.cpp + +SOURCEPATH ../src/features/softkey +SOURCE cvtuisoftkeys.cpp +SOURCE cvtuisoftkeycontext.cpp +SOURCE cvtuisoftkeyvalidationaction.cpp +SOURCE cvtuisoftkeysetting.cpp + + +SOURCEPATH ../src/features/numberentry +SOURCE cvtuinumberentry.cpp +SOURCE CVtUiNumberEntryControl.cpp + +SOURCEPATH ../src/features/prefs +SOURCE cvtuitransparentsettingpage.cpp +SOURCE cvtuiprefsettinglistbase.cpp +SOURCE cvtuiwhitebalance.cpp +SOURCE cvtuicolortone.cpp +SOURCE cvtuivideoquality.cpp +SOURCE cvtuiprefpopupbase.cpp +SOURCE cvtuiprefsliderbase.cpp +SOURCE cvtuibrightness.cpp +SOURCE cvtuibrightnesspopup.cpp +SOURCE cvtuicontrast.cpp +SOURCE cvtuicontrastpopup.cpp + +SOURCEPATH ../src/features/dialer +SOURCE cvtuidialer.cpp +SOURCE cvtuidialervideocontrol.cpp +SOURCE cvtuidialercontainer.cpp +SOURCE cvtuicmdopendialer.cpp +SOURCE cvtuicmdclosedialer.cpp +SOURCE cvtuidialerskmodifier.cpp + +// COMPONENT MANAGER FW +SOURCEPATH ../src/compman +SOURCE cvtuicomponentmanager.cpp +SOURCE tvtuicomponentstate.cpp +SOURCE tvtuiblocklists.cpp + +// SLIDERS +SOURCEPATH ../src/sliders +SOURCE cvtuipopupbase.cpp +SOURCE cvtuisliderbase.cpp + +// VOLUME SLIDER +SOURCEPATH ../src/features/volume +SOURCE cvtuivolume.cpp +SOURCE cvtuivolumepopup.cpp +SOURCE cvtuivolumecontrol.cpp + +// ZOOM SLIDER +SOURCEPATH ../src/features/zoom +SOURCE cvtuizoom.cpp +SOURCE cvtuizoompopup.cpp + +SOURCEPATH ../data + +START RESOURCE videotelui.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END + +START RESOURCE videotelui_reg.rss +DEPENDS videotelui.rsg +TARGETPATH /private/10003a3f/apps +END + +USERINCLUDE ../inc +USERINCLUDE ../inc/commands +USERINCLUDE ../inc/features +USERINCLUDE ../inc/compman +USERINCLUDE ../inc/features/softkey +USERINCLUDE ../inc/features/menu +USERINCLUDE ../inc/features/toolbar +USERINCLUDE ../inc/features/numberentry +USERINCLUDE ../inc/features/prefs +USERINCLUDE ../inc/features/dialer +USERINCLUDE ../inc/features/volume +USERINCLUDE ../inc/features/zoom +USERINCLUDE ../inc/sliders +USERINCLUDE ../loc + +SYSTEMINCLUDE ../../../inc +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY apparc.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY ws32.lib +LIBRARY eikcoctl.lib +LIBRARY apgrfx.lib +LIBRARY fbscli.lib +LIBRARY eikdlg.lib +LIBRARY gdi.lib +LIBRARY bitgdi.lib +LIBRARY egul.lib +LIBRARY ecom.lib + +LIBRARY aknlayout.lib +LIBRARY aknlayout2.lib +LIBRARY avkon.lib +LIBRARY aknskins.lib +LIBRARY aknnotify.lib + +LIBRARY hlplch.lib +LIBRARY featmgr.lib +LIBRARY commonengine.lib +LIBRARY centralrepository.lib + + +LIBRARY videoteleng.lib +DEBUGLIBRARY vtlogger.lib + +LIBRARY phoneclient.lib + +LIBRARY cdlengine.lib +LIBRARY aknicon.lib +LIBRARY aknlayout2scalable.lib + +LIBRARY mgfetch.lib +LIBRARY bafl.lib +LIBRARY caf.lib +LIBRARY cafutils.lib +LIBRARY eikctl.lib +LIBRARY fepbase.lib + +LIBRARY remconinterfacebase.lib +LIBRARY remconcoreapi.lib + +LIBRARY dialer.lib + +LIBRARY gfxtrans.lib + +SOURCEPATH ../loc +DOCUMENT videotelui.loc + +SOURCEPATH ../inc +DOCUMENT videotelui.hrh + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/group/videotelui_icons.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/group/videotelui_icons.mk Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,89 @@ +# +# Copyright (c) 2004 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: Makefile to generate icon file for Video +# Telephone application. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\system\apps\videotelui +HEADERDIR=\epoc32\include +ICONTARGETFILENAME=$(TARGETDIR)\videotelui.mif +HEADERFILENAME=$(HEADERDIR)\videotelui.mbg + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +# ---------------------------------------------------------------------------- +# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by +# MifConv if the mask detph is defined. +# +# NOTE 2: Usually, source paths should not be included in the bitmap +# definitions. MifConv searches for the icons in all icon directories in a +# predefined order, which is currently \s60\icons, \s60\bitmaps2. +# The directory \s60\icons is included in the search only if the feature flag +# __SCALABLE_ICONS is defined. +# ---------------------------------------------------------------------------- + +RESOURCE : + mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ + /c8,8 qgn_graf_call_video_out_bg.bmp \ + /c8 qgn_indi_call_video_blind_in.bmp \ + /c8 qgn_indi_call_video_blind_out.bmp \ + /1 qgn_graf_zoom_area.bmp \ + /c8,1 qgn_indi_zoom_dir.bmp \ + /c8 qgn_indi_zoom_min.bmp \ + /c8 qgn_indi_zoom_max.bmp \ + /8 qgn_indi_call_video_blind_in_mask_icon.bmp \ + /8 qgn_indi_call_video_blind_out_mask_icon.bmp \ + /c8 qgn_indi_tb_camera_main.bmp \ + /c8 qgn_indi_tb_camera_secondary.bmp \ + /c8 qgn_indi_tb_gallery.bmp \ + /c8 qgn_indi_tb_microphone_mute.bmp \ + /c8 qgn_indi_tb_microphone_unmute.bmp \ + /c8 qgn_indi_tb_swap_images.bmp \ + /c8 qgn_indi_tb_video.bmp \ + /c8 qgn_indi_tb_video_disable.bmp \ + /c8 qgn_indi_tb_zoom.bmp \ + /c8 qgn_indi_cams_tb_capture.bmp \ + /c8 qgn_indi_tb_ihf_on.bmp \ + /c8 qgn_indi_tb_handset.bmp \ + /c8 qgn_indi_tb_bthf.bmp + + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(HEADERFILENAME)&& \ + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing + +# End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/group/videotelui_icons_aif_bitmaps.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/group/videotelui_icons_aif_bitmaps.mk Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,61 @@ +# +# Copyright (c) 2004-2005 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: Makefile to generate AIF icons for bitmap version. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\system\apps\videotelui +ICONTARGETFILENAME=$(TARGETDIR)\videotelui_aif.mbm + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +# ---------------------------------------------------------------------------- +# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by +# MifConv if the mask detph is defined. +# +# NOTE 2: Usually, source paths should not be included in the bitmap +# definitions. MifConv searches for the icons in all icon directories in a +# predefined order, which is currently \s60\icons, \s60\bitmaps2. +# The directory \s60\icons is included in the search only if the feature flag +# __SCALABLE_ICONS is defined. +# ---------------------------------------------------------------------------- + +RESOURCE : + mifconv $(ICONTARGETFILENAME) \ + /c8,8 qgn_menu_call_video_lst.bmp + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/group/videotelui_icons_aif_bitmaps_dc.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/group/videotelui_icons_aif_bitmaps_dc.mk Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,61 @@ +# +# Copyright (c) 2004-2005 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: Makefile to generate AIF icons for bitmap version. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\resource\apps +ICONTARGETFILENAME=$(TARGETDIR)\videotelui_aif.mbm + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +# ---------------------------------------------------------------------------- +# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by +# MifConv if the mask detph is defined. +# +# NOTE 2: Usually, source paths should not be included in the bitmap +# definitions. MifConv searches for the icons in all icon directories in a +# predefined order, which is currently \s60\icons, \s60\bitmaps2. +# The directory \s60\icons is included in the search only if the feature flag +# __SCALABLE_ICONS is defined. +# ---------------------------------------------------------------------------- + +RESOURCE : + mifconv $(ICONTARGETFILENAME) \ + /c8,8 qgn_menu_call_video_lst.bmp + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/group/videotelui_icons_aif_scalable.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/group/videotelui_icons_aif_scalable.mk Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,61 @@ +# +# Copyright (c) 2004-2005 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: Makefile to generate AIF icons for scalable version. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\system\apps\videotelui +ICONTARGETFILENAME=$(TARGETDIR)\videotelui_aif.mif + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +# ---------------------------------------------------------------------------- +# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by +# MifConv if the mask detph is defined. +# +# NOTE 2: Usually, source paths should not be included in the bitmap +# definitions. MifConv searches for the icons in all icon directories in a +# predefined order, which is currently \s60\icons, \s60\bitmaps2. +# The directory \s60\icons is included in the search only if the feature flag +# __SCALABLE_ICONS is defined. +# ---------------------------------------------------------------------------- + +RESOURCE : + mifconv $(ICONTARGETFILENAME) \ + /c8,8 qgn_menu_call_video.svg + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/group/videotelui_icons_aif_scalable_dc.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/group/videotelui_icons_aif_scalable_dc.mk Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,61 @@ +# +# Copyright (c) 2004-2005 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: Makefile to generate AIF icons for scalable version. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\resource\apps +ICONTARGETFILENAME=$(TARGETDIR)\videotelui_aif.mif + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +# ---------------------------------------------------------------------------- +# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by +# MifConv if the mask detph is defined. +# +# NOTE 2: Usually, source paths should not be included in the bitmap +# definitions. MifConv searches for the icons in all icon directories in a +# predefined order, which is currently \s60\icons, \s60\bitmaps2. +# The directory \s60\icons is included in the search only if the feature flag +# __SCALABLE_ICONS is defined. +# ---------------------------------------------------------------------------- + +RESOURCE : + mifconv $(ICONTARGETFILENAME) \ + /c8,8 qgn_menu_call_video.svg + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/group/videotelui_icons_dc.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/group/videotelui_icons_dc.mk Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,88 @@ +# +# Copyright (c) 2004-2005 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: Makefile to generate icon file for Video +# Telephone application. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\resource\apps +HEADERDIR=\epoc32\include +ICONTARGETFILENAME=$(TARGETDIR)\videotelui.mif +HEADERFILENAME=$(HEADERDIR)\videotelui.mbg + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +# ---------------------------------------------------------------------------- +# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by +# MifConv if the mask detph is defined. +# +# NOTE 2: Usually, source paths should not be included in the bitmap +# definitions. MifConv searches for the icons in all icon directories in a +# predefined order, which is currently \s60\icons, \s60\bitmaps2. +# The directory \s60\icons is included in the search only if the feature flag +# __SCALABLE_ICONS is defined. +# ---------------------------------------------------------------------------- +RESOURCE : + mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ + /c8,8 qgn_graf_call_video_out_bg.bmp \ + /c8 qgn_indi_call_video_blind_in.bmp \ + /c8 qgn_indi_call_video_blind_out.bmp \ + /1 qgn_graf_zoom_area.bmp \ + /c8,1 qgn_indi_zoom_dir.bmp \ + /c8 qgn_indi_zoom_min.bmp \ + /c8 qgn_indi_zoom_max.bmp \ + /8 qgn_indi_call_video_blind_in_mask_icon.bmp \ + /8 qgn_indi_call_video_blind_out_mask_icon.bmp \ + /c8,8 qgn_indi_tb_camera_main.bmp \ + /c8,8 qgn_indi_tb_camera_secondary.bmp \ + /c8,8 qgn_indi_tb_gallery.bmp \ + /c8,8 qgn_indi_tb_microphone_mute.bmp \ + /c8,8 qgn_indi_tb_microphone_unmute.bmp \ + /c8,8 qgn_indi_tb_swap_images.bmp \ + /c8,8 qgn_indi_tb_video.bmp \ + /c8,8 qgn_indi_tb_video_disable.bmp \ + /c8,8 qgn_indi_tb_zoom.bmp \ + /c8,8 qgn_indi_cams_tb_capture.bmp \ + /c8,8 qgn_indi_tb_ihf_on.bmp \ + /c8,8 qgn_indi_tb_handset.bmp \ + /c8,8 qgn_indi_tb_bthf.bmp + + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(HEADERFILENAME)&& \ + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing + +# End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiActivateBtHfDialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiActivateBtHfDialog.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,108 @@ +/* +* Copyright (c) 2004 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: Bluetooth HF activation dialog for Video Telephone application. +* +*/ + + + +#ifndef CVTUIACTIVATEBTHFDIALOG_H +#define CVTUIACTIVATEBTHFDIALOG_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class MVtEngCommandHandler; +class MVtUiEngineCommandManager; + +// CLASS DECLARATION + +/** +* Bluetooth HF activation dialog for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiActivateBtHfDialog + : public CAknWaitDialog, + private MVtEngCommandObserver + { + public: // Constructors and destructor + + /** + * Constructor. + * + * @param aSelfPtr optional pointer to itself. + * @param aError optional pointer to error code variable. + * @param aCommandHandler command handler. + * @param aCommandManager command manager. + */ + CVtUiActivateBtHfDialog( + CEikDialog** aSelfPtr, + TInt* aError, + MVtEngCommandHandler& aCommandHandler, + MVtUiEngineCommandManager& aCommandManager ); + + /** + * Destructor. + */ + ~CVtUiActivateBtHfDialog(); + + public: // New functions + + /** + * Executes bluetooth activation dialog. + */ + void ExecuteDialogLD(); + + protected: // Functions from base classes + + /** + * @see CEikDialog::PostLayoutDynInitL. + */ + virtual void PostLayoutDynInitL(); + + private: + + /** + * @see MVtEngCommandObserver::HandleVTCommandPerformedL. + */ + virtual void HandleVTCommandPerformedL( + TVtEngCommandId aCommand, + const TInt aError ); + + private: + + // Reference to command handler. + MVtEngCommandHandler& iCommandHandler; + + // Reference to command manager. + MVtUiEngineCommandManager& iCommandManager; + + // ETrue if command is performed. + TBool iCommandPerformed; + + // Pointer to error code variable. + TInt* iError; + + // Audio routing setting. + TPckgBuf< MVtEngAudio::TVtEngRoutingSetting > iAudioRouting; + + }; + +#endif // CVTUIACTIVATEBTHFDIALOG_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiActiveExec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiActiveExec.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2004 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: Asynchronous execution class for Video Telephone application. +* +*/ + + + +#ifndef CVTUIACTIVEEXEC_H +#define CVTUIACTIVEEXEC_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CVtUiActiveExec; + +// CLASS DECLARATION + +/** +* Interface for asynchronous execution. +* +* @since Series 60 2.6 +*/ +class MVtUiActiveExec + { + public: // New functions + + /** + * Starts execution of a command. + * @param aActiveExec active executor. + * @param aState state based on which execution can be started. + * @param aNextState next state. + * @param aRequest request status, which should be used if operation is + * asynchronous. + * @return ETrue if operation was synchronous, otherwise EFalse. + */ + virtual TBool ActiveExecExecuteL( + CVtUiActiveExec& aActiveExec, + const TInt aState, + TInt& aNextState, + TRequestStatus& aRequest ) = 0; + + /** + * Decide whether to continue or not. + * @param aActiveExec active executor. + * @param aState current state, should be updated to new state. + * @param aError error code. + * @return ETrue if continued, EFalse if stopped. + */ + virtual TBool ActiveExecContinue( + CVtUiActiveExec& aActiveExec, + TInt& aState, + const TInt aError ) = 0; + + /** + * Cancels operation of specific state. + * @param aActiveExec active executor. + * @param aState state. + */ + virtual void ActiveExecCancel( + CVtUiActiveExec& aActiveExec, + const TInt aState ) = 0; + + /** + * Informs that operation has been finished. + * @param aActiveExec active executor. + * @param aInitialState initial state. + */ + virtual void ActiveExecDone( + CVtUiActiveExec& aActiveExec, + const TInt aInitialState ) = 0; + + }; + +/** +* Asynchronous execution class for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiActiveExec + : public CActive + { + public: // Constructors and destructor + + /** + * Constructor. + * @param aPriority priority of the active object. + */ + CVtUiActiveExec( + const TInt aPriority ); + + /** + * Destructor. + */ + ~CVtUiActiveExec(); + + public: // New functions + + /** + * Starts execution. + * @param aStartState initial state. + * @param aExec executor. + */ + void Start( + TInt aStartState, + MVtUiActiveExec& aExec ); + + /** + * Initial state of currently + * active operation. + * + * @return initial state, or KErrNotFound if no operation ongoing. + */ + TInt InitialState() const; + + /** + * Returns request status. + * @return request status. + */ + TInt RequestStatus() const; + + public: // Functions from base classes + + /** + * @see CActive::RunL. + */ + virtual void RunL(); + + /** + * @see CActive::DoCancel. + */ + virtual void DoCancel(); + + /** + * @see CActive::RunError. + */ + virtual TInt RunError( TInt aError ); + + private: + + // Ref to active executor. + MVtUiActiveExec* iActiveExec; + + // Initial state. + TInt iInitialState; + + // Current state. + TInt iCurrentState; + + // Next state. + TInt iNextState; + + }; + +#endif // CVTUIACTIVEEXEC_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiAllowVideoDialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiAllowVideoDialog.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2004 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: 'Allow video image' query for Video Telephone application. +* +*/ + + + +#ifndef CVTUIALLOWVIDEODIALOG_H +#define CVTUIALLOWVIDEODIALOG_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* 'Allow video image' query for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiAllowVideoDialog + : public CAknQueryDialog + { + public: // Constructors and destructor + + /** + * Constructor. + * + * @param aSelfPtr optional pointer to itself. + * @param aTone tone to be played. + */ + CVtUiAllowVideoDialog( + CEikDialog** aSelfPtr, + const TTone& aTone ); + + /** + * Destructor. + */ + ~CVtUiAllowVideoDialog(); + + public: // New functions + + /** + * Enumerates different results which + * can be completed to request status. + */ + enum TResult + { + // Query was canceled. + EQueryCanceled = 1, + // Query was dismissed due to timeout. + EQueryDismissedTimeout, + // User denied video sending. + EUserDenied, + // User allowed video sending. + EUserAllowed + }; + + /** + * Runs dialog. + * @param aStatus request status. + */ + void ExecuteDialogLD( + TRequestStatus& aStatus ); + + protected: // Functions from base classes + + /** + * @see CAknQueryDialog::PostLayoutDynInitL. + */ + virtual void PostLayoutDynInitL(); + + /** + * @see CAknQueryDialog::OkToExitL. + */ + virtual TBool OkToExitL( TInt aCommand ); + + private: + + /** + * Callback function. Called when this query + * is dismissed. + * @param aAny pointer to instance of this class. + * @return KErrNone. + */ + static TInt DoDismissDialogTimeoutL( TAny* aAny ); + + private: + + // Pointer to pointer to this instance. + CEikDialog** iSelfPtr; + + // Timer for dismissing the query after timeout. + CPeriodic* iQueryTimer; + + // Request status. + TRequestStatus* iRequestStatus; + + }; + +#endif // CVTUIALLOWVIDEODIALOG_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiApp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiApp.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2004 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: Application class for Video Telephone application. +* +*/ + + + +#ifndef CVTUIAPP_H +#define CVTUIAPP_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* Application class for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiApp + : public CAknApplication + { + public: // Constructors and destructor + + /** + * C++ default constructor. + */ + CVtUiApp(); + + public: // Functions from base classes + + /** + * From CAknApplication, creates document instance. + * @return document instance. + */ + virtual CApaDocument* CreateDocumentL(); + + /** + * From CAknApplication, returns UID of the application. + * @return UID of the application. + */ + virtual TUid AppDllUid() const; + + }; + +#endif // CVTUIAPP_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiAppUi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiAppUi.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,1504 @@ +/* +* Copyright (c) 2004-2008 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: Application UI class for Video Telephone application. +* +*/ + + + +#ifndef CVTUIAPPUI_H +#define CVTUIAPPUI_H + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "CVtUiActiveExec.h" +#include "tvtuilocalvariation.h" +#include "tvtuiappstatebase.h" + + +// FORWARD DECLARATION +class CVtUiBlankControl; +class CAknNavigationControlContainer; +class CAknTitlePane; +class CVtEngModel; +class MVtUiVideoWindow; +class CRepository; +class CAknQueryDialog; +class CAknProgressDialog; +class TVtUiStates; +class CVtUiCommandManager; +class CVtUiComponentManager; +class CVtUiFeatureManager; // TOOLBAR MOD +class MVtUiNumberSource; +class CVtUiMainControl; +class CVtUiContextControl; +class CVtUiBitmapManager; +class CVtUiVolumeControl; +class CAknIncallBubble; +class CVtUiRemoteVideoControl; +class CVtUiEndCallButtonPane; + +// CLASS DECLARATION + +/** +* Application UI class for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiAppUi + : public CAknAppUi, + protected MVtUiActiveExec, + public MVtUiStateContext, + public MProgressDialogCallback + { + public: + + // Rendering modes + enum TRenderingMode + { + ERenderingModeDefault, + ERenderingModeDialer + }; + + public: // Constructors and destructor + + /** + * C++ constructor. + */ + CVtUiAppUi(); + + /** + * Symbian constructor. + */ + void ConstructL(); + + /** + * C++ destructor. + */ + ~CVtUiAppUi(); + + public: // New functions + + /* + * This function decides possibility of swapimg image places. + */ + TBool CanSwapImagePlaces(); + + /* + * Switches status pane between flat and normal one. + */ + void SwitchLayoutToFlatStatusPaneL( TBool aSwitch ); + + /** + * Refreshes all. + */ + void RefreshL(); + + /** + * Refreshes navi pane. + */ + void RefreshNaviPaneL(); + + /** + * Refreshes softkeys. + */ + void RefreshSoftkeysL(); + + /** + * Refreshes menu. + */ + void RefreshMenuL(); + + /** + * Refresh zoom popup + */ + void RefreshZoomPopupL(); + + /** + * Stop brightness or Contrast + */ + void StopBrightnessOrContrast(); + /** + * Refreshes blind flags. + */ + void RefreshBlind(); + + /** + * Enable end call button + */ + void EnableEndCallButton(); + + /** + * Refreshes synchronisation. + */ + void RefreshSynchronise(); + + /** + * Opens number entry. + * @return ETrue if number entry opened. + */ + TBool OpenNumberEntryL(); + + /** + * Handles EKeyPhoneSend presses + */ + TKeyResponse HandlePhoneSendKeyL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * Returns pointer to cba. + */ + CEikButtonGroupContainer* GetCba(); + + /** + * Sets zoom mode. + * @param aEnableZoomMode Etrue if zoom mode is on. + * EFalse otherwise. + * @param aIsPermanent ETrue if zoomindicator's timeout + * should be ignored. EFalse otherwise.. + */ + void SetZoomModeL( const TBool aEnableZoomMode, + const TBool aIsPermanent = EFalse ); + + /** + * Checks if command is active. + * @param aCommand Command id. + * @return Etrue if command is active + * EFalse otherwise. + */ + TBool IsActiveCommand( TInt aCommand ) const; + + TVtUiAppStateBase& State(); + + /** + * Returns reference to bitmap manager. + */ + CVtUiBitmapManager& BitmapManager(); + + /** + * Sets given zoom step, if it allowed. + * @param aZoomStep New zoom step to be set. + */ + void SetZoomFactorL( TInt aZoomStep ); + + /* + * Simulate key event + */ + void CmdSimulateKeyEvent( TInt aScanCode ); + + public: // Functions from base classes + + /** + * From CAknAppUi, handles window server events. + * @param aEvent event. + * @param aDestination destination control. + */ + virtual void HandleWsEventL( + const TWsEvent& aEvent, + CCoeControl* aDestination ); + + /** + * From CAknAppUi, processes commands. + * @param aCommand the identifier of the command to be handled. + */ + virtual void ProcessCommandL( + TInt aCommand ); + + /** + * From CAknAppUi, handles commands. + * @param aCommand the identifier of the command to be handled. + */ + virtual void HandleCommandL( + TInt aCommand ); + + /** + * From CAknAppUi, handles dynamic initialisation of menu panes. + * @param aResourceId the resource identifier for the pane. + * @param aMenuPane the menu pane corresponding to the resource. + */ + virtual void DynInitMenuPaneL( + TInt aResourceId, + CEikMenuPane* aMenuPane ); + + /** + * From CAknAppUi, handles key events. + * @param aKeyEvent event to be handled. + * @param aType type of the key event. + * @return response code (EKeyWasConsumed, EKeyWasNotConsumed) + */ + virtual TKeyResponse HandleKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * From CAknAppUi, handles resouce changes. + * @param aType type of resource change. + */ + virtual void HandleResourceChangeL( TInt aType ); + + /** + * From CAknAppUi, handles foreground status changes. + * @param aForeground ETrue if foreground. + */ + virtual void HandleForegroundEventL( TBool aForeground ); + + /** + * Returns a pointer to CEikonEnv. + */ + CEikonEnv* GetEikonEnv(); + + protected: // Functions from base classes + + /** + * From CAknAppUi, returns help context. + * @return help context. + */ + virtual CArrayFix* HelpContextL() const; + + /** + * @see MVtUiActiveExec::ActiveExecExecuteL. + */ + virtual TBool ActiveExecExecuteL( + CVtUiActiveExec& aActiveExec, + const TInt aState, + TInt& aNextState, + TRequestStatus& aRequest ); + + /** + * @see MVtUiActiveExec::ActiveExecContinue. + */ + virtual TBool ActiveExecContinue( + CVtUiActiveExec& aActiveExec, + TInt& aState, + const TInt aError ); + + /** + * @see MVtUiActiveExec::ActiveExecCancel. + */ + virtual void ActiveExecCancel( + CVtUiActiveExec& aActiveExec, + const TInt aState ); + + /** + * @see MVtUiActiveExec::ActiveExecDone. + */ + virtual void ActiveExecDone( + CVtUiActiveExec& aActiveExec, + const TInt aInitialState ); + + public: // from MVtUiStateContext + + /** @see MVtUiStateContext::StartupPhase1L */ + virtual void StartupPhase1L(); + + /** @see MVtUiStateContext::ShutdownL */ + virtual void ShutdownL(); + + /** @see MVtUiStateContext::StartupPhase2L */ + virtual void StartupPhase2L(); + + /** @see MVtUiStateContext::ChangeApplicationFocus */ + virtual void ChangeApplicationFocus( const TBool aForeground ); + + /** @see MVtUiStateContext::ChangeState */ + virtual void ChangeState( TVtUiAppStateBase* aState ); + + /** @see MVtUiStateContext::StartTone */ + virtual void StartDtmfTone( const TChar& aTone ); + + /** @see MVtUiStateContext::StopTone */ + virtual void StopDtmfTone(); + + /** @see MVtUiStateContext::Model */ + virtual CVtEngModel& Model(); + + /** @see MVtUiStateContext::VideoTelephonyVariation */ + virtual const TVtUiVideoTelephonyVariation& + VideoTelephonyVariation() const; + + /** @see MVtUiStateContext::NumberSource*/ + virtual MVtUiNumberSource* NumberSource() const; + + /** @see MVtUiStateContext::RefreshL */ + virtual void RefreshL( const TInt aRefreshFlags ); + + /** @see MVtUiStateContext::DoExecuteCmdL */ + virtual void DoExecuteCmdL( + const TVtEngCommandId aCommand, + TDesC8* aParams ); + + /** @see MVtUiStateContext::DoHandleLayoutChangedL */ + virtual void DoHandleLayoutChangedL(); + + /** From MVtUiShutterObserver via MVtUiStateContext + * Exits the application. + */ + virtual void HandleShutdownReady(); + + /** + * Gets reference to context control. + * @return reference to context control. + */ + CVtUiContextControl& ContextControl(); + + /** + * Gets reference to main control. + * @return reference to main control. + */ + CVtUiMainControl& MainControl(); + + /** + * Gets reference to remote video control. + * @return reference to remote video control. + */ + 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. + */ + void SwitchViewFinderToMainPaneL( TBool aUpdateState = ETrue ); + + /** + * Switches viewfinder to context pane if it is currently in main + * pane. + */ + void SwitchViewFinderToContextPaneL( TBool aUpdateState = ETrue ); + + /** + * Restores viewfinder back to pane where it was prior to calling the + * switch ViewFinderToMainPane() or ViewFinderToContextPane() methods. + */ + void RestoreViewFinderL(); + + /* + * Updates volume to the Video Telephone engine. + */ + void CmdUpdateVolumeL( MVtEngAudio::TVtEngOutputVolume aVolume ); + + /** + * Increases "command activating" ref.count and adds cleanup item + * to decrease it. Refreshes commands in case of first increment from + * zero. When PopAndDestroy() is called, cleanup decreases reference + * count and if it reduces back to zero command refresh is again done. + */ + void EnableCommandActivatingAndCleanupPushL(); + + private: // from MProgressDialogCallback + + /** + * @see MProgressDialogCallback::DialogDismissedL + */ + void DialogDismissedL( TInt aButtonId ); + + private: + + // COMMAND HANDLING + + /** + * Checks if command is allowed. + * @param aCommand command identifier. + * @return ETrue if allowed, EFalse otherwise. + */ + TBool IsCommandAllowedL( const TInt aCommand ); + + /** + * Refreshes iDisabledFlags. + */ + void RefreshDisabledFlagsL(); + + /** + * Refreshes camera option availability. + * @param aUsePrimaryCameraNotAllowed it will be updated to ETrue if + * it is not allowed to activate primary camera. + * @param aUseSecondaryCameraNotAllowed it will be updated to ETrue if + * it is not allowed to activate secondary camera. + */ + void RefreshCameraOptionAvailability( + TBool& aUsePrimaryCameraNotAllowed, + TBool& aUseSecondaryCameraNotAllowed ); + + /** + * Enables capture mode. + */ + void CmdSnapshotL(); + + /** + * Freezes outgoing video image. + */ + void CmdCaptureL(); + + /** + * Disables capture mode. + */ + void CmdCancelCaptureL(); + + + /** + * Enables video. + */ + void CmdEnableVideoL(); + + /** + * Enables audio (unmute microphone). + */ + void CmdEnableAudioL(); + + /** + * Disables video. + */ + void CmdDisableVideoL(); + + /** + * Disables audio (mute microphone). + */ + void CmdDisableAudioL(); + + /** + * Activates Bluetooth handsfree. + */ + void CmdActivateBtL(); + + /** + * Deactivates Bluetooth handsfree. + */ + void CmdDeactivateBtL(); + + /** + * Activates loudspeaker. + */ + void CmdActivateLoudspeakerL(); + + /** + * Deactivates loudspeaker. + */ + void CmdDeactivateLoudspeakerL(); + + /** + * Ends active call. + */ + void CmdEndActiveCallL(); + + /** + * Swaps images places. + */ + void CmdSwapImagesPlacesL(); + + /** + * Switches used camera. + * @param aPrimaryCamera ETrue if primary camera is to be selected, + * EFalse if secondary camera is to be selected. + */ + void CmdUseCameraL( const TBool aPrimaryCamera ); + + /** + * Launches help application. + */ + void CmdHelpL(); + + /** + * Prepare exiting the application. + */ + void PrepareExitL(); + + /** + * Updates zoom step to Video Telephone engine. + */ + void CmdUpdateZoomL(); + + /** + * Dials emergency call. + */ + void CmdDialEmergencyL(); + + /** + * Goes to Idle. + */ + void CmdGoToIdleL(); + + /** + * Initialize image sharing. + */ + void CmdInitializeShareImageL( TBool& aNeedRefresh ); + + /** + * Start sharing image. + */ + void CmdShareImageL(); + + /** + * Stops sharing image. + */ + void CmdStopShareImageL( TBool& aNeedRefresh ); + + /** + * Handles change in call waiting state. + * @param aIsWaiting The state of call waiting. + */ + void HandleWaitingStateChange( TBool aIsWaiting ); + + // STATE TRANSITIONS + + /** + * @see MVtUiActiveExec::ActiveExecExecuteL. + */ + TBool ActiveExecInitExecuteL( + const TInt aState, + TInt& aNextState, + TRequestStatus& aRequest ); + + /** + * @see MVtUiActiveExec::ActiveExecContinue. + */ + TBool ActiveExecInitContinue( + TInt& aState, + const TInt aError ); + + /** + * @see MVtUiActiveExec::ActiveExecCancel. + */ + void ActiveExecInitCancel( + const TInt aState ); + + /** + * @see MVtUiActiveExec::ActiveExecDone. + */ + void ActiveExecInitDone( + const TInt aInitialState ); + + /** + * Executes command taking no parameters. + * @param aCommand command to be performed. + * @param aRequest request status. + */ + void ActiveExecInitExecuteCommandL( + const TVtEngCommandId aCommand, + TRequestStatus& aRequest ); + + /** + * Executes command taking no parameters. + * @param aCommand command to be performed. + * @param aParam command parameters. + * @param aRequest request status. + */ + template < class T > + void ActiveExecInitExecuteCommandL( + const TVtEngCommandId aCommand, + T& aParam, + TRequestStatus& aRequest ); + + /** + * Executes 'prepare camera' command. + * @param aSource source to be prepared. + * @param aRequest request status. + */ + void ActiveExecInitPrepareCameraL( + const MVtEngMedia::TMediaSource aSource, + TRequestStatus& aRequest ); + + /** + * Executes 'set source' command. + * @param aSource source to be selected. + * @param aRequest request status. + */ + void ActiveExecInitSetSourceL( + const MVtEngMedia::TMediaSource aSource, + TRequestStatus& aRequest ); + + /** + * Executes prepare viewfinder command. + * @param aRequest request status to be completed when finished. + */ + void ActiveExecInitPrepareViewFinderL( + TRequestStatus& aRequest ); + + /** + * Executes prepare remote render command. + * @param aRequest request status to be completed when finished. + */ + void ActiveExecInitPrepareRemoteRenderL( + TRequestStatus& aRequest ); + + + /** + * Executes command taking no parameters. + * @param aCommand command to be performed. + * @param aRequest request status. + */ + void ActiveExecCmdExecuteCommandL( + const TVtEngCommandId aCommand, + TRequestStatus& aRequest ); + + /** + * Executes 'set source' command. + * @param aSource source to be selected. + * @param aRequest request status. + */ + void ActiveExecCmdSetSourceL( + const MVtEngMedia::TMediaSource aSource, + TRequestStatus& aRequest ); + + /** + * Executes 'prepare camera' command. + * @param aSource source to be selected. + * @param aRequest request status. + */ + void ActiveExecCmdPrepareCameraL( + const MVtEngMedia::TMediaSource aSource, + TRequestStatus& aRequest ); + + + /** + * Determines main control options. + * @param aRemoteVideo for remote video. + * @return rendering options. + */ + TVtEngRenderingOptions + DetermineMainControlOptions( TBool aRemoteVideo ); + + /** + * Determines context control options. + * @return rendering options. + */ + TVtEngRenderingOptions DetermineContextControlOptions(); + + /** + * Determines dialer control options. + * @return rendering options. + */ + TVtEngRenderingOptions DetermineDialerControlOptions(); + + /** + * Determines main control DSA options. + * @param aRemoteVideo for remote video. + * @return rendering options. + */ + TVtEngRenderingOptionsDSA + DetermineMainControlOptionsDSA( TBool aRemoteVideo ); + + /** + * Determines context control DSA options. + * @return rendering options. + */ + TVtEngRenderingOptionsDSA DetermineContextControlOptionsDSA(); + + /** + * Determines dialer control DSA options. + * @return rendering options. + */ + TVtEngRenderingOptionsDSA DetermineDialerControlOptionsDSA(); + + /** + * Determines main control DP options. + * @param aRemoteVideo for remote video. + * @return rendering options. + */ + TVtEngRenderingOptionsDP + DetermineMainControlOptionsDP( TBool aRemoteVideo ); + + /** + * Determines context control DP options. + * @return rendering options. + */ + TVtEngRenderingOptionsDP DetermineContextControlOptionsDP(); + + /** + * Determines dialer control DP options. + * @return rendering options. + */ + TVtEngRenderingOptionsDP DetermineDialerControlOptionsDP(); + + /** + * Determines remote video control options. + * @return rendering options. + */ + TVtEngRenderingOptionsNGA + DetermineRemoteVideoControlOptionsNGA(); + + // SYNCHRONOUS / BLOCKING EXECUTION: + + /** + * Performs a command without any parameters. + * @param aCommand command to be performed. + */ + void ExecuteCmdL( const TVtEngCommandId aCommand ); + + /** + * Performs a command with a parameter. + * @param aCommmand command to be performed. + * @param aParam parameter. + */ + template< class T > + void ExecuteCmdL( + const TVtEngCommandId aCommand, + T& aParam ); + + // ASYNCHRONOUS EXECUTION: + + /** + * Performs a command without any parameters. + * @param aDialogPtr pointer to which returned value is stored. + * @param aCommand command to be performed. + * @param aStatus request status. + * @return dialog. + */ + CEikDialog* ExecuteCmdAsyncL( + CEikDialog** aDialogPtr, + const TVtEngCommandId aCommand, + TRequestStatus& aStatus ); + + /** + * Performs a command with a parameter. + * @param aDialogPtr pointer to which returned value is stored. + * @param aCommmand command to be performed. + * @param aParam parameter. + * @param aStatus request status. + * @return dialog. + */ + template< class T > + CEikDialog* ExecuteCmdAsyncL( + CEikDialog** aDialogPtr, + const TVtEngCommandId aCommand, + T& aParam, + TRequestStatus& aStatus ); + + /** + * Performs a command. + * @param aDialogPtr pointer to which returned value is stored. + * @param aCommand command. + * @param aParams parameter, optional. + * @param aStatus request status. + * @return dialog. + */ + CEikDialog* DoExecuteCmdAsyncL( + CEikDialog** aDialogPtr, + const TVtEngCommandId aCommand, + TDesC8* aParams, + TRequestStatus& aStatus ); + + /** + * Executes command in TRAP harnness. + * @param aCommand command identifier. + * @param aParam optional, parameters. + * @return error code. + */ + TInt Execute( const TVtEngCommandId aCommand, TDesC8* aParam ); + + // EVENT HANDLING + + /** + * Handles foreground changed events. + * @param aIsForeground ETrue if foreground, EFalse otherwise. + */ + void HandleForegroundChangedL( + TBool aIsForeground ); + + /** + * Handles engine reset. + */ + void HandleEngineResetL(); + + /** + * Handles successful answer operation. + */ + void HandleAnswerL(); + + /** + * Stops waiting image text showing. + */ + void StopWaitingImage(); + + /** + * Stops white balance showing. + */ + void StopWhiteBalanceOrColortone(); + + /** + * Handles layout changes basically calling HandleLayoutChangedL + * in trap harness. + * @return error code. + */ + TInt HandleLayoutChanged(); + + /** + * Handles layout changes. + */ + void HandleLayoutChangedL(); + + /** + * Handles video frame. + * @param aLocal local frame if ETrue, EFalse if remote. + * @param aBitmap frame, ownership not transferred. + */ + void HandleVideoFrameL( + const TBool aLocal, + CFbsBitmap* aBitmap ); + + void SetVideoFrame( + const TBool aLocal, + CFbsBitmap* aBitmap ); + + /** + * Handles video call details. + * @param aCallID call id. + * @param aCallName call name. + * @param aIsPeerAddressAvailable is peer address available. + */ + void HandleVideoCallDetailsL( + const TInt aCallId, + const TDesC& aCallName, + const TBool aIsPeerAddressAvailable ); + + /** + * Checks if it's time to bring this application + * to the foreground. + */ + void CheckBringToForeground(); + + /** + * Checks if it's time to send this application + * to the background. + */ + void CheckSendToBackground(); + + /** + * Handles remote problem. + */ + void HandleVideoFrameRemoteProblemL(); + + /** + * Handles local problem. + */ + void HandleVideoFrameLocalProblemL(); + + /** + * Set a new remote video layout. + */ + void ChangeRemoteVideoLayoutL(); + + /** + * Show image initialization progress dialog. + */ + void ShowImageInitializeProgressL(); + + /** + * Hide image initialization progress dialog. + */ + void HideImageInitializeProgressL(); + + /** + * Sets SQCif usage. + * @param aUseSQCif SQCif is used. + */ + void RemoteVideoIsSQCif( TBool aUseSQCif ); + + /** + * Sets SQCif usage to control. + * @param aUseSQCif SQCif is used. + */ + void ControlUsesSQCif( TBool aUseSQCif ); + + /** + * Checks if beating needs to be started. + * @param aCallDurationEnabled call duration enabled status. + */ + void CheckBeatL( const TBool aCallDurationEnabled ); + + /** + * Handles heart beats. + */ + void HandleBeat(); + + // UTILITY METHODS + + /** + * Informs the user that camera is reserved by another application. + */ + void ShowCameraInUseNoteL() const; + + /** + * Informs the user that the selected operation is not allowed. + */ + void ShowNotAllowedNoteL() const; + + /** + * Informs the user that it is not allowed to create normal call. + */ + void ShowCallNotAllowedNoteL() const; + + /** + * Informs the user that the other camera is not usable. + */ + void ShowOtherCameraNotUsableNoteL() const; + + /** + * Informs the user that image loading failed. + */ + void ShowUnableToOpenNoteL() const; + + /** + * Informs the user that error happened during image decoding. + * Note: Cannot be constant because DoExecuteL() is used for + * calling this method. + */ + void ShowImageDecodingErrorNoteL(); + + /** + * Informs the user that image is DRM protected and cannot be opened. + */ + void ShowDRMNotAllowedNoteL() const; + + /** + * Sets softkeys. + * @param aSoftkeyResourceId softkey resource id. + */ + void SetSoftkeysL( const TInt aSoftkeyResourceId ); + + /** + * Sets application hidden from fast swap window. + * @param aHidden ETrue if to be hidden, EFalse if visible. + */ + void SetHiddenL( const TBool aHidden ); + + /** + * Updates title pane to show call index. + * @param aCallId call id. + */ + void SetCallIdL( const TInt aCallId ); + + /** + * Updates title pane to show name. + * @param aName name to be displayed in title pane. + * @return ETrue if succeeded, EFalse if not enough memory. + */ + TBool SetCallNameL( const TDesC& aName ); + + /** + * Brings Telephone application to the foreground. + */ + void BringTelephoneToForeground(); + + /** + * Returns window group identifier of the principal + * telephone application. + * @return window group id or 0 if failed. + */ + TInt TelephoneApplicationWgId(); + + /** + * Returns ETrue if number entry should be shown to the user. + * This can be called only after ReadTelephonyVariant has + * been called. + * @return ETrue if number entry should be shown to the user. + */ + inline TBool ShowNumberEntry() const; + + /** + * Checks if active idle is enabled. + * @return ETrue if active idle is enabled. + */ + TBool IsActiveIdleEnabledL() const; + + /** + * Checks engine functionality. + */ + void CheckEngineFunctionality(); + + /** + * Returns navi pane. + * @return navi pane instance. Ownership not transferred. + */ + inline CAknNavigationControlContainer* NaviPaneL(); + + /** + * Returns title pane. + * @return title pane instance. Ownership not transferred. + */ + inline CAknTitlePane* TitlePaneL(); + + /** + * Pushes item to cleanup stack to update softkeys. + */ + inline void CleanupPushRefreshL(); + + /** + * Pushes item to cleanup stack to enable blind status setting. + */ + inline void CleanupPushEnableBlindL(); + + /** + * Callback function to refresh navi pane and softkeys. + * @param aAny pointer to an instance of this class. + */ + static void DoRefresh( TAny* aAny ); + + /** + * Callback function to enable blind status checking. + * @param aAny pointer to an instance of this class. + */ + static void DoEnableBlindSetting( TAny* aAny ); + + /** + * Callback function to disable command activation + * state. + * @param aAny pointer to an instance of this class. + */ + static void DoDisableCommandActivating( TAny* aAny ); + + /** + * Decreases command activation ref.count and refreshes + * states if count gets zero. + */ + void HandleCommandDeactivationL(); + + /** + * Callback function to handle exit timeout. + * @param aAny pointer to instance of this class. + * @return KErrNone always. + */ + static TInt DoHandleExitTimeout( TAny* aAny ); + + /** + * Callback function to exit. + * @param aAny pointer to instance of this class. + * @return KErrNone always. + */ + static TInt DoExit( TAny* aAny ); + + /** + * Checks whether viewfinder is currently in main pane. + * @return ETrue if viewfinder is in main pane. + */ + TBool IsViewFinderInMainPane() const; + +public: + /** + * Checks whether viewfinder is currently in context pane. + * @return ETrue if viewfinder is in context pane. + */ + TBool IsViewFinderInContextPane() const; +private: + /** + * Updates context pane icon + */ + void UpdateContextPaneIconL(); + + /** + * Enables or disables the incall bubble. + */ + void SetIncallBubbleAllowedInUsualL( TBool aAllowed ); + + /** + * Shows progress dialog using given resource. + */ + void ShowProgressDialogL( TInt aResourceId, + MProgressDialogCallback* aCallback = NULL ); + + /** + * Hides (completes) progress dialog. + */ + void HideProgressDialogL(); + + /** + * Static async callback for switching viewfinder to MainPane, also + * starts image sharing. + */ + static TInt AsyncViewFinderToMainPaneAndShare( TAny* aPtr ); + + /** + * Static async callback for starting image share. + */ + static TInt AsyncShare( TAny* aPtr ); + + /** + * Static async callback for showing error note and resharing image. + */ + static TInt AsyncShowErrorAndRestartShare( TAny* aPtr ); + + /** + * Static async callback for handling layout change. + */ + static TInt DelayedHandleLayoutChanged( TAny* aPtr ); + + /** + * Gets current camera orientations for primary and secondary camera. + */ + void GetCameraOrientations(); + + /** + * Sets initial camera orientation. + */ + void SetInitialCameraOrientationL(); + + /** + * Sets current camera orientation. + */ + void SetCameraOrientationL(); + + /** + * Updates engine states. + */ + void RefreshStatesL(); + + /** + * Starts video preference feature specified by command id. + */ + void CmdAdjustVideoL( TInt aCommand ); + + /** + * AppUi has been initialized and its current state is EVtUiAppUiAnswered. + * Do any other needed initilization here e.g. start features. + */ + void AppUiInitDoneDoPostInitL(); + + /* + * This function decides how the wsevent should be handled + * if zoom mode is on. + * @param aEvent window server event. + * @return ETrue if caller function should return, EFalse otherwise. + */ + TBool ProcessWsEventIfZoomModeIsActiveL( const TWsEvent& aEvent ); + + /* + * This function hides the brightness, contrast, volume slider if their mode is on. + */ + void StopSliders(); + + /* + * This function can get the focus window group id + */ + TInt GetFocusWindowGroupId(); + + /** + * Does pre handling to key events, especially for Zoom in and Zoom out + * HW keys. + * @param aEvent event. + */ + TBool PreHandleKeyEventL( const TWsEvent& aEvent ); + + /** + * Calls SimulateKeyEventL() for stored zoom key event. + */ + void SimulateStoredKeyEventL( const TEventCode aEventCode ); + + /** + * Stores zoom key event. If there is different zoom key event + * already stored, keyup event is sent for that event before + * new event is stored. + */ + void StoreKeyEventL( const TKeyEvent& aKeyEvent ); + + /** + * Callback function that calls TryToStartTb function + */ + static TInt DoTryToStartTbL( TAny* aAny ); + + /* + * Tries to start toolbar. Toolbar is started if + * option menus is not visible. + */ + void TryToStartTbL(); + + /* + * Retries to start toolbar. Toolbar is started if + * option menus is not visible. + */ + void RetryToStartTbL(); + + /* + * Update video prefrence + */ + void UpdateVBSettingL(); + + + /** + * Sets current rendering mode (i.e. default or dialer) + */ + void SetRenderingModeL( const TRenderingMode aMode, + MVtUiVideoWindow* aDownlink ); + + /** + * Updates rendering parameters. + */ + void UpdateRenderingParametersL(); + + /* + * Media state has been changed + */ + void MediaStateChangedL(); + + /* + * Updates volume slider + */ + void RefreshVolumeL(); + + /* + * Adjusts volume up or down one step. + */ + void AdjustVolumeL( TRemConCoreApiOperationId aOperationId ); + + private: + + // Pointer to stored downlink window. + MVtUiVideoWindow* iStoredDownlinkWindow; + + // Current rendering mode + TRenderingMode iRenderingMode; + + // Command framework instance + CVtUiCommandManager* iCommandManager; + + // Inner class. + class CInstance; + + // Model instance. Exists only while there is a video call. + CInstance* iInstance; + + // Inner class to observe all events. + class CEventObserver; + + // Inner class for verifying media gallery objects + class CVtUiAppUiMGVerifier; + + // Owned event observer. + CEventObserver* iEventObserver; + + // Owned blank control for reset & shutdown. + CVtUiBlankControl* iBlankControl; + + /** + * Enumerates disabled flags: + * EDisabledVideo - video disabled, + * EDisabledAudio - audio disabled, + * EVideoOptionsDisabled - video options disabled. + */ + enum TDisabledFlags + { + EDisabledVideo = 1, + EDisabledAudio = 2, + EVideoOptionsDisabled = 4 + }; + + // The Ihf Note id. + TInt iIhfNoteId; + + // Flags for disabled. Sum of subset of TDisabledFlags. + TInt iDisabledFlags; + + // Current softkey resource id. + TInt iCurrentSoftkeys; + + // Telephony variant. + TVtUiVideoTelephonyVariation iVTVariation; + + // Window group id of this application. + TInt iThisApplicationWgId; + + // Window group id of eikon server. + TInt iEikonServerWgId; + + // Window group id for AknCapServer + TInt iAknCapServerWgId; + + // Window group id for Akn Notifier Server + TInt iAknNfyServerWgId; + + // Owned active executor for initialisation / uninitialisation. + CVtUiActiveExec* iActiveExec; + + // Owned current dialog on execution. + CEikDialog* iExecDialog; + + // Owned blank dialog. + CEikDialog* iExecBlankDialog; + + // Reference to request status. + TRequestStatus* iShutdownRequest; + + // Owned active executor for command execution. + CVtUiActiveExec* iCmdActiveExec; + + // Owned current dialog on command execution. + CEikDialog* iCmdExecDialog; + + // Owned blank dialog on command execution. + CEikDialog* iCmdExecBlankDialog; + + + // Owned timer for making sure that + // the application is terminated in time. + CPeriodic* iExitTimer; + + // DTMF tone, used as parameter to KVtEngStartDtmfTone. + TPckgBuf< TChar > iDtmfTone; + + // Pointer to uplink window. + MVtUiVideoWindow* iUplinkWindow; + + // Pointer to downlink window. + MVtUiVideoWindow* iDownlinkWindow; + + // Query dialog for switching to voice call + CAknQueryDialog* iCreateVoiceCallDlg; + + // Progress dialog shown when initializing + CAknProgressDialog* iProgressDlg; + + // ASync callback. + CAsyncCallBack* iAsyncCallback; + + // Async callback for layout change + CAsyncCallBack* iLayoutChangeCallback; + + // Camera orientation for primary camera + MVtEngMedia::TCameraOrientation iPrimaryCameraOrientation; + + // Camera orientation for secondary camera + MVtEngMedia::TCameraOrientation iSecondaryCameraOrientation; + + // Currently used camera orientation + MVtEngMedia::TCameraOrientation iCurrentCameraOrientation; + + // Current loudspeaker volume + TInt iLoudspeakerVolume; + + // Current handset volume + TInt iHandsetVolume; + + // Ui states (media, audio, boolean variables) + TVtUiStates* iUiStates; + + // Component manager instance + CVtUiComponentManager* iComponentManager; + + // Feature manager instance + CVtUiFeatureManager* iFeatureManager; + + // Pointer to cba + CEikButtonGroupContainer* iCba; + + // Active number source + MVtUiNumberSource* iNumberSource; + + TVtUiAppStateBase* iState; + + // Stored zoom key event + TKeyEvent iStoredKeyEvent; + + // ETrue if incoming call is waiting call + TBool iIsWaitingCallState; + + // ETrue if key event has been stored + TBool iIsStoredKeyEvent; + + // Timer for starting the toolbar + CPeriodic* iTbPeriodic; + + // Owned volume control class for adjusting + // engine side volume + CVtUiVolumeControl* iVolCtrl; + + // Pending command for delayed layout change + TVtEngCommandId iPendingCmd; + + private: // Friend classes + + // Inner class. + friend class CInstance; + + // Inner class. + friend class CEventObserver; + + private: + + // Class for active command handling + class TActiveCommand + { + + public: + + /** + * Constructor. + * @param aActiveCommands array of command ids. + * @param aCommand command id. + */ + TActiveCommand( RArray< TInt >& aActiveCommands, TInt aCommandId ); + + /** + * Destructor + */ + ~TActiveCommand(); + + /** + * Adds command to active commands + */ + void OpenL(); + + private: + + /** + * Removes command from active commands + */ + void Close(); + + private: + + // Reference to array of active command ids. + RArray< TInt >& iActiveCommands; + + // Command id. + const TInt iCommandId; + + }; + + + private: + // Active command ids. + RArray< TInt > iActiveCommands; + // The last time swap image operation occured. + TTime iLastSwapTime; + // Incall bubble. + CAknIncallBubble* iIncallBubble; + //This flag is used to check if orientation changed before some action + //Currently is only used for prepare remote render and start remote render + TBool iIsLandScapeOrientation; + //flag indicates layoutchang session + TBool iLayoutChg; + //save cmd for later use + TInt iDelayedCmd; + //disable video process + TBool iDisableVideoOngoing; + //disable video process + TBool iShareImageOngoing; + }; + +#endif // CVTUIAPPUI_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiBitmapManager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiBitmapManager.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,188 @@ +/* +* Copyright (c) 2004, 2005 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: Bitmap manager for Video Telephone application. +* +*/ + + + +#ifndef CVTUIBITMAPMANAGER_H +#define CVTUIBITMAPMANAGER_H + +// INCLUDES +#include +#include +#include "videotelui.hrh" + +// DATA TYPES + +/** +* Type definition for bitmap pool identifier. +* Zero is reserved as invalid identifier. +*/ +typedef TInt TVtUiBitmapPoolId; + +// FORWARD DECLARATION +class CFbsBitmap; + +// CLASS DECLARATION + +/** +* Bitmap manager for Video Telephone application. +* @since Series 60 2.8 +*/ +class CVtUiBitmapManager + : public CBase + { + public: // Constructors and destructor + + /** + * Constructor. + */ + CVtUiBitmapManager(); + + /** + * Destructor. + */ + ~CVtUiBitmapManager(); + + public: // New functions + + /** + * Adds bitmaps to the pool. + * @param aBitmapId bitmap identifier. + * @param aBitmapMaskId bitmap mask identifier, + * KErrNotFound if no mask. + * @param aExpectDefaultColor ETrue if default color is to be expected. + * @return bitmap pool identifier. + */ + TVtUiBitmapPoolId AddBitmapsL( + TVtUiBitmapId aBitmapId, + TVtUiBitmapId aBitmapMaskId, + TBool aExpectDefaultColor ); + + /** + * Adds bitmap to the pool.Note that this bitmap does not have mask. + * @param aBitmapId bitmap identifier. + * @param aExpectDefaultColor ETrue if default color is to be expected. + * @return bitmap pool identifier. + */ + TVtUiBitmapPoolId AddBitmapL( + TVtUiBitmapId aBitmapId, + TBool aExpectDefaultColor ); + + /** + * Removes bitmap from the pool. + * @param aId bitmap pool identifier. + */ + void RemoveBitmap( TVtUiBitmapPoolId aId ); + + /** + * Sets size of the specified bitmap. This method must be + * called before bitmap is used. + * + * @param aId bitmap pool identifier. + * @param aSize size of the bitmap. + */ + void SetSize( + TVtUiBitmapPoolId aId, + const TSize& aSize ); + + /** + * Sets size and default color of the specified bitmap. + * This method must be called before bitmap is used. + * + * @param aId bitmap pool identifier. + * @param aSize size of the bitmap. + * @param aDefaultColor default color of the bitmap. + */ + void SetSizeAndColor( + TVtUiBitmapPoolId aId, + const TSize& aSize, + const TRgb& aDefaultColor ); + + /** + * Sets aspect ratio preservation status. + * @param aId bitmap pool identifier. + * @param aPreserve ETrue if aspect ration is to be preserved. + */ + void SetAspectRatio( + TVtUiBitmapPoolId aId, + TBool aPreserve ); + + /** + * This method is called to inform that bitmap is required. + * @param aId bitmap pool identifier. + */ + void RequireBitmap( TVtUiBitmapPoolId aId ); + + /** + * Gets bitmap & its mask. + * @param aId bitmap pool identifier. + * @param aBitmap it will be updated to hold bitmap pointer, + * or NULL if bitmap is not available. This pointer + * must not be kept any longer than absolutely required. + * @param aBitmapMask it will be updated to hold bitmap mask pointer, + * or NULL if bitmap mask is not available. This pointer + * must not be kept any longer than absolutely required. + */ + void GetBitmaps( + TVtUiBitmapPoolId aId, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aBitmapMask ); + + /** + * Gets bitmap & its mask. + * @param aId bitmap pool identifier. + * @param aBitmap it will be updated to hold bitmap pointer, + * or NULL if bitmap is not available. This pointer + * must not be kept any longer than absolutely required. + */ + void GetBitmap( + TVtUiBitmapPoolId aId, + CFbsBitmap*& aBitmap ); + + /** + * Invalidates bitmaps. This is called on theme / layout change. + */ + void InvalidateBitmaps(); + + private: + + // Inner class. + class CBitmapInfo; + + /** + * Finds bitmap based on pool identifier. + * @param aId bitmap pool identifier. + * @return KErrNotFound if not found, or index to array. + */ + TInt Find( TVtUiBitmapPoolId aId ) const; + + private: + + // Owned array of bitmap information instances. + RPointerArray< CBitmapInfo > iBitmapArray; + + // Bitmap pool identifier used to generate bitmaps. + TVtUiBitmapPoolId iBitmapId; + + // Temporary instance for getting bitmap file name. + TFileName iTmpFileName; + + }; + +#endif // CVTUIBITMAPMANAGER_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiBlankControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiBlankControl.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2004 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: Blank control for Video Telephone application. +* +*/ + + + +#ifndef CVTUIBLANKCONTROL_H +#define CVTUIBLANKCONTROL_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* Blank control for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiBlankControl + : public CCoeControl + { + public: // Constructors and destructor + + /** + * C++ constructor. + */ + CVtUiBlankControl(); + + /** + * Symbian constructor. + * @param aRect control rectangle. + */ + void ConstructL( const TRect& aRect ); + + /** + * C++ destructor. + */ + ~CVtUiBlankControl(); + + public: // New functions + + /** + * Sets blanker active / inactive. + * @param aStatus ETrue if to be activated. + */ + void SetActive( TBool aStatus ); + + protected: // Functions from base classes + + /** + * From CCoeControl, handles key events. + * @param aKeyEvent key event. + * @param aType type of event. + */ + virtual TKeyResponse OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * From CCoeControl, draws the control. + * @param aRect area to be drawn. + */ + virtual void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl, handles size changes. + */ + virtual void SizeChanged(); + + /** + * From CCoeControl, handles position changes. + */ + virtual void PositionChanged(); + + private: + + // ETrue if blanker is active. + TBool iBlankerActive; + + }; + +#endif // CVTUIBLANKCONTROL_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiBlankDialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiBlankDialog.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2004 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: Blank dialog for Video Telephone application. +* +*/ + + + +#ifndef CVTUIBLANKDIALOG_H +#define CVTUIBLANKDIALOG_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* Blank dialog for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiBlankDialog + : public CEikDialog + { + public: // Constructors and destructor + + /** + * Constructor. + * + * @param aSelfPtr optional pointer to itself. + */ + CVtUiBlankDialog( CEikDialog** aSelfPtr ); + + /** + * Destructor. If a pointer was passed in constructor, + * it will be cleared here. + */ + ~CVtUiBlankDialog(); + + public: // New functions + + /** + * Executes blank dialog, no wait flag set. + */ + void ExecuteDialogNoWaitLD(); + + /** + * Executes blank dialog. + * @param aRequest request status, optional. + */ + void ExecuteDialogLD( + TRequestStatus* aRequest ); + + protected: // New functions + + /** + * Completes dialog with error. + * Note: this method will delete the dialog. + * @param aError error code. + */ + void Complete( const TInt aError ); + + protected: // Functions from base classes + + /** + * @see CEikDialog::PreLayoutDynInitL. + */ + void PreLayoutDynInitL(); + + /** + * @see CEikDialog::PostLayoutDynInitL. + */ + void PostLayoutDynInitL(); + + /** + * @see CEikDialog::OkToExitL. + */ + TBool OkToExitL( TInt aButtonId ); + + /** + * @see CEikDialog::Draw. + */ + void Draw( const TRect& aRect ) const; + + private: + + // Pointer to itself. + CEikDialog** iSelfPtr; + + // Error code. + TInt* iError; + + // Request status. + TRequestStatus* iRequest; + }; + +#endif // CVTUIBLANKDIALOG_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiContextControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiContextControl.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,167 @@ +/* +* Copyright (c) 2004, 2005 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: Context pane control for Video Telephone application. +* +*/ + + + +#ifndef CVTUICONTEXTCONTROL_H +#define CVTUICONTEXTCONTROL_H + +// INCLUDES +#include +#include "cvtuivideocontrolbase.h" + +// FORWARDS +class CVtUiAppUi; +class TVtUiStates; + +/** +* Context pane control for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiContextControl : public CVtUiVideoControlBase, + public MAknWsEventObserver + { + + public: // Constructors and destructor + + /** + * C++ constructor. + * @param aBitmapManager bitmap manager. + * @param aLargeViewfinder ETrue if large viewfinder wanted. + * @param aAppUi application UI. + * @param aUiStates UI states. + */ + static CVtUiContextControl* NewL( + CVtUiBitmapManager& aBitmapManager, + CVtUiAppUi& aAppUi, + TVtUiStates& aUiStates ); + + /** + * C++ destructor. + */ + ~CVtUiContextControl(); + + /** + * LayoutRemoteVideo + */ + void LayoutRemoteVideo(); + + public: // from CCoeControl + + /** + * @see CCoeControl::HandlePointerEventL + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + private: // from CVtUiVideoControlBase + + /** + * @see CVtUiVideoControlBase::HandleSizeChanged + */ + void HandleSizeChanged(); + + /** + * @see CVtUiVideoControlBase::DrawColoredBackground + */ + void DrawColoredBackground( CWindowGc& aGc ) const; + + /** + * @see CVtUiVideoControlBase::StreamBlitPosition + */ + TPoint StreamBlitPosition() const; + + /** + * @see CVtUiVideoControlBase::StreamBlitPosition + */ + TRect StreamClippingRect() const; + + /** + * @see CVtUiVideoControlBase::BlindImage + */ + CFbsBitmap* BlindImage() const; + + /** + * @see CVtUiVideoControlBase::BlindMask + */ + CFbsBitmap* BlindMask() const; + + /** + * @see CVtUiVideoControlBase::BlindBlitPosition + */ + TPoint BlindBlitPosition() const; + + public: // from MAknWsEventObserver + + /** + * @see MAknWsEventObserver::HandleWsEventL + */ + void HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ); + + private: + + /** + * C++ constructor. + */ + CVtUiContextControl( + CVtUiBitmapManager& aBitmapManager, + CVtUiAppUi& aAppUi, + TVtUiStates& aUiStates ); + + /** + * Symbian constructor. + */ + void ConstructL(); + + private: + + // Background icon identifier. + TVtUiBitmapPoolId iBackgroundId; + + // Blind icon identifier. + TVtUiBitmapPoolId iBlindId; + + // Blind icon mask identifier. + TVtUiBitmapPoolId iBlindMaskId; + + // Reference to application UI. + CVtUiAppUi& iAppUi; + + // Reference to UI states. + TVtUiStates& iUiStates; + + // Background bitmap layout. + TAknLayoutRect iBackGround; + + // Blind icon rect + TRect iBlindRect; + + // Stream rect + TRect iStreamRect; + + // ETrue if it is ok to swap images on button up + TBool iOkToSwapOnButtonUp; + + // ETrue if the pointer down inside of context control window + TBool iPointerButton1DownInside; + + }; + +#endif // CVTUICONTEXTCONTROL_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiDoc.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiDoc.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2004 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: Document class for Video Telephone application. +* +*/ + + + +#ifndef CVTUIDOC_H +#define CVTUIDOC_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* Document class for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiDoc + : public CAknDocument + { + public: // Constructors and destructor + + /** + * C++ constructor. + * @param aApp application instance. + */ + CVtUiDoc( CEikApplication& aApp ); + + public: // Functions from base classes + + /** + * From CAknDocument, creates application UI instance. + * @return application UI instance. + */ + virtual CEikAppUi* CreateAppUiL(); + + /** + * From CAknDocument, updates task name. + * @param aWgName window group name instance. + */ + virtual void UpdateTaskNameL( CApaWindowGroupName* aWgName ); + + }; + +#endif // CVTUIDOC_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiEndCallButton.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiEndCallButton.h Wed Sep 01 12:29:12 2010 +0100 @@ -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 f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiEndCallButtonPane.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiEndCallButtonPane.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,133 @@ +/* +* 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 ); + + public: + + /** + * Set end call button enabled or not. + */ + void SetEnabled( TBool aEnabled ); + + 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 f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiExecuteCmdDialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiExecuteCmdDialog.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2004 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: Dialog for command execution for Video Telephone application. +* +*/ + + + +#ifndef CVTUIEXECUTECMDDIALOG_H +#define CVTUIEXECUTECMDDIALOG_H + +// INCLUDES +#include "CVtUiBlankDialog.h" +#include + +// FORWARD DECLARATIONS +class MVtEngCommandHandler; +class MVtUiEngineCommandManager; + +// CLASS DECLARATION + +/** +* Dialog for command execution for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiExecuteCmdDialog + : public CVtUiBlankDialog, + private MVtEngCommandObserver + { + public: // Constructors and destructor + + /** + * Constructor. + * + * @param aSelfPtr optional pointer to itself. + * @param aCommandHandler command handler. + * @param aCommandManager command manager. + */ + CVtUiExecuteCmdDialog( + CEikDialog** aSelfPtr, + MVtEngCommandHandler& aCommandHandler, + MVtUiEngineCommandManager& aCommandManager ); + + /** + * Destructor. + */ + ~CVtUiExecuteCmdDialog(); + + public: // New functions + + /** + * Executes command dialog. + * @param aCommandId command identifier. + * @param aParams parameters. + * @param aRequest request status, optional. + */ + void ExecuteCmdLD( + const TVtEngCommandId aCommandId, + TDesC8* aParams, + TRequestStatus* aRequest ); + + protected: // Functions from base classes + + /** + * @see CVtUiBlankDialog::PostLayoutDynInitL. + */ + void PostLayoutDynInitL(); + + private: + + /** + * @see MVtEngCommandObserver::HandleVTCommandPerformedL. + */ + virtual void HandleVTCommandPerformedL( + TVtEngCommandId aCommand, + const TInt aError ); + + /** + * Handles execution failure. + * @param aResult error code. + */ + void HandleExecuteFailed( TInt aResult ); + + private: + + // Inner class. + class CActiveCmd; + + // Friend. + friend class CActiveCmd; + + // Ref to command handler. + MVtEngCommandHandler& iCommandHandler; + + // Ref to command manager. + MVtUiEngineCommandManager& iCommandManager; + + // Command to be executed. + TVtEngCommandId iCommand; + + // Owned parameters. + HBufC8* iCommandParams; + + // ETrue if command has been completed. + TBool iCommandCompleted; + + // Owned active object to perform the command. + CActiveCmd* iActiveCmd; + + }; + +#endif // CVTUIEXECUTECMDDIALOG_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiMainControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiMainControl.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 2004, 2005 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: Main pane control for Video Telephone application. +* +*/ + + + +#ifndef CVTUIMAINCONTROL_H +#define CVTUIMAINCONTROL_H + +// INCLUDES +#include "cvtuivideocontrolbase.h" + +// CLASS DECLARATION +class CVtUiAppUi; +class TVtUiStates; +class TAknTextLineLayout; + +/** +* Main pane control for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiMainControl : public CVtUiVideoControlBase + { + + public: // Constructors and destructor + + /** + * Constructor. + * @param aBitmapManager bitmap manager. + * @param aUiStates Ui states class. + */ + static CVtUiMainControl* NewL( CVtUiBitmapManager& aBitmapManager, + CVtUiAppUi& aAppUi, + TVtUiStates& aUiStates ); + + /** + * C++ destructor. + */ + ~CVtUiMainControl(); + + public: // New functions. + + /** + * Sets SQCif mode on/off. + * @param aIsSupported whether on/off + */ + void SupportSQCif( TBool aIsSupported ); + + /** + * LayoutRemoteVideo + */ + void LayoutRemoteVideo(); + + /** + * Get main control pointer event flag + * @return pointer event is from main control + */ + TBool IsMainControlPointerEvent(); + + public: // from CCoeControl + + /** + * @see CCoeControl::HandlePointerEventL + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + private: // from CVtUiVideoControlBase + + /** + * @see CVtUiContextControl::HandleSizeChanged + */ + void HandleSizeChanged(); + + /** + * @see CVtUiContextControl::DrawWaitingText + */ + TBool DrawWaitingText( CWindowGc& aGc ) const; + + /** + * @see CVtUiContextControl::StreamBlitPosition + */ + TPoint StreamBlitPosition() const; + + /** + * @see CVtUiContextControl::StreamClippingRect + */ + TRect StreamClippingRect() const; + + /** + * @see CVtUiContextControl::BlindImage + */ + CFbsBitmap* BlindImage() const; + + /** + * @see CVtUiContextControl::BlindMask + */ + CFbsBitmap* BlindMask() const; + + /** + * @see CVtUiContextControl::BlindBlitPosition + */ + TPoint BlindBlitPosition() const; + + /** + * @see CVtUiContextControl::WaitingTextLayout + */ + TAknTextLineLayout WaitingTextLayout( TInt aLine ); + + private: + + /** + * Private constructor. + */ + CVtUiMainControl( CVtUiBitmapManager& aBitmapManager, + CVtUiAppUi& aAppUi, + TVtUiStates& aUiStates ); + + /** + * C++ constructor. + * @param aBitmapManager bitmap manager. + */ + CVtUiMainControl(); + + /** + * Symbian constructor. + */ + void ConstructL(); + + private: + + // Background layout. + TAknLayoutRect iBackgroundLayout; + + // Blind icon identifier. + TVtUiBitmapPoolId iBlindId; + + // Blind icon mask identifier. + TVtUiBitmapPoolId iBlindMaskId; + + // Blind icon layout. + TAknLayoutRect iBlindLayout; + + // Stream layout. + TAknLayoutRect iStreamLayoutRect; + + // ETrue if sqcif is used in remote video. + TBool iSQCifRemote; + + // Reference to application UI. + CVtUiAppUi& iAppUi; + + // reference to uistates + TVtUiStates& iUiStates; + + // Main control pointer event flag + TBool iMCPointerEvent; + }; + +#endif // CVTUIMAINCONTROL_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiMutedControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiMutedControl.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2004 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: Navi pane control for Video Telephone application. +* +*/ + + + +#ifndef CVTUIMUTEDCONTROL_H +#define CVTUIMUTEDCONTROL_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** +* Navi pane control for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiMutedControl + : public CCoeControl + { + public: // Constructors and destructor + + /** + * C++ constructor. + */ + CVtUiMutedControl(); + + /** + * Symbian constructor. + */ + void ConstructL(); + + /** + * C++ destructor. + */ + ~CVtUiMutedControl(); + + public: // Functions from base classes + + /** + * From CCoeControl, handles resource change. + * @param aType type of change. + */ + virtual void HandleResourceChange( + TInt aType ); + + protected: // Functions from base classes + + /** + * From CCoeControl, draws the control. + * @param aRect area to be drawn. + */ + virtual void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl, handles size changes. + */ + virtual void SizeChanged(); + + /** + * From CCoeControl, handles position changes. + */ + virtual void PositionChanged(); + + /** + * From CCoeControl, returns amount of component controls. + * @return amount of component controls. + */ + virtual TInt CountComponentControls() const; + + /** + * From CCoeControl, returns specified control. + * @param aIndex index of control. + * @return control. + */ + virtual CCoeControl* ComponentControl( + TInt aIndex ) const; + + private: + + // Owned muted label. + CEikLabel* iMutedLabel; + + }; + +#endif // CVTUIMUTEDCONTROL_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiNaviPane.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiNaviPane.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,219 @@ +/* +* Copyright (c) 2004, 2005 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: Controller for navi pane for Video Telephone application. +* +*/ + + + +#ifndef CVTUINAVIPANE_H +#define CVTUINAVIPANE_H + +// INCLUDES +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CAknNavigationControlContainer; +class CAknNavigationDecorator; +class CVtUiNaviPaneControl; +class CVtUiMutedControl; +class CVtUiAppUi; + +// CONSTANTS + +// Minimum volume. +const TInt KVtUiVolumeMinimum = 0; + +// Maximum volume. +const TInt KVtUiVolumeMaximum = 10; + +// CLASS DECLARATION + +/** +* Controller for navi pane for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiNaviPane : public CActive + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aNaviPane reference to navipane. + * @param aAppUi application UI. + */ + static CVtUiNaviPane* NewL( + CAknNavigationControlContainer& aNaviPane, + CVtUiAppUi& aAppUi ); + + /** + * C++ destructor. + */ + ~CVtUiNaviPane(); + + public: // New functions + + /** + * Updates current speaker. + * @param aLoudspeaker Loudspeaker if ETrue, handset otherwise. + */ + void SetCurrentSpeaker( + const TBool aLoudspeaker ); + + /** + * Changes muted status. + * @param aStatus status. + */ + void SetMuted( + const TBool aStatus ); + + /** + * Updates call duration. + * @param aDuration current duration. + * @param aEnabled ETrue if call duration enabled. + */ + void SetCallDuration( + const TTimeIntervalSeconds& aDuration, + const TBool aEnabled ); + + /** + * Commits changes. This method should be called after above + * Set* methods to make sure that display is up to date. + */ + void CommitL(); + + /** + * Gets speaker volume. + * @param aLoudspeaker ETrue if loudspeaker, EFalse if handset. + * @param aValue it will be updated to contain volume of the speaker. + */ + void GetSpeakerVolume( + const TBool aLoudspeaker, + TInt& aValue ) const; + + /** + * Handles resource changes. + * @param aType type of change. + */ + void HandleResourceChange( + TInt aType ); + + protected: // From base classes + + /** + * Called by CActive when operation needs to be canceled. + */ + void DoCancel(); + + /** + * Called by CActiveScheduler when operation has been + * finished. + */ + void RunL(); + + private: + + /** + * C++ constructor. + * @param aNaviPane navipane instance. + * @param aAppUi application UI. + */ + CVtUiNaviPane( + CAknNavigationControlContainer& aNaviPane, + CVtUiAppUi& aAppUi ); + + /** + * Symbian constructor. + */ + void ConstructL(); + + /** + * Pushes indicators after timeout. + */ + void PushAfterTimeout(); + + /** + * Pushes new decorator to navi pane replacing the + * previous one. + * @param aNew new to replace the old one. + */ + void PushL( CAknNavigationDecorator* aNew ); + + /** + * Returns indicator that should be used currently. + * @return indicator to be shown. + */ + CAknNavigationDecorator* DefaultIndicator() const; + + private: + + // Slider types in navipane + enum TSliderControlType + { + ENone, + EZoom, // Zoom control visible + EVolume // Volume control visible + }; + + + // Holds current slider type + TSliderControlType iSliderType; + + // Ref to navi pane. + CAknNavigationControlContainer& iNaviPane; + + // Ref to top navi pane element. + CAknNavigationDecorator* iCurrent; + + // Owned controller for call duration + CAknNavigationDecorator* iMainIndicators; + + // Reference to navi pane control. + CVtUiNaviPaneControl* iNaviPaneControl; + + // Owned muted indicator. + CAknNavigationDecorator* iMutedIndicator; + + // Reference to muted control. + CVtUiMutedControl* iMutedControl; + + // Owned timer instance. + RTimer iTimer; + + // ETrue if call duration was enabled. + TBool iOldCallDurationEnabled; + + // ETrue if call duration is enabled. + TBool iCallDurationEnabled; + + // ETrue if loudspeaker, EFalse if handset. + TBool iLoudspeaker; + + // Old microphone status. + TBool iOldMicrophoneMuted; + + // ETrue if microphone is muted. + TBool iMicrophoneMuted; + + // Reference to application UI. + CVtUiAppUi& iAppUi; + }; + +#endif // CVtUiNaviPane_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiNaviPaneControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiNaviPaneControl.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2004, 2005 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: Navi pane control for Video Telephone application. +* +*/ + + + +#ifndef CVTUINAVIPANECONTROL_H +#define CVTUINAVIPANECONTROL_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// Maximum length of call duration buffer. +const TInt KVtUiCallDurationBufferLength = 16; + +// FORWARD DECLARATIONS +class CVtUiNaviPane; + +// CLASS DECLARATION + +/** +* Navi pane control for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiNaviPaneControl + : public CCoeControl + { + public: // Constructors and destructor + + /** + * C++ constructor. + * @param aNaviPane eference to navipane. + */ + CVtUiNaviPaneControl( CVtUiNaviPane& aNaviPane ); + + /** + * Symbian constructor. + */ + void ConstructL(); + + /** + * C++ destructor. + */ + ~CVtUiNaviPaneControl(); + + public: // New functions + + /** + * Sets call duration. + * @param aDuration call duration. + * @param aEnabled ETrue if enabled. + */ + void SetCallDuration( + const TTimeIntervalSeconds& aDuration, + const TBool aEnabled ); + + /** + * Updates screen to reflect changes. + */ + void CommitL(); + + protected: // Functions from base classes + + /** + * From CCoeControl, draws the control. + * @param aRect area to be drawn. + */ + virtual void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl, handles size changes. + */ + virtual void SizeChanged(); + + /** + * From CCoeControl, handles position changes. + */ + virtual void PositionChanged(); + + private: + + /** + * Gets call duration text. + * @return reference to text. + */ + const TDesC& GetCallDurationText() const; + + /** + * Appends character to the buffer. + * @param aBuffer buffer. + * @param aChar character. + */ + static void AppendChar( + TDes& aBuffer, + const TChar& aChar ); + + /** + * Appends a number to the buffer. + * @param aBuffer buffer. + * @param aNumber number, 0 .. 99. + */ + static void AppendNum( + TDes& aBuffer, + const TInt aNumber ); + + private: + + // Call duration layout. + TAknLayoutText iCallDurationLayout; + + // ETrue if call duration is enabled. + TBool iCallDurationEnabled; + + // Duration in seconds. + TTimeIntervalSeconds iCallDuration; + + // Buffer for call duration. + mutable TBuf< KVtUiCallDurationBufferLength > iCallDurationBuffer; + + // Current speaker, ETrue if loudspeaker, EFalse if handset. + TBool iLoudspeaker; + + // Reference to navipane. + CVtUiNaviPane& iNaviPane; + + }; + +#endif // CVTUINAVIPANECONTROL_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiNumberEntryActivationControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiNumberEntryActivationControl.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2004 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: Number entry activation control for +* Video Telephone application. +* +*/ + + + +#ifndef CVTUINUMBERENTRYACTIVATIONCONTROL_H +#define CVTUINUMBERENTRYACTIVATIONCONTROL_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CVtUiAppUi; + +// CLASS DECLARATION + +/** +* Number entry activation control for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiNumberEntryActivationControl + : public CCoeControl + { + public: // Constructors and destructor + + /** + * C++ constructor. + * @param aAppUi application ui. + */ + CVtUiNumberEntryActivationControl( CVtUiAppUi& aAppUi ); + + /** + * Symbian constructor. + * @param aRect initial area. + */ + void ConstructL( const TRect& aRect ); + + /** + * C++ destructor. + */ + ~CVtUiNumberEntryActivationControl(); + + public: // Functions from base classes + + /** + * @see CCoeControl::SizeChanged. + */ + virtual void SizeChanged(); + + /** + * @see CCoeControl::PositionChanged. + */ + virtual void PositionChanged(); + + /** + * @see CCoeControl::Draw. + */ + virtual void Draw( const TRect& aRect ) const; + + /** + * @see CCoeControl::OfferKeyEventL. + */ + virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + public: // New functions + + /** + * Set control's activation status. + * @param aIsActive ETrue if key events should + * be handled oterherwise EFalse. + */ + void SetActive( TBool aIsActive ); + + private: + + /** + * Checks if event should open number entry. + * @param aKeyEvent event. + * @param aDtmfTone event as character tone. + * @return ETrue if number entry should be opened. + */ + static TBool IsNumericEvent( + const TKeyEvent& aKeyEvent, + TChar& aDtmfTone ); + + private: + + // Reference to application ui. + CVtUiAppUi& iAppUi; + + // ETrue if this control has been added to stack. + TBool iAddedToStack; + + // ETrue if key events should be handled oterherwise EFalse. + TBool iIsActive; + + }; + +#endif // CVTUINUMBERENTRYACTIVATIONCONTROL_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiRemoteVideoControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiRemoteVideoControl.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2006 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: class for Remote Video Control. +* +*/ + +#ifndef CVTUIREMOTEVIDEOCONTROL_H_ +#define CVTUIREMOTEVIDEOCONTROL_H_ + +#include +#include + +class CVtUiVideoControlBase; +class CVtUiAppUi; + +/** + * CVtUiRemoteVideoControl + * + * Remote Video control. + * + * @since S60 v5.0 + */ +class CVtUiRemoteVideoControl : public CCoeControl, + public MAknWsEventObserver + { +public: + + /** + * Static Constructor. + */ + static CVtUiRemoteVideoControl* NewL(CVtUiAppUi& aAppUi); + + RWindow& GetRWindow(); + + /** + * Destructor + */ + ~CVtUiRemoteVideoControl(); + +protected: + + /** + * Constructor + */ + CVtUiRemoteVideoControl(CVtUiAppUi& aAppUi); + + /** + * 2nd constructor + */ + void ConstructL(); + +public: // from CCoeControl + + /** + * @see CCoeControl::HandlePointerEventL + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + +public: // from MAknWsEventObserver + + /** + * @see MAknWsEventObserver::HandleWsEventL + */ + void HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ); + +protected: // virtual methods + + /** + * The size changed method. If you need to do special handling after the + * control's size has changed, overwrite this method. + */ + virtual void HandleSizeChanged(); + +private: // from CCoeControl + /** + * @see CCoeControl::Draw + */ + void Draw( const TRect& aRect ) const; + + /** + * @see CCoeControl::SizeChanged + */ + void SizeChanged(); + + /** + * @see CCoeControl::PositionChanged + */ + void PositionChanged(); + + /** + * The draw method. + */ + void DoDraw( CWindowGc& aGc ) const; + +private: + + // Reference to application UI. + CVtUiAppUi& iAppUi; + + + }; + +#endif /*CVTUIREMOTEVIDEOCONTROL_H_*/ diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/CVtUiZoomControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/CVtUiZoomControl.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,268 @@ +/* +* Copyright (c) 2004, 2005 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: Navi pane zoom indicator control for +* Video Telephone application. +* +*/ + + + +#ifndef CVTUIZOOMCONTROL_H +#define CVTUIZOOMCONTROL_H + +// INCLUDES +#include +#include +#include "CVtUiBitmapManager.h" + +// CLASS DECLARATION + +/** +* Navi pane zoom indicator control for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiZoomControl + : public CCoeControl + { + public: // Constructors and destructor + + /** + * C++ constructor. + * @param aBitmapManager bitmap manager. + */ + CVtUiZoomControl( CVtUiBitmapManager& aBitmapManager ); + + /** + * Symbian constructor. + */ + void ConstructL(); + + /** + * C++ destructor. + */ + ~CVtUiZoomControl(); + + public: // New functions + + /** + * Sets zoom parameters. + * @param aStepCount amount of steps, 0 if zooming disabled. + * @param aCurrentStep current step, 0 .. aStepCount. + */ + void SetZoomParams( + const TInt aStepCount, + const TInt aCurrentStep ); + + /** + * Commits changes. + */ + void CommitL(); + + /** + * Returns ETrue if zooming is enabled. + * @return ETrue if enabled. + */ + TBool IsZoomEnabled() const; + + /** + * Gets zoom parameters. + * @param aStepCount amount of steps, 0 if zooming disabled. + * @param aCurrentStep current step, 0 .. aStepCount. + */ + void GetZoomParams( + TInt& aStepCount, + TInt& aCurrentStep ) const; + + /** + * Updates zoom. This method should be called periodically during zooming. + * @return ETrue if zoom step was updated. + */ + TBool UpdateZoomL(); + + /** + * Stops zoom. + */ + void StopZoom(); + + public: // Functions from base classes + + /** + * From CCoeControl, handles key events. + * @param aKeyEvent key event. + * @param aType type of event. + * @return response indicating if key was consumed. + */ + virtual TKeyResponse OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * From CCoeControl, handles resource change. + * @param aType type of change. + */ + virtual void HandleResourceChange( + TInt aType ); + + protected: // Functions from base classes + + /** + * From CCoeControl, draws the control. + * @param aRect area to be drawn. + */ + virtual void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl, handles size changes. + */ + virtual void SizeChanged(); + + /** + * From CCoeControl, handles position changes. + */ + virtual void PositionChanged(); + + private: + + /** + * Calculates amount of steps to be shown. + * @param aFullSteps amount of full steps. + * @param aPartialStep partial steps, 0 .. 255. + */ + void DetermineSteps( + TInt& aFullSteps, + TInt& aPartialStep ) const; + + /** + * Generates zoom mask bitmap. + * @param aAreaBitmap maximum bitmap, ownership not transferred. + * @param aPartial partial amount. + * @param aRow area row number. + * @param aRowSize size of the row. + * @return ETrue if successful, EFalse otherwise. + */ + TBool GenerateZoomMaskBitmap( + CFbsBitmap* aMaskBitmap, + const TInt aPartial, + const TInt aRow, + const TSize& aRowSize ) const; + + /** + * Generates zoom mask bitmap. + * @param aAreaBitmap maximum bitmap, ownership not transferred. + * @param aPartial partial amount. + * @param aRow area row number. + * @param aRowSize size of the row. + */ + void DoGenerateZoomMaskBitmap( + CFbsBitmap* aMaskBitmap, + const TInt aPartial, + const TInt aRow, + const TSize& aRowSize ) const; + + /** + * Creates bitmaps. + * @return error code. + */ + TInt CreateBitmaps(); + + /** + * Creates bitmaps. + */ + void CreateBitmapsL(); + + /** + * Returns size of the temporary bitmaps. + * @return size of the temporary bitmaps. + */ + TSize SizeOfBitmap() const; + + /** + * Gets position and source rect. + * @param aPosition it will contain position. + * @param aSourceRect it will contain source rectangle. + * @param aZoomStep zoom step. + */ + void GetPositionAndRect( + TPoint& aPosition, + TRect& aSourceRect, + const TInt aZoomStep ) const; + + private: + + // Inner class. + class CBitmap; + + // Reference to bitmap manager. + CVtUiBitmapManager& iBitmapManager; + + // Zoom direction bitmap identifier. + TVtUiBitmapPoolId iZoomDirId; + + // Zoom area bitmap identifier. + TVtUiBitmapPoolId iZoomAreaId; + + // Zoom min bitmap identifier. + TVtUiBitmapPoolId iZoomMinId; + + // Zoom max bitmap identifier. + TVtUiBitmapPoolId iZoomMaxId; + + // Zoom pane rectangle. + TRect iZoomPaneRect; + + // Zoom direction layout. + TAknLayoutRect iZoomDirLayout; + + // Zoom area layout. + TAknLayoutRect iZoomAreaLayout; + + // Current step, 0 .. iMaxZoomStep. + TInt iCurrentZoomStep; + + // Maximum step. + TInt iMaxZoomStep; + + // Used partial value used in iZoomMaskBitmap + // generation. + mutable TInt iZoomMaskPartial; + + // Used row value used in iZoomMaskBitmap + // generation. + mutable TInt iZoomMaskRow; + + // Owned partial soft mask. + CBitmap* iZoomPartialMask; + + // Owned partial shade (soft mask). + CBitmap* iZoomPartialShade; + + // Owned partial shade mask. + CBitmap* iZoomPartialShadeMask; + + // Zoom direction +1 or -1. 0 if no + // zoom ongoing. + TInt iZoomDirection; + + // Zoom step at the start of zooming. + TInt iZoomStepStart; + + // Start time of zooming. + TTime iZoomStartTime; + + }; + +#endif // CVTUIZOOMCONTROL_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/MVtUiEngineCommandManager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/MVtUiEngineCommandManager.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2004 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: Command manager class for Video Telephone application. +* +*/ + + + +#ifndef MVTUICOMMANDMANAGER_H +#define MVTUICOMMANDMANAGER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MVtEngCommandObserver; + +// CLASS DECLARATION + +/** +* Command manager class for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class MVtUiEngineCommandManager + { + public: // New functions + + /** + * Adds observer. + * @param aObserver observer to be added. + */ + virtual void AddObserverL( MVtEngCommandObserver& aObserver ) = 0; + + /** + * Removes observer. + * @param aObserver observer to be removed. + */ + virtual void RemoveObserver( MVtEngCommandObserver& aObserver ) = 0; + + }; + +#endif // MVTUICOMMANDMANAGER_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/MVtUiVideoWindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/MVtUiVideoWindow.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2004 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: Interface for controlling a video window +* for Video Telephone application. +* +*/ + + + +#ifndef MVTUIVIDEOWINDOW_H +#define MVTUIVIDEOWINDOW_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CFbsBitmap; + +// CLASS DECLARATION + +/** +* Interface for controlling a video window (uplink / downlink) for Video +* Telephone application. +* +* @since Series 60 2.6 +*/ +class MVtUiVideoWindow + { + public: // New functions + + /** + * Resets blind, stream bitmap and waiting image statuses. + */ + virtual void Reset() = 0; + + /** + * Changes blind status. + * @param aStatus new status, ETrue - on, EFalse - off. + */ + virtual void SetBlind( TBool aStatus ) = 0; + + /** + * Sets stream bitmap. + * @param aStreamBitmap bitmap. Ownership not transferred. + */ + virtual void SetStreamBitmap( CFbsBitmap* aStreamBitmap ) = 0; + + /** + * Sets stream bitmap for reserve, when Draw() routine is called. + * (e.g. when opening and closing menu) + * @param aStreamBitmap bitmap. Ownership not transferred. + */ + virtual void SetStreamBitmapReserve( CFbsBitmap* aStreamBitmap ) = 0; + + /** + * Sets waiting image status. + * @param aShowWaitingText ETrue if waiting text should be shown. + */ + virtual void SetWaiting( TBool aShowWaitingText ) = 0; + + /** + * Redraws image. + */ + virtual void Redraw() = 0; + + /** + * Set remote video control + */ + virtual void SetRemoteVideoControl( CCoeControl* aRemoteControl ) = 0; + + /** + * Layout the postion and the size of the remote video control + */ + virtual void LayoutRemoteVideo() = 0; + + /** + * Returns pointer to remote video control or NULL if no remote video control is present. + */ + virtual CCoeControl * RemoteVideoControl() = 0; + + }; + +#endif // CVTUICONTEXTCONTROL_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/TVtUiCallParameters.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/TVtUiCallParameters.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2004 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: Call parameters class for Video Telephone application. +* +*/ + + + +#ifndef TVTUICALLPARAMETERS_H +#define TVTUICALLPARAMETERS_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* Call parameters for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class TVtUiCallParameters + { + public: // Constructors and destructor + + /** + * C++ constructor. + */ + TVtUiCallParameters(); + + public: // New functions + + /** + * Resets parameters. + */ + void Reset(); + + /** + * Sets audio status. + * @param aEnabled ETrue if audio enabled, EFalse if disabled. + */ + void SetAudioStatus( const TBool aEnabled ); + + /** + * Gets audio status. + * @param aEnabled It will equal to ETrue if audio enabled, + * EFalse if disabled. + * @return error code, + * KErrNone if audio status has been set, + * KErrNotFound if not. + */ + TInt GetAudioStatus( TBool& aEnabled ) const; + + /** + * Sets video status. + * @param aEnabled enabled status. + */ + void SetVideoStatus( const TBool aEnabled ); + + /** + * Gets video status. + * @param aEnabled It will equal to ETrue if video enabled, + * EFalse if disabled. + * @return error code, + * KErrNone if video status has been set, + * KErrNotFound if not. + */ + TInt GetVideoStatus( TBool& aEnabled ); + + /** + * Sets selected camera. + * @param aPrimary ETrue if primary, EFalse if secondary. + */ + void SetSelectedCamera( const TBool aPrimary ); + + /** + * Gets selected camera. + * @param aPrimary It will equal to ETrue if primary has been selected, + * EFalse if secondary. + * @return error code, + * KErrNone if selected camera has been set, + * KErrNotFound if not. + */ + TInt GetSelectedCamera( TBool& aPrimary ); + + private: + + // Current flags. + TInt iFlags; + + }; + +#endif // TVTUICALLPARAMETERS_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/VideoTelephonyInternalCRKeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/VideoTelephonyInternalCRKeys.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2005-2006 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: Video Telephony internal Central Repository keys +* +*/ + + +#ifndef VIDEOTELEPHONYINTERNALCRKEYS_H +#define VIDEOTELEPHONYINTERNALCRKEYS_H + +#include + +/** +* Video Telephony Variation API +* Keys under this category are used in defining video telephony variation. +*/ +const TUid KCRUidVTVariation = {0x102072D0}; + +/** +* Video Telephony Local Variation Flags. Values are defined in +* VideoTelephonyVariant.hrh. +*/ +const TUint32 KVTLocalVariationFlags = 0x00000001; + +/** +* Video Telephony Configuration API +* Keys under this category are used for configuring video call behaviour. +* @since S60 3.1 +*/ +const TUid KCRUidVTConfiguration = {0x10281872}; + +/** +* This key controls minimum, normal and maximum frame rate for video encoder. +* Integer values in the string are between 0 and 31 separated by space. +* Example for key value is "5 10 5". +*/ +const TUint32 KVTVideoFrameRates = 0x00000001; + +/** +* Defines layout (screen orientation) used by Video Telephone application +* per active camera. Each camera has one of the following configurations: +* 1) "LS" = Landscape +* 2) "PR" = Portrait +* 3) "OL" = Obey device layout (normal operation) +* Camera values are: +* 1) "C1" = VT primary camera (inwards) +* 2) "C2" = VT secondary camera (outwards) +* Example value (portrait for cam1, landscape for cam2): C1:PR C2:LS +*/ +const TUint32 KVTCameraLayout = 0x00000002; + +/** +* Lists implementation UIDs for MPEG4, H.263 and H.264 encoders for video +* telephony in hexadecimal separated by space +*/ +const TUint32 KVTVideoEncoderUIDs = 0x00000003; + +/** +* Lists implementation UIDs for MPEG4, H.263 and H.264 decoders for video +* telephony in hexadecimal separated by space +*/ +const TUint32 KVTVideoDecoderUIDs = 0x00000004; + +/** +* Lists implementation UIDs for AMR-NB and future audio encoders for video +* telephony (in hex, separated by space) +*/ +const TUint32 KVTAudioEncoderUIDs = 0x00000005; + +/** +* Lists implementation UIDs for AMR-NB and future audio decoders for video +* telephony (in hex, separated by space) +*/ +const TUint32 KVTAudioDecoderUIDs = 0x00000006; + +/** +* Lists processing delay for MPEG4, H.263 and H.264 encoders for video +* telephony in unsigned 32-bit integers separated by space +*/ +const TUint32 KVTVideoEncoderDelay = 0x00000007; + +/** +* Lists processing delay for MPEG4, H.263 and H.264 decoders for video +* telephony in unsigned 32-bit integers separated by space +*/ +const TUint32 KVTVideoDecoderDelay = 0x00000008; + +/** +* Lists processing delay for AMR-NB and future audio encoders for video +* telephony (in unsigned 32-bit integers, separated by space) +*/ +const TUint32 KVTAudioEncoderDelay = 0x00000009; + +/** +* Lists processing delay for AMR-NB and future audio decoders for video +* telephony (in unsigned 32-bit integers, separated by space) +*/ +const TUint32 KVTAudioDecoderDelay = 0x0000000A; + +/* +* Defines number of toolbar buttons. Three buttons is minimum +* and seven is maximum. +*/ +const TUint32 KVTToolbarCommands = 0x0000000B; + +#endif // VIDEOTELEPHONYINTERNALCRKEYS_H + +// End of file \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/VideoTelephonyVariant.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/VideoTelephonyVariant.hrh Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2005 - 2008 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: Bit flag definitions for VT local variation. +* +*/ + + +#ifndef VIDEOTELEPHONYVARIANT_HRH +#define VIDEOTELEPHONYVARIANT_HRH + + +/** +* KVTLVFlagScalingMethodENearest defines whether the video image is +* scaled using Nearest algorithm, which is fast, but quality is low. +* When the flag is set ENearest is used. +* @since S60 v2.8 +*/ +#define KVTLVFlagScalingMethodENearest 0x00000001 + +/** +* KVTLVFlagScalingMethodEBilinear defines whether the video image is +* scaled using Bilinear algorithm, which offers the best quality, but in a +* slow way. When the flag is set Bilinear is used. +* @since S60 v2.8 +*/ +#define KVTLVFlagScalingMethodEBilinear 0x00000002 + +/** +* KVTLVFlagEnableBitReversal defines if bit order should be +* reversed in PV. +* When the flag is set bit order is reversed. +*/ +#define KVTLVFlagEnableBitReversal 0x00000004 + +/** +* KVTLVFlagEnableAMR_WB defines if AMR wideband is supported in video calls. +* @since S60 v5.0 +*/ +#define KVTLVFlagEnableAMR_WB 0x00000008 + +/** +* KVTLVFlagSupportMpeg4 defines whether the PV should support Mepg4. +* @since S60 v5.0 +*/ +#define KVTLVFlagDisableMpeg4 0x00000010 + +#endif // VIDEOTELEPHONYVARIANT_HRH + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/VtUiLayout.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/VtUiLayout.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,241 @@ +/* +* Copyright (c) 2004, 2005 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: Layout related accessory methods for Video Telephone +* application. +* +*/ + + + +#ifndef VTUILAYOUT_H +#define VTUILAYOUT_H + +// INCLUDES +#include "videotelui.hrh" +#include +#include + +// FORWARD DECLARATIONS +class TAknsItemID; + +// CLASS DECLARATION + +/** +* Layout related accessory methods for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class VtUiLayout + { + public: // New functions + + /** + * Returns application window rectangle. + * @param aRect rectangle to be filled. + */ + static void GetApplicationParentRect( + TRect& aRect ); + + // ELEMENTS RELATIVE TO APPLICATION WINDOW: + + /** + * Returns main pane layout. + * @param aLayout main pane layout. + */ + static void GetMainPaneLayout( + TAknWindowLineLayout& aLayout ); + + // ELEMENTS RELATIVE TO APPLICATION WINDOW: + + /** + * Returns layout for uplink video stream background. + * @param aLayout layout of qgn_graf_call_video_out_bg. + */ + static void GetFirstWindowBackgroundLayout( + TAknWindowLineLayout& aLayout ); + + /** + * Returns layout for uplink video stream. + * @param aLayout layout of uplink video stream relative. + */ + static void GetFirstWindowStreamLayout( + TAknWindowLineLayout& aLayout ); + + /** + * Returns layout of uplink video disabled icon. + * @param aLayout layout of qgn_indi_call_video_blind_out. + */ + static void GetFirstWindowStreamDisabledIconLayout( + TAknWindowLineLayout& aLayout ); + + // ELEMENTS RELATIVE TO MAIN PANE: + + /** + * Returns layout of background rectangle. + * @param aLayout layout of background rectangle. + */ + static void GetSecondWindowBackgroundLayout( + TAknWindowLineLayout& aLayout ); + + /** + * Returns layout of downlink video stream. + * @param aLayout layout of downlink video stream. + * @param aUseSQCif ETrue if SQCIF layout is to be used. + */ + static void GetSecondWindowStreamLayout( + TAknWindowLineLayout& aLayout, + TBool aIsToolbar, + TBool aIsSubQCIF = EFalse ); + + /** + * Returns layout of downlink video stream (the whole picture). + * @param aLayout layout of downlink video stream. + * @param aUseSQCif ETrue if SQCIF layout is to be used. + */ + static void GetSecondWindowStreamWholeLayout( + TAknWindowLineLayout& aLayout, + TBool aIsToolbaraIsToolbar, + TBool aIsSubQCIF = EFalse ); + + /** + * Returns layout of downlink video disabled icon. + * @param aLayout layout of qgn_indi_call_video_blind_in. + */ + static void GetSecondWindowDisabledIconLayout( + TAknWindowLineLayout& aLayout ); + + /** + * Returns layout of waiting text. + * @param aLayout layout. + * @param aFirstLine ETrue if first line, EFalse if second. + */ + static void GetSecondWindowWaitingTextLayout( + TAknTextLineLayout& aLayout, + const TBool aFirstLine ); + + /** + * Returns number entry area layout. + * @param aLayout layout. + */ + static void GetNumberEntryAreaLayout( + TAknWindowLineLayout& aLayout ); + + // ELEMENTS RELATIVE TO NAVI PANE: + + /** + * Returns layout of audio routing indicator. + * @param aLayoutlayout of qgn_indi__[muted]. + */ + static void GetAudioRoutingIconLayout( + TAknWindowLineLayout& aLayout ); + + /** + * Returns layout of call duration text. + * @param aLayout layout of call duration text. + */ + static void GetCallDurationTextLayout( + TAknTextLineLayout& aLayout ); + + /** + * Returns layout of muted text. + * @param aLayout layout of muted text. + */ + static void GetMutedTextLayout( + TAknTextLineLayout& aLayout ); + + /** + * Gets zooming pane layout. + * @param aLayout layout of zooming pane. + */ + static void GetZoomPaneLayout( + TAknWindowLineLayout& aLayout ); + + // ELEMENTS RELATIVE TO ZOOMING PANE: + + /** + * Gets zoom direction icon layout. + * @param aLayout layout of zoom direction icon. + */ + static void GetZoomDirLayout( + TAknWindowLineLayout& aLayout ); + + /** + * Gets zoom area layout. + * @param aLayout layout of zoom area. + */ + static void GetZoomAreaLayout( + TAknWindowLineLayout& aLayout ); + + /** + * Gets zoom step layout. + * @param aLayout layout of a zoom step. + * @param aZoomStep zoom step, 1 .. 11. + */ + static void GetZoomStepLayout( + TAknWindowLineLayout& aLayout, + TInt aZoomStep ); + + // OTHER UTILITY METHODS + + /** + * Returns skin identifier corresponding to the bitmap. + * + * @param aId identifier of the bitmap. + * @return skin identifier or KAknsIIDNone if no skin for this bitmap. + */ + static TAknsItemID MapBitmapToSkinId( TVtUiBitmapId aId ); + + /** + * Determines color skin identifier corresponding to the bitmap. + * + * @param aId bitmap identifier. + * @param aColorId it will contain color skin id. + * @param aColorIndex it will contain color index. + * @return ETrue if bitmap has color skin, EFalse otherwise. + */ + static TBool MapBitmapToColorId( + TVtUiBitmapId aId, + TAknsItemID& aColorId, + TInt& aColorIndex ); + + /** + * Resolves file name and index from bitmap identifier. + * @param aId bitmap identifier. + * @param aFileName it will contain the name of the file. + * @param aIndex it will contain the index. + */ + static void Resolve( + TVtUiBitmapId aId, + TFileName& aFileName, + TInt& aIndex ); + + /** + * Can be used for checking current orientation. + * @return ETrue if current application orientation is landscape, + * EFalse otherwise. + */ + static TBool IsLandscapeOrientation(); + + /** + * Returns end call button pane layout. + * @param aLayout end call button pane layout. + */ + static void GetButtonPaneLayout( + TAknWindowLineLayout& aLayout ); + + }; + +#endif // VTUILAYOUT_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/VtUiPanic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/VtUiPanic.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2004 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: Panic methods and reasons for Video Telephone application. +* +*/ + + + +#ifndef VTUIPANIC_H +#define VTUIPANIC_H + +// INCLUDES +#include + +// DATA TYPES + +/** +* Enumerates all panic reasons. +*/ +enum TVtUiPanicReason + { + // Invalid index passed to VtUiLayout::Resolve. + EVtUiPanicInvalidBitmapId = 10, + // Invalid bitmap file in VtUiLayout::Resolve. + EVtUiPanicInvalidBitmapFile = 11, + // Reset must not fail. + EVtUiPanicResetFailed = 12, + // Communication not supported. + EVtUiPanicCommsNotSupported = 13, + // EIKON server handle not found. + EVtUiPanicEikonServerNotFound = 14, + // Prepare view finder not supported. + EVtUiPanicPrepareViewFinderNotSupported = 15, + // Prepare remote render not supported. + EVtUiPanicPrepareRemoteRenderNotSupported = 16, + // Mismatch in bitmap file names. + EVtUiPanicMismatchInBitmapFileNames = 17, + // Default color requirement mismatch. + EVtUiPanicDefaultColorRequireMismatch = 18, + // Application shutdown has timeouted. + EVtUiPanicApplicationShutdownTimeout = 100, + // Engine functionality does not match with required. + EVtUiPanicEngineFunctionalityAssert = 101, + // Renderer instance is not available + EVtUiPanicRendererNotFound = 200, + // Values out of range + EVtUiPanicOutOfRange = 300 + }; + +// CLASS DECLARATION + +/** +* Panic methods and reasons for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class VtUiPanic + { + public: // New functions + + /** + * Panics this process. + * @param aReason reason of panic. + */ + static void Panic( + TVtUiPanicReason aReason ); + + }; + +#endif // VTUIPANIC_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/VtUiUtility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/VtUiUtility.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 2004 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: Utility methods for Video Telephone application. +* +*/ + + + +#ifndef VTUIUTILITY_H +#define VTUIUTILITY_H + +// INCLUDES +#include +#include +#include +#include + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Utility methods for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class VtUiUtility + { + public: // New functions + + /** + * Enumerates audio routing masks. + */ + enum TAudioRoutingMask + { + // Deactivate loudspeaker. + EDeactivateLoudspeaker = (1<<0), + // Activate loudspeaker. + EActivateLoudspeaker = (1<<1), + // Deactivate BT handsfree. + EDeactivateBtHandsfree = (1<<2), + // Activate BT handsfree. + EActivateBtHandsfree = (1<<3) + }; + + /** + * Gets audio routing availabilities. + * @param aAudio audio instance. + * @param aAvailable availability bitmap. + */ + static void GetAudioRoutingAvailability( + MVtEngAudio& aAudio, + TInt& aAvailable ); + + /** + * Gets outgoing media state. + * @param aMedia media instance. + * @param aAvailable availability bitmap. + */ + static void GetOutgoingMediaState( + MVtEngMedia& aMedia, + TInt& aAvailable ); + + /** + * Gets incoming media state. + * @param aMedia media instance. + * @param aAvailable availability bitmap. + */ + static void GetIncomingMediaState( + MVtEngMedia& aMedia, + TInt& aAvailable ); + + /** + * Checks if media has still image. + * @param aMedia media instance. + * @return ETrue if media has still image. + */ + static TBool HasStillImage( + MVtEngMedia& aMedia ); + + /** + * Gets freeze's current status. + * @param aMedia media instance. + * @return ETrue if active provider is frozen, EFalse otherwise. + */ + static TBool GetFreezeState( + MVtEngMedia& aMedia ); + + /** + * Checks if freeze is supported. + * @param aMedia media instance. + * @return ETrue if freeze is supported. + */ + static TBool IsFreezeSupported( + MVtEngMedia& aMedia ); + + /** + * Gets current local video quality setting. + * @param aMedia media instance. + * @param aVideoQuality Current local video quality settings. + */ + static void GetVideoQuality( + MVtEngMedia& aMedia, + MVtEngMedia::TVideoQuality& aVideoQuality ); + /** + * Gets current object sharing state. + * @param aMedia media instance. + * @param aShareObjectState contains current object sharing state on + * return. + */ + static void GetObjectSharingState( MVtEngMedia& aMedia, + MVtEngMedia::TShareObjectState& aShareObjectState ); + + /** + * Checks if zooming is allowed. + * @param aMedia media instance. + * @return ETrue if allowed, EFalse otherwise. + */ + static TBool IsZoomAllowed( + MVtEngMedia& aMedia ); + + /** + * Checks if the device has cameras currently attached. + * @param aMedia media instance. + * @return ETrue if there are cameras available. + */ + static TBool HasCameras( MVtEngMedia& aMedia ); + + /** + * Checks if the key event is DTMF enabled. + * @param aKeyEvent The key event. + * @param aDtmfTone DTMF tone character. + * @return ETrue if this event is DTMF event. + */ + static TBool IsDTMFEvent( const TKeyEvent& aKeyEvent, + TChar& aDtmfTone ); + + /** + * Checks if the character is DTMF enabled. + * @param aChar The character. + * @return ETrue if this character is DTMF character. + */ + static TBool IsDTMFCharacter( const TChar aChar ); + + private: + + /** + * Checks if audio routing is available. + * @param aAudio audio instance. + * @param aCurrent current speaker. + * @param aSource source speaker. + * @param aTarget target speaker. + */ + static TBool IsAudioRoutingAvailable( + MVtEngAudio& aAudio, + const MVtEngAudio::TAudioRoutingState aCurrent, + const MVtEngAudio::TAudioRoutingState aSource, + const MVtEngAudio::TAudioRoutingState aTarget ); + + }; + +#endif // VTUIUTILITY_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuicmdbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuicmdbase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2007 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: UI command bases class definition. +* +*/ + + +#ifndef C_VTUICMDBASE_H +#define C_VTUICMDBASE_H + +#include + +/** + * CVtUiCmdBase + * + * Base class for UI commands. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiCmdBase ) : public CBase + { + +public: // public methods + + /** + * Returns command id. + * + * @return This command's id. + */ + TInt CommandId() const; + +public: // public abstract methods + + /** + * Execute command + * + */ + virtual void HandleL() = 0; + + /** + * Returns ETrue if command is enabled. + * + * @return ETrue if this command is enabled (can be executed), EFalse + * otherwise. + */ + virtual TBool IsEnabled() const = 0; + +public: // public static methods + + /** + * Key comparing function type definition. + */ + typedef TInt ( *TKeyOrder ) ( const TInt*, const CVtUiCmdBase& ); + + /** + * Returns linear order object for ordered array inserting. + * + * @return TLinearOrder instance for searching and inserting CVtUiCmdBase + * based objects into RArray. + */ + static TLinearOrder< CVtUiCmdBase > LinearOrder(); + + /** + * Returns linear order object for ordered array inserting. + * + * @return Pointer to key comparaing function, that can be used in + * FindInOrder() method call. + */ + static TKeyOrder KeyOrder(); + +protected: + + /** + * C++ constructor. + * + * @aCommandId Id of this command. + * + */ + CVtUiCmdBase( TInt aCommandId ); + +protected: + + // Command id + const TInt iCommandId; + + }; + +#endif // C_VTUICMDBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuicmdcontext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuicmdcontext.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2007 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: Command context base class definition. +* +*/ + + +#ifndef C_VTUICMDCONTEXT_H +#define C_VTUICMDCONTEXT_H + +#include + +#include "tvtuicmdcontexttype.h" + +class CVtUiCmdValidatorBase; +class CVtUiCmdValidationActionBase; +class MVtUiCommandManager; +class CVtUiCmdCustomValidationActionBase; + +/** + * CVtUiCmdContext + * + * Command context base class. This class defines context in which commands + * will be validated. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiCmdContext ) : public CBase + { + +public: // public methods + + /** + * C++ destructor. + */ + ~CVtUiCmdContext(); + + /** + * Returns reference priority. + * + * @return Validator priority. + */ + TInt ReferencePriority() const; + + /** + * Returns context type. + * + * @return Context type. + */ + TVtUiCmdContextType ContextType() const; + + /** + * Adds validator to context. + * + * @param aValidator Validator reference to be added into this context. + * @return KErrNone if validator supports this context and adding succeeded. + * KErrNotSupported if validator does not support this context. + * Other system wide error code that may happen during add. + */ + TInt AddValidator( CVtUiCmdValidatorBase& aValidator ); + + /** + * Removes validator to context. + * + * @param aValidator Constant validator reference to be removed from this + * context. + * @return Validator priority. + */ + void RemoveValidator( const CVtUiCmdValidatorBase& aValidator ); + +public: // pure virtual methods + + /** + * Do validation. + * + * @param aAction Action to be validated. + */ + virtual void ValidateL( CVtUiCmdValidationActionBase& aAction ) = 0; + +protected: + + /** + * C++ constructor + */ + CVtUiCmdContext( MVtUiCommandManager& aCommandManager, + TVtUiCmdContextType aCtxType, TInt aReferencePriority ); + + /** + * Validates menu items. + */ + void ValidateMenuItemsL( CVtUiCmdValidationActionBase& aAction ); + + /** + * Validates softkey items. + */ + void ValidateSoftkeyItemsL( CVtUiCmdValidationActionBase& aAction ); + + /** + * Validates toolbar items. + */ + void ValidateToolbarItemsL( CVtUiCmdValidationActionBase& aAction ); + + /** + * Custom action validation. + */ + void CustomValidationL( CVtUiCmdCustomValidationActionBase& aAction ); + + /** + * Registers command context to command policy manager. + */ + void RegisterCommandContextL(); + + /** + * Unregisters command context from command policy manager. + */ + void UnregisterCommandContext(); + +protected: // data + + // Reference to policy manager (for cleanup) + MVtUiCommandManager& iCommandManager; + +private: // data + + // Validator list (ordered by priority) + RPointerArray< CVtUiCmdValidatorBase > iValidators; + + // Validator priority + const TInt iReferencePriority; + + // Context type. + const TVtUiCmdContextType iContextType; + + }; + +#endif // C_VTUICMDCONTEXT_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuicmdcustomvalidationactionbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuicmdcustomvalidationactionbase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2007 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: Custom command validation action class definition. +* +*/ + + +#ifndef C_VTUICMDCUSTOMVALIDATIONACTIONBASE_H +#define C_VTUICMDCUSTOMVALIDATIONACTIONBASE_H + +#include + +#include "cvtuicmdvalidationactionbase.h" + +/** + * CVtUiCmdCustomValidationActionBase + * + * Custom command validation action base class. This class is an extension to + * command validation action and defines new attribute Type ID that is used + * for defining type of the custom validation action. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiCmdCustomValidationActionBase ) + : public CVtUiCmdValidationActionBase + { + +public: // typedefs + + // Custom type id type definition. + typedef TInt TCustomTypeId; + +public: + + /** + * Returns custom type id. + * @return Custom type id. + */ + TCustomTypeId CustomTypeId() const; + +protected: // new protected methods + + /** + * C++ constructor. + */ + CVtUiCmdCustomValidationActionBase( TCustomTypeId aCustomTypeId ); + +private: // data + + // Custom type id. + const TCustomTypeId iCustomTypeId; + + }; + +#endif // C_VTUICMDCUSTOMVALIDATIONACTIONBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuicmdstatecheckaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuicmdstatecheckaction.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2007 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: Command state check action. +* +*/ + + +#ifndef C_VTUICMDSTATECHECKACTION_H +#define C_VTUICMDSTATECHECKACTION_H + +#include "cvtuicmdcustomvalidationactionbase.h" + +/** + * CVtUiCmdStateCheckAction + * + * Custom validation action that concludes whether or not a command is allowed. + * Command validness is checked from its current state. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiCmdStateCheckAction ) +: public CVtUiCmdCustomValidationActionBase + { + +public: + + /** + * Static constructor. + * + * @return Pointer to newly created instance of CVtUiCmdStateCheckAction. + */ + static CVtUiCmdStateCheckAction* NewL(); + + /** + * Sets command to be checked. + * + * @param aCommandId Id of command to be checked. + */ + void SetCommand( TInt aCommandId ); + + /** + * Sets command to be checked. + * + * @return ETrue is command set with SetCommand() is allowed to be + * executed. + */ + TBool IsCommandAllowed() const; + +public: // from CVtUiCmdValidationActionBase + + /** + * @see CVtUiCmdValidationActionBase::ProcessL + */ + void ProcessL( const MVtUiCmdValidatorCallBack& aCallBack ); + +private: + + /** + * C++ constructor. + */ + CVtUiCmdStateCheckAction(); + +private: // data + + // Id of command to be checked + TInt iCommandId; + + // ETrue if command defined by iCommandId is allowed + TBool iIsCommandAllowed; + + }; + +#endif // C_VTUICMDSTATECHECKACTION_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuicmdvalidationactionbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuicmdvalidationactionbase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2007 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: Command validation action base class definition. +* +*/ + + +#ifndef C_VTUICMDVALIDATIONACTIONBASE_H +#define C_VTUICMDVALIDATIONACTIONBASE_H + +#include + +class CVtUiCmdValidatorBase; +class MVtUiCmdValidatorCallBack; + +/** + * CVtUiCmdValidationActionBase + * + * Command validation action base class. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiCmdValidationActionBase ) : public CBase + { + +public: // public methods + + /** + * C++ destructor. + */ + ~CVtUiCmdValidationActionBase(); + + /** + * Called when validation process is about to begin. Resets internal + * variables. + */ + virtual void BeginProcess(); + + /** + * Called when validation process has finished. + */ + virtual void EndProcess(); + +public: // pure virtual methods + + /** + * Execute validation process. + * + * @param aCallBack Action validation callback routine that will be called + * for every item to be validated. + */ + virtual void ProcessL( const MVtUiCmdValidatorCallBack& aCallBack ) = 0; + +protected: + + /** + * Mark command handled. + * + * @param aCommandId Id of command that was handled. + */ + void CommandHandledL( TInt aCommandId ); + + /** + * Check whether command is already handled or not. + * + * @param aCommandId Id of command to be checked. + * @return ETrue if command was already handler, EFalse otherwise. + */ + TBool IsCommandHandled( TInt aCommandId ) const; + +private: // data + + // Array of handled commands. + RArray< TInt > iHandledCommands; + + }; + +#endif // C_VTUICMDVALIDATIONACTIONBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuicmdvalidatorbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuicmdvalidatorbase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2007 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: Base class for command validators. +* +*/ + + +#ifndef C_VTUICMDVALIDATORBASE_H +#define C_VTUICMDVALIDATORBASE_H + +#include + +#include "tvtuicmdcontexttype.h" + +class CVtUiCmdValidationActionBase; +class CVtUiCmdCustomValidationActionBase; + +/** + * CVtUiCmdValidatorBase + * + * Base class for all validators. Validator implementations validate commands + * and other properties (like softkey resource IDs) on context basis. E.g. + * primary validator will validate commands in all contexts, while toolbar + * validator will do fine tuning for commands only in menu context, so that + * commands that are visible in toolbar are not shown in menu. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiCmdValidatorBase ) : public CBase + { + +public: // public methods + + /** + * Returns validator priority. + * + * @return Validator priority. + */ + TInt Priority() const; + +public: // pure virtual methods + + /** + * Validates menu items. + * + * @param aAction Reference to validation action. + * @param aReferencePriority Context reference priority. + */ + virtual void ValidateMenuItemsL( CVtUiCmdValidationActionBase& aAction, + TInt aReferencePriority ) = 0; + + /** + * Validates softkey items. + * + * @param aAction Reference to validation action. + * @param aReferencePriority Context reference priority. + */ + virtual void ValidateSoftkeyItemsL( CVtUiCmdValidationActionBase& aAction, + TInt aReferencePriority ) = 0; + + /** + * Validates toolbar items. + * + * @param aAction Reference to validation action. + * @param aReferencePriority Context reference priority. + */ + virtual void ValidateToolbarItemsL( CVtUiCmdValidationActionBase& aAction, + TInt aReferencePriority ) = 0; + + /** + * Custom validation. + * + * @param aAction Reference to custom validation action. + * @param aReferencePriority Context reference priority. + */ + virtual void CustomValidationL( CVtUiCmdCustomValidationActionBase& aAction, + TInt aReferencePriority ) = 0; + + /** + * Query for context validation. + * + * @param aCtxType Command context type. + * @return ETrue if this instance validates given context type, EFalse + * otherwise. + */ + virtual TBool ValidatesContext( const TVtUiCmdContextType& aCtxType ) + const = 0; + +protected: + + /** + * C++ constructor + * + * @param aPriority Validator priority. + */ + CVtUiCmdValidatorBase( TInt aPriority ); + +private: // data + + // Validator priority + const TInt iPriority; + + }; + +#endif // C_VTUICMDVALIDATORBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuicommandmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuicommandmanager.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,231 @@ +/* +* Copyright (c) 2007 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: Command manager class definition. +* +*/ + + +#ifndef C_VTUICOMMANDMANAGER_H +#define C_VTUICOMMANDMANAGER_H + +#include "mvtuicommandmanager.h" +#include "mvtuicommandui.h" +#include "tvtuilocalvariation.h" +#include "CVtUiAppUi.h" + +class TVtUiStates; +class CVtUiCommandPolicyManager; +class CVtUiPrimaryCmdPolicy; +class CVtUiCmdStateCheckAction; +class CVtUiExecutionContext; + +/** + * CVtUiCommandManager + * + * Acts as a proxy for Command UIs and Validators. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiCommandManager ) : public CBase, + public MVtUiCommandManager, public MVtUiCommandUi + { + +public: + + /** + * Static constructor. + * + * @param aUiStates Constant reference to UI states object. + */ + static CVtUiCommandManager* NewL( const TVtUiStates& aUiStates, + CVtUiAppUi& aAppUi ); + + /** + * Destructor. + */ + ~CVtUiCommandManager(); + +public: + + /** + * Constant reference to UI states. + * + * @return Constant reference to UI states object. + */ + const TVtUiStates& UiStates() const; + + /** + * Constant reference to VT local variation. + * + * @return Constant reference to VT local variation object. + */ + const TVtUiVideoTelephonyVariation& VideoTelephonyVariation() const; + + /** + * Handles command. + * + * @param aCommandId Id of command to be handled. If given command is not + * found, command will be silently ignored. + */ + void HandleCommandL( TInt aCommandId ); + + /** + * Constant reference to CVtUiAppUi states. + * + * @return Constant reference to UI states object. + */ + const CVtUiAppUi& AppUi() const; + + +public: // from MVtUiCommandManager + + /** + * @see MVtUiCommandManager::AddCommandUi + */ + TInt AddCommandUi( MVtUiCommandUi& aCommandUi ); + + /** + * @see MVtUiCommandManager::RemoveCommandUi + */ + void RemoveCommandUi( MVtUiCommandUi& aCommandUi ); + + /** + * @see MVtUiCommandManager::ValidateMenuItemsL + */ + void ValidateMenuItemsL( CVtUiCmdValidationActionBase& aAction ); + + /** + * @see MVtUiCommandManager::ValidateSoftkeyItemsL + */ + void ValidateSoftkeyItemsL( CVtUiCmdValidationActionBase& aAction ); + + /** + * @see MVtUiCommandManager::ValidateToolbarItemsL + */ + void ValidateToolbarItemsL( CVtUiCmdValidationActionBase& aAction ); + + /** + * @see MVtUiCommandManager::IsCommandAllowedL + */ + TBool IsCommandAllowedL( TInt aCommandId ); + + /** + * @see MVtUiCommandManager::RegisterCommandContext + */ + TInt RegisterCommandContext( CVtUiCmdContext& aContext ); + + /** + * @see MVtUiCommandManager::UnregisterCommandContext + */ + void UnregisterCommandContext( CVtUiCmdContext& aContext ); + + /** + * @see MVtUiCommandManager::AddValidator + */ + TInt AddValidator( CVtUiCmdValidatorBase& aValidator ); + + /** + * @see MVtUiCommandManager::RemoveValidator + */ + void RemoveValidator( CVtUiCmdValidatorBase& aValidator ); + + /** + * @see MVtUiCommandManager::RefreshL + */ + void RefreshL(); + + /** + * @see MVtUiCommandManager::AddCommandModifier + */ + TInt AddCommandModifier( CVtUiCommandModifyBase& aModifier ); + + /** + * @see MVtUiCommandManager::RemoveCommandModifier + */ + void RemoveCommandModifier( CVtUiCommandModifyBase& aModifier ); + + /** + * @see MVtUiCommandManager::RegisterCommandL + */ + void RegisterCommandL( CVtUiCmdBase& aCommand ); + + /** + * @see MVtUiCommandManager::UnregisterCommand + */ + void UnregisterCommand( const CVtUiCmdBase& aCommand ); + +private: + + /** + * Constructor. + */ + CVtUiCommandManager( const TVtUiStates& aUiStates, CVtUiAppUi& aAppUi ); + + /** + * Symbian OS constructor. + * @param aModel Engine model. + */ + void ConstructL(); + + /** + * Called when a new command modifier is added + */ + TInt CommandModifierAdded( CVtUiCommandModifyBase& aModifier ); + + /** + * Called when a command modifier is removed + */ + void CommandModifierRemoved( CVtUiCommandModifyBase& aModifier ); + + /** + * Called when a new command ui is added + */ + TInt CommandUiAdded( MVtUiCommandUi& aCommandUi ); + + /** + * Called when a command ui is removed + */ + void CommandUiRemoved( MVtUiCommandUi& aCommandUi ); + +private: + + // Commands Uis + RPointerArray< MVtUiCommandUi > iCommandUis; + + // Command modifiers + RPointerArray< CVtUiCommandModifyBase > iCommandModifiers; + + // Registered commands + RPointerArray< CVtUiCmdBase > iCommands; + + // Command policy manager instance + CVtUiCommandPolicyManager* iCmdPolicyMgr; + + // Reference to UI states instance + const TVtUiStates& iUiStates; + + // Reference to VT local variation + TVtUiVideoTelephonyVariation iVtVariation; + + // Command state validation action + CVtUiCmdStateCheckAction* iCmdStateCheckAction; + + // Execution context (for command state validation) + CVtUiExecutionContext* iExecutionContext; + + // Reference to appui + const CVtUiAppUi& iAppUi; + }; + +#endif // C_VTUICOMMANDMANAGER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuicommandmodifybase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuicommandmodifybase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2007 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: Command modifier base class definition. +* +*/ + + +#ifndef C_VTUICOMMANDMODIFYBASE_H +#define C_VTUICOMMANDMODIFYBASE_H + +#include + +#include "mvtuicommandsetting.h" + +/** + * CVtUiCommandModifyBase + * + * Command modifier base class. Command modifiers can be used for modifying + * different command sets. E.g. in toolbar and number entry a command modifiers + * are being used for modifying softkeys. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiCommandModifyBase ) : public CBase + { + +public: // static methods + + /** + * Returns TLinearOrder<> for priority ordering. + */ + static TLinearOrder< CVtUiCommandModifyBase > PriorityOrder(); + +private: // static methods + + /** + * Priority ordering function. + */ + static TInt PriorityOrderFunc( const CVtUiCommandModifyBase& aM1, + const CVtUiCommandModifyBase& aM2 ); + +public: // pure virtual methods + + /** + * Modifies command set. + */ + virtual void ModifyCommandsL( MVtUiCommandSetting& aCommandSettings ) = 0; + + /** + * Returns ETrue if this modifier supports given command set type. + */ + virtual TBool Supports( MVtUiCommandSetting::Type aType ) const = 0; + +protected: + + /** + * Constructor + */ + CVtUiCommandModifyBase( TInt aPriority ); + +private: + + // Modifier priority + const TInt iPriority; + + }; + +#endif // C_VTUICOMMANDMODIFYBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuicommandpolicymanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuicommandpolicymanager.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,181 @@ +/* +* Copyright (c) 2007 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: Command policy manager class definition. +* +*/ + + +#ifndef C_VTUICOMMANDPOLICYMANAGER_H +#define C_VTUICOMMANDPOLICYMANAGER_H + +#include + +#include "tvtuicmdcontexttype.h" + +class CVtUiCmdContext; +class CVtUiCmdValidatorBase; +class CVtUiCmdValidationActionBase; +class CVtUiCmdCustomValidationActionBase; +class CVtUiCommandManager; +class CVtUiPrimaryCmdPolicy; + +/** + * CVtUiCommandPolicyManager + * + * Contains pointers to all registered command contexts and commnd policy + * instances. When validation is required, calls proper methods in proper + * context for registered validators in validator priority order. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiCommandPolicyManager ) : public CBase + { + +public: // public methods + + /** + * Static constructor. + * + * @param aCmdManager Constant reference to command manager instance. + * @return Newly created instance of CVtUiCommandPolicyManager class. + */ + static CVtUiCommandPolicyManager* + NewL( const CVtUiCommandManager& aCmdManager ); + + /** + * C++ destructor. + */ + ~CVtUiCommandPolicyManager(); + + /** + * Registers command context. + * + * @param aContext Reference to command context to be registered. + * @return KErrNone if registration succeeded. + */ + TInt RegisterCommandContext( CVtUiCmdContext& aContext ); + + /** + * Unregisters command context. + * + * @param aContext Constant reference to command context to be unregistered. + */ + void UnregisterCommandContext( CVtUiCmdContext& aContext ); + + /** + * Adds validator to policy manager and registered contexts. + * + * @param aValidator Reference to validator to be added. + * @return KErrNone if add succeeded. + */ + TInt AddValidator( CVtUiCmdValidatorBase& aValidator ); + + /** + * Removes validator from policy manager and registered contexts. + * + * @param aValidator Constant reference to validator to be removed. + */ + void RemoveValidator( CVtUiCmdValidatorBase& aValidator ); + + /** + * Validates menu items for given action. + * + * @param aAction Reference to validation action to be carried on menu + * commmands. + */ + void ValidateMenuItemsL( CVtUiCmdValidationActionBase& aAction ); + + /** + * Validates softkey items for given action. + * + * @param aAction Reference to validation action to be carried on softkeys. + */ + void ValidateSoftkeyItemsL( CVtUiCmdValidationActionBase& aAction ); + + /** + * Validates toolbar items for given action. + * + * @param aAction Reference to validation action to be carried on toolbar + * commands. + */ + void ValidateToolbarItemsL( CVtUiCmdValidationActionBase& aAction ); + + /** + * Custom validation for given action. + * + * @param Reference to custom validation action to be carried. + */ + void CustomValidateL( CVtUiCmdCustomValidationActionBase& aAction ); + +private: + + /** + * Constructor + */ + CVtUiCommandPolicyManager( const CVtUiCommandManager& aCmdManager ); + + /** + * 2nd constructor + */ + void ConstructL(); + + /** + * Called when RegisterCommandContext() succeeds. + */ + void CommandContextRegistered( CVtUiCmdContext& aContext ); + + /** + * Called when UnregisterCommandContext() succeeds. + */ + void CommandContextUnregistered( CVtUiCmdContext& aContext ); + + /** + * Called when AddValidator() succeeds. + */ + void ValidatorAdded( CVtUiCmdValidatorBase& aValidator ); + + /** + * Called when RemoveValidator() succeeds. + */ + void ValidatorRemoved( CVtUiCmdValidatorBase& aValidator ); + + /** + * Returns command context by type. + */ + CVtUiCmdContext* FindCommandContextByType( + TVtUiCmdContextType aContextType ); + + /** + * Called from different validation routines. + */ + void ValidateL( TVtUiCmdContextType aContextType, + CVtUiCmdValidationActionBase& aAction ); + +private: // data + + // Context list (ordered by context type) + RPointerArray< CVtUiCmdContext > iContexts; + + // Validator list + RPointerArray< CVtUiCmdValidatorBase > iValidators; + + // Reference to command manager + const CVtUiCommandManager& iCommandManager; + + // Primary command policy, always exists. + CVtUiPrimaryCmdPolicy* iPrimaryCommandPolicy; + + }; + +#endif // C_VTUICOMMANDPOLICYMANAGER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuicommandsetting.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuicommandsetting.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2007 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: Command settings class definition. +* +*/ + + +#ifndef C_VTUICOMMANDSETTING_H +#define C_VTUICOMMANDSETTING_H + +#include + +#include "mvtuicommandsetting.h" + +class CVtUiCommandModifyBase; + +/** + * CVtUiCommandSetting + * + * Template commmand setting class that takes command setting action as a + * templated parameter. + * + * @since S60 v3.2 + */ +template < typename ACTION > +class CVtUiCommandSetting : public CBase, public MVtUiCommandSetting + { + +public: + + /** + * Destructor + */ + ~CVtUiCommandSetting(); + + /** + * Defines commands. + * + * @param aAction Action related to commands to be defined. + */ + void DefineCommandsL( const ACTION& aAction ); + + /** + * Adds new modifer + * + * @param aModifier Reference to modifier to be added to this setting + * instance. + * @return KErrNone if modifier could be added, KErrAlreadyExists if same + * modifier is already added or KErrArgument if another modifier with + * same priority is already added. + */ + TInt AddModifier( CVtUiCommandModifyBase& aModifier ); + + /** + * Removes modifier + * + * @param aModifier Constant reference to modifier to be removed. + */ + void RemoveModifier( CVtUiCommandModifyBase& aModifier ); + + /** + * Return command type + * + * @return Type of commands this setting class instance is defining. + */ + Type CommandType() const; + + /** + * Returns reference to action + * + * @return Constant reference to action that is related to this command + * definition process. + */ + const ACTION& Action(); + +protected: + + /** + * Constructor + */ + CVtUiCommandSetting( Type aCommandType ); + +private: + + // Modifiers + RPointerArray< CVtUiCommandModifyBase > iModifiers; + + // Command type + const Type iCommandType; + + // Stored action + const ACTION* iAction; + + }; + +#include "cvtuicommandsetting.inl" + +#endif // C_VTUICOMMANDSETTING_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuicommandsetting.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuicommandsetting.inl Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2007 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: Command setting inline methods. +* +*/ + + +#include + +#include "cvtuicommandmodifybase.h" + +// ======== LOCAL FUNCTIONS ======== + +static const TInt KVtUiModifierArrayGranularity = 1; + +// --------------------------------------------------------------------------- +// CVtUiCommandSetting< A >::~CVtUiCommandSetting +// --------------------------------------------------------------------------- +// +template < typename A > +CVtUiCommandSetting< A >::~CVtUiCommandSetting() + { + iModifiers.Reset(); + } + +// --------------------------------------------------------------------------- +// CVtUiCommandSetting< A >::CVtUiCommandSetting +// --------------------------------------------------------------------------- +// +template < typename A > +CVtUiCommandSetting< A >::CVtUiCommandSetting( Type aCommandType ) : + iModifiers( KVtUiModifierArrayGranularity ), iCommandType( aCommandType ) + { + } + +// --------------------------------------------------------------------------- +// CVtUiCommandSetting< A >::DefineCommandsL +// --------------------------------------------------------------------------- +// +template < typename A > +void CVtUiCommandSetting< A >::DefineCommandsL( const A& aAction ) + { + __VTPRINTENTER( "CmdSet< A >.DefineCommandsL" ) + iAction = &aAction; + if ( iModifiers.Count() > 0 ) + { + iModifiers[ iModifiers.Count() - 1 ]->ModifyCommandsL( *this ); + } + else + { + DoDefineCommandsL(); + } + iAction = NULL; + __VTPRINTEXIT( "CmdSet< A >.DefineCommandsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandSetting< A >::AddModifier +// --------------------------------------------------------------------------- +// +template < typename A > +TInt CVtUiCommandSetting< A >::AddModifier( + CVtUiCommandModifyBase& aModifier ) + { + __VTPRINTENTER( "CmdSet< A >.AddModifier" ) + TInt result( KErrNone ); + if ( aModifier.Supports( iCommandType ) ) + { + TInt idx( iModifiers.FindInOrder( &aModifier, + CVtUiCommandModifyBase::PriorityOrder() ) ); + if ( idx == KErrNotFound ) + { + result = iModifiers.InsertInOrder( &aModifier, + CVtUiCommandModifyBase::PriorityOrder() ); + } + else + { + if ( iModifiers[ idx ] != &aModifier ) + { + // Priorities match, but instance is not same -> argument + // is not valid + result = KErrArgument; + } + } + } + __VTPRINTEXITR( "CmdSet< A >.AddModifier %d", result ) + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiCommandSetting< A >::RemoveModifier +// --------------------------------------------------------------------------- +// +template < typename A > +void CVtUiCommandSetting< A >::RemoveModifier( + CVtUiCommandModifyBase& aModifier ) + { + __VTPRINTENTER( "CmdSet< A >.RemoveModifier" ) + TInt idx( iModifiers.FindInOrder( &aModifier, + CVtUiCommandModifyBase::PriorityOrder() ) ); + + if ( idx != KErrNotFound ) + { + iModifiers.Remove( idx ); + } + __VTPRINTEXIT( "CmdSet< A >.RemoveModifier" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandSetting< A >::CommandType +// --------------------------------------------------------------------------- +// +template < typename A > +MVtUiCommandSetting::Type CVtUiCommandSetting< A >::CommandType() const + { + return iCommandType; + } + +// --------------------------------------------------------------------------- +// CVtUiCommandSetting< A >::Action +// --------------------------------------------------------------------------- +// +template < typename A > +const A& CVtUiCommandSetting< A >::Action() + { + return *iAction; + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuiexecutioncontext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuiexecutioncontext.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2007 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: Execution context class definition. +* +*/ + + +#ifndef C_VTUIEXECUTIONCONTEXT_H +#define C_VTUIEXECUTIONCONTEXT_H + +#include "cvtuicmdcontext.h" + +/** + * CVtUiExecutionContext + * + * Command execution context. This context is used for checking whether or not + * a command is allowed to be performed. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiExecutionContext ) : public CVtUiCmdContext + { + +public: // public methods + + /** + * C++ destructor. + */ + ~CVtUiExecutionContext(); + + /** + * Static constructor. + * + * @param aCommandManager Reference to command manager. + * @return Newly created instance of CVtUiExecutionContext class. + */ + static CVtUiExecutionContext* NewL( MVtUiCommandManager& aCommandManager ); + +public: // from CVtUiCmdContext + + /** + * @see CVtUiCmdContext::ValidateL + */ + void ValidateL( CVtUiCmdValidationActionBase& aAction ); + +private: + + /** + * C++ constructor + */ + CVtUiExecutionContext( MVtUiCommandManager& aCommandManager ); + + /** + * 2nd constructor, may leave. + */ + void ConstructL(); + +private: // data + + }; + +#endif // C_VTUIEXECUTIONCONTEXT_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuifeaturecmdbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuifeaturecmdbase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2007 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: Feature based UI command base class definition. +* +*/ + + +#ifndef C_VTUIFEATURECMDBASE_H +#define C_VTUIFEATURECMDBASE_H + +#include "cvtuicmdbase.h" + +class MVtUiFeature; + +/** + * CVtUiCmdBase + * + * Base class for all UI commands that are feature based. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiFeatureCmdBase ) : public CVtUiCmdBase + { + +public: // from CVtUiCmdBase + + /** + * @see CVtUiCmdBase::HandleL + */ + void HandleL(); + + /** + * @see CVtUiCmdBase::IsEnabled + */ + TBool IsEnabled() const; + +protected: + + /** + * C++ constructor. + * + * @aFeature Reference to a feature this command refers to. + * @aCommandId Id of this command. + * + */ + CVtUiFeatureCmdBase( MVtUiFeature& aFeature, TInt aCommandId ); + +protected: + + // Reference to command feature + MVtUiFeature& iFeature; + + }; + +#endif // C_VTUIFEATURECMDBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/cvtuiprimarycmdpolicy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/cvtuiprimarycmdpolicy.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2007 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: Primary command policy class definition. +* +*/ + + +#ifndef C_VTUIPRIMARYCMDPOLICY_H +#define C_VTUIPRIMARYCMDPOLICY_H + +#include + +#include "tvtuicmdpolicypriority.h" +#include "cvtuicmdvalidatorbase.h" +#include "tvtuilocalvariation.h" + +class CVtUiCmdValidationActionBase; +class TVtUiStates; +class CVtUiAppUi; +/** + * CVtUiPrimaryCmdPolicy + * + * Primary policy is the highest priority policy. It does the basic validation, + * results of which can be modified by the lower priority validators. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiPrimaryCmdPolicy ) : public CVtUiCmdValidatorBase + { + +public: // public methods + + /** + * Static constructor. + * + * @param aUiStates Constant reference to UI states object. + * @return Newly created instace of CVtUiPrimaryCmdPolicy class. + */ + static CVtUiPrimaryCmdPolicy* NewL( const TVtUiStates& aUiStates, + const CVtUiAppUi& aAppUi ); + + /** + * Destructor + */ + ~CVtUiPrimaryCmdPolicy(); + +public: // from CVtUiCmdValidatorBase + + /** + * @see CVtUiCmdValidatorBase::ValidateMenuItemsL + */ + void ValidateMenuItemsL( CVtUiCmdValidationActionBase& aAction, + TInt aReferencePriority ); + + /** + * @see CVtUiCmdValidatorBase::ValidateSoftkeyItemsL + */ + void ValidateSoftkeyItemsL( CVtUiCmdValidationActionBase& aAction, + TInt aReferencePriority ); + + /** + * @see CVtUiCmdValidatorBase::ValidateToolbarItemsL + */ + void ValidateToolbarItemsL( CVtUiCmdValidationActionBase& aAction, + TInt aReferencePriority ); + + /** + * @see CVtUiCmdValidatorBase::CustomValidationL + */ + void CustomValidationL( CVtUiCmdCustomValidationActionBase& aAction, + TInt aReferencePriority ); + + /** + * @see CVtUiCmdValidatorBase::ValidatesContext + */ + TBool ValidatesContext( const TVtUiCmdContextType& aCtxType ) + const; + +private: + + /** + * C++ constructor + */ + CVtUiPrimaryCmdPolicy( const TVtUiStates& aUiStates, + const CVtUiAppUi& aAppUi ); + + /** + * 2nd constructor + */ + void ConstructL(); + + /** + * Callback for menu validation. + */ + TBool ValidateMenuCommand( TInt aCommandId ) const; + + /** + * Callback for softkey resource id validation. + */ + TBool ValidateSoftkey( TInt aResourceId ) const; + + /** + * Callback for toolbar command validation. + */ + TBool ValidateToolbarCommand( TInt aCommandId ) const; + + /** + * Callback for command state validation. + */ + TBool ValidateCommandState( TInt aCommandId ) const; + + /** + * Callback for command validation. + */ + TBool ValidateCommand( TInt aCommandId, TBool& aHandled ) const; + +private: // data + + // UI states + const TVtUiStates& iUiStates; + + // Active idle local variation + TBool iAIEnabled; + + // Reference to appui + const CVtUiAppUi& iAppUi; + + }; + +#endif // C_VTUIPRIMARYCMDPOLICY_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/mvtuicommanditerator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/mvtuicommanditerator.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2007 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: Command iterator API definition. +* +*/ + + +#ifndef M_VTUICOMMANDITERATOR_H +#define M_VTUICOMMANDITERATOR_H + +#include + +/** + * MVtUiCommandIterator + * + * API for iterating through set of commands. + * + * @since S60 v3.2 + */ +class MVtUiCommandIterator + { + +public: + + /** + * Returns ETrue if the iteration has more elements + * + * @return ETrue if iteration contains more commands (i.e. call to Next() + * will return a valid command), EFalse otherwise. + */ + virtual TBool HasNext() const = 0; + + /** + * Returns the next command in the iteration. + * + * @return Next command in the iteration. + */ + virtual TInt Next() = 0; + + }; + +#endif // M_VTUICOMMANDITERATOR_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/mvtuicommandmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/mvtuicommandmanager.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2007 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: Command manager API definition. +* +*/ + + +#ifndef M_VTUICOMMANDMANAGER_H +#define M_VTUICOMMANDMANAGER_H + +#include + +class CEikMenuPane; +class CVtUiCmdContext; +class CVtUiCmdValidatorBase; +class CVtUiCmdValidationActionBase; +class MVtUiCommandUi; +class CVtUiCommandModifyBase; +class CVtUiCmdCustomValidationActionBase; +class CVtUiCmdBase; + +/** + * MVtUiCommandManager + * + * Command manager API for other components. Command manager holds command UI + * instances and does command validation for all registered commands. + * + * @since S60 v3.2 + */ +class MVtUiCommandManager + { + +public: + + /** + * Adds new command ui to command manager. + * @param aCommandUi Reference to command ui to be added. + * @return KErrNone if command ui was added successfully. + */ + virtual TInt AddCommandUi( MVtUiCommandUi& aCommandUi ) = 0; + + /** + * Removes command ui from command manager. + * @param aCommandUi Constant reference to command ui to be removed. + * + */ + virtual void RemoveCommandUi( MVtUiCommandUi& aCommandUi ) = 0; + + /** + * Validate menu items in given manu pane. + * + * @param aAction Reference to action to be carried on all menu commands. + */ + virtual void ValidateMenuItemsL( + CVtUiCmdValidationActionBase& aAction ) = 0; + + /** + * Validate softkeys. + * + * @param aAction Reference to action to be carried on all softkeys. + */ + virtual void ValidateSoftkeyItemsL( + CVtUiCmdValidationActionBase& aAction ) = 0; + + /** + * Validate toolbar buttons. + * + * @param aAction Reference to action to be carried on all toolbar commands. + */ + virtual void ValidateToolbarItemsL( + CVtUiCmdValidationActionBase& aAction ) = 0; + + /** + * Validate command. + * + * @param aCommandId Id of command that is being checked. + * @return ETrue if command can be executed, EFalse otherwise. + */ + virtual TBool IsCommandAllowedL( TInt aCommandId ) = 0; + + /** + * Registers command context. + * + * @param aContext Reference to command context to be registered. + * @return KErrNone if registration succeeded. + */ + virtual TInt RegisterCommandContext( CVtUiCmdContext& aContext ) = 0; + + /** + * Unregisters command context. + * + * @param aContext Reference to command context to be unregistered. + */ + virtual void UnregisterCommandContext( CVtUiCmdContext& aContext ) = 0; + + /** + * Adds validator to policy manager and registered contexts. + * + * @param aValidator Reference to validator to be added. + * @return KErrNone if registration succeeded. + */ + virtual TInt AddValidator( CVtUiCmdValidatorBase& aValidator ) = 0; + + /** + * Removes validator from policy manager and registered contexts. + * + * @param aValidator Constant reference to validator to be removed. + */ + virtual void RemoveValidator( CVtUiCmdValidatorBase& aValidator ) = 0; + + /** + * Refresh command uis. + */ + virtual void RefreshL() = 0; + + /** + * Add new command modifier. + * + * @param aModifier Reference to command modifier to be added to every + * registered command setting. + * @return KErrNone if modifier could be added, KErrAlreadyExists if same + * modifier is already added or KErrArgument if another modifier with + * same priority is already added. + */ + virtual TInt AddCommandModifier( CVtUiCommandModifyBase& aModifier ) = 0; + + /** + * Remove command modifier. + * + * @param aModifier Reference to command modifier to be removed from every + * registered command setting. + */ + virtual void RemoveCommandModifier( CVtUiCommandModifyBase& aModifier ) = 0; + + /** + * Registers new command to command manager. + * + * @param aCommand Reference to command to be registered. + */ + virtual void RegisterCommandL( CVtUiCmdBase& aCommand ) = 0; + + /** + * Unregisters command from command manager. + * + * @param aCommand Constant reference to command to be unregistered. + */ + virtual void UnregisterCommand( const CVtUiCmdBase& aCommand ) = 0; + + }; + +#endif // M_VTUICOMMANDMANAGER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/mvtuicommandsetting.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/mvtuicommandsetting.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2007 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: Command iterator API definition. +* +*/ + + +#ifndef M_VTUICOMMANDSETTING_H +#define M_VTUICOMMANDSETTING_H + +#include + +/** + * MVtUiCommandSetting + * + * Command Setting API. + * + * @since S60 v3.2 + */ +class MVtUiCommandSetting + { + +public: + + /** + * Command types. + */ + enum Type + { + /** Softkeys */ + ECommandTypeSoftkeys + }; + +public: // pure virtual methods + + /** + * Does the base command definition. If no modifiers are registered, then + * this method is called from DefineCommandsL(), otherwise this method may + * be called by the modifier, but it is not required to do so. + */ + virtual void DoDefineCommandsL() = 0; + + }; + + +#endif // M_VTUICOMMANDSETTING_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/mvtuicommandui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/mvtuicommandui.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2007 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: Command UI API definition. +* +*/ + + +#ifndef M_VTUICOMMANDUI_H +#define M_VTUICOMMANDUI_H + +#include + +class CVtUiCommandModifyBase; + +/** + * MVtUiCommandUi + * + * Command UI API. Defines methods for adding/removing command modifiers and + * method to refresh related command UI. + * + * @since S60 v3.2 + */ +class MVtUiCommandUi + { + +public: + + /** + * Refresh command ui. + */ + virtual void RefreshL() = 0; + + /** + * Add new command modifier. + * + * @param aModifier Reference to modifier to be added to this command ui. + * @return KErrNone if modifier could be added, KErrAlreadyExists if same + * modifier is already added or KErrArgument if another modifier with + * same priority is already added. + */ + virtual TInt AddCommandModifier( CVtUiCommandModifyBase& aModifier ) = 0; + + /** + * Remove command modifier. + * + * @param aModifier Reference to modifier to be removed from this command + * ui. + */ + virtual void RemoveCommandModifier( CVtUiCommandModifyBase& aModifier ) = 0; + + }; + +#endif // M_VTUICOMMANDUI_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tVtuifeaturevariation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tVtuifeaturevariation.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 2007 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: Video Telephone feature variation class definition. +* +*/ + + +#ifndef T_VTUIFEATUREVARIATION_H +#define T_VTUIFEATUREVARIATION_H + +#include +#include + +/** + * TVtUiVariationBase + * + * Base class for feature variation classes. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiFeatureVariationBase ) + { + +public: + + /** + * Returns variation feature ID. + */ + virtual TUint32 FeatureId() const = 0; + +protected: + + /** + * Return whether or not feature is supported by Featuremanager. + * @return ETrue if feature is supported by Featuremanager. + */ + virtual TBool IsFeatureSupported( const TUint32 aId) const; + + }; + +/** + * TVtUiHelpVariation + * + * Help variation class. Uses Featuremanager to verify if feture is + * supported. This class should be instanced only once and same instance + * should be passesd as reference to modules that need this feature variation + * information. + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiHelpVariation ) : public TVtUiFeatureVariationBase + { + +public: + + /** + * Return whether or help variation is supported. + * + * @return ETrue if help supported. + */ + TBool IsHelpSupported() const; + +private: // from TVtUiFeatureVariationBase + + TUint32 FeatureId() const; + + }; +/** + * TVtUiDPVariation + * + * Display Post (DP) variation class. Uses Featuremanager to verify if feture is + * supported. This class should be instanced only once and same instance + * should be passesd as reference to modules that need this feature variation + * information. + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiDPVariation ) : public TVtUiFeatureVariationBase + { + +public: + + /** + * Return whether or DP variation is supported. + * + * @return ETrue if DP supported. + */ + TBool IsDPSupported() const; + +private: // from TVtUiFeatureVariationBase + + TUint32 FeatureId() const; + + }; +/** + * TVtUiBTVariation + * + * BlueTooth (BT) variation class. Uses Featuremanager to verify if feture is + * supported. This class should be instanced only once and same instance + * should be passesd as reference to modules that need this feature variation + * information. + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiBTVariation ) : public TVtUiFeatureVariationBase + { + +public: + + /** + * Return whether or BT variation is supported. + * + * @return ETrue if BT supported. + */ + TBool IsBTSupported() const; + +private: // from TVtUiFeatureVariationBase + + TUint32 FeatureId() const; + + }; +/** + * TVtUiSideVolumeKeysVariation + * + * Side volume keys variation class. Uses Featuremanager to verify if feture is + * supported. This class should be instanced only once and same instance + * should be passesd as reference to modules that need this feature variation + * information. + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiSideVolumeKeysVariation ) : public TVtUiFeatureVariationBase + { + +public: + + /** + * Return whether or Side volume keys variation is supported. + * + * @return ETrue if Side volume keys supported. + */ + TBool IsSideVolumeKeysSupported() const; + +private: // from TVtUiFeatureVariationBase + + TUint32 FeatureId() const; + + }; +/** + * TVtUiActiveIdleFetManVariation + * + * Active Idle feature manager variation class. Uses Featuremanager to verify if feture is + * supported. This class should be instanced only once and same instance + * should be passesd as reference to modules that need this feature variation + * information. + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiActiveIdleFetManVariation ) : public TVtUiFeatureVariationBase + { + +public: + + /** + * Return whether or Acvtive Idle variation is supported. + * + * @return ETrue if Acvtive Idle supported. + */ + TBool IsActiveIdleFetManSupported() const; + +private: // from TVtUiFeatureVariationBase + + TUint32 FeatureId() const; + + }; +#endif // T_VTUIFEATUREVARIATION_H \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtflagcontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtflagcontainer.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,108 @@ +/* +* Copyright (c) 2007 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: Flag container class definition. +* +*/ + + +#ifndef T_VTFLAGCONTAINER_H +#define T_VTFLAGCONTAINER_H + +#include + +/** + * TVtFlagContainer + * + * Flag container is a class that holds maximum of 32 different flags. Also + * contains methods for setting, clearing and getting the flag state. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtFlagContainer ) + { +public: + + /** + * Constructor. + */ + inline TVtFlagContainer(); + +protected: + + /** + * Clears all flags. + */ + inline void Clear(); + + /** + * Tests flag. + */ + inline TBool IsFlag( TUint32 aFlags ) const; + + /** + * Sets flag(s). + */ + inline void SetFlag( TUint32 aFlags ); + + /** + * Clears flag(s). + */ + inline void ClearFlag( TUint32 aFlags ); + + /** + * Gets flag value. + */ + inline TUint32 Value() const; + + /** + * Sets flag value. + */ + inline void SetValue( TUint32 aValue ); + +private: + + // Current flags + TUint32 iFlags; + + }; + +/** + * TVtUpdateableFlagContainer + * + * A flag container with Update() method that can be called to get + * flags updated in one pass. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUpdateableFlagContainer ) : public TVtFlagContainer + { +public: + + /** + * Issues flag updation. + */ + inline void Update(); + +private: + + /** + * Called when flags needs to be updated (as a result to call Update()). + */ + virtual void UpdateFlags() = 0; + + }; + +#include "tvtflagcontainer.inl" + +#endif // T_VTFLAGCONTAINER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtflagcontainer.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtflagcontainer.inl Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2007 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: Flag container class inline methods. +* +*/ + + +// ----------------------------------------------------------------------------- +// TVtFlagContainer::TVtFlagContainer +// ----------------------------------------------------------------------------- +// +TVtFlagContainer::TVtFlagContainer() + { + Clear(); + } + +// ----------------------------------------------------------------------------- +// TVtFlagContainer::Clear +// ----------------------------------------------------------------------------- +// +void TVtFlagContainer::Clear() + { + iFlags = 0; + } + +// ----------------------------------------------------------------------------- +// TVtFlagContainer::IsFlag +// ----------------------------------------------------------------------------- +// +TBool TVtFlagContainer::IsFlag( TUint32 aFlags ) const + { + return ( iFlags & aFlags ); + } + +// ----------------------------------------------------------------------------- +// TVtFlagContainer::SetFlag +// ----------------------------------------------------------------------------- +// +void TVtFlagContainer::SetFlag( TUint32 aFlags ) + { + iFlags |= aFlags; + } + +// ----------------------------------------------------------------------------- +// TVtFlagContainer::ClearFlag +// ----------------------------------------------------------------------------- +// +void TVtFlagContainer::ClearFlag( TUint32 aFlags ) + { + iFlags &= ~aFlags; + } + +// ----------------------------------------------------------------------------- +// TVtFlagContainer::Value +// ----------------------------------------------------------------------------- +// +TUint32 TVtFlagContainer::Value() const + { + return iFlags; + } + +// ----------------------------------------------------------------------------- +// TVtFlagContainer::SetValue +// ----------------------------------------------------------------------------- +// +void TVtFlagContainer::SetValue( TUint32 aValue ) + { + iFlags = aValue; + } + +// ----------------------------------------------------------------------------- +// TVtUpdateableFlagContainer::Update +// ----------------------------------------------------------------------------- +// +void TVtUpdateableFlagContainer::Update() + { + Clear(); + UpdateFlags(); + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuiaudiostate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuiaudiostate.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2007 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: Audio state class definition. +* +*/ + + +#ifndef T_VTUIAUDIOSTATE_H +#define T_VTUIAUDIOSTATE_H + +#include + +#include "tvtflagcontainer.h" + +class CVtEngModel; + +/** + * TVtUiAudioState + * + * Contains status information about video telephony audio. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiAudioState ) : public TVtUpdateableFlagContainer + { +public: + + /** + * Constructor + * + * @param aModel Reference to VT engine model. + */ + inline TVtUiAudioState( CVtEngModel& aModel ); + + /** + * Return whether audio is enabled or not. + * + * @return ETrue if audio is enabled EFalse otherwise. + */ + inline TBool IsAudio() const; + + /** + * Return whether BT handsfree can be activated or not. + * + * @return ETrue if BT handsfree can be activated EFalse otherwise. + */ + inline TBool CanActivateBtHf() const; + + /** + * Return whether BT handsfree can be deactivated or not. + * + * @return ETrue if BT handsfree can be deactivated EFalse otherwise. + */ + inline TBool CanDeactivateBtHf() const; + + /** + * Return whether loudspeaker can be activated or not. + * + * @return ETrue if loudpseaker can be activated EFalse otherwise. + */ + inline TBool CanActivateLoudspeaker() const; + + /** + * Return whether loudspeaker can be deactivated or not. + * + * @return ETrue if loudspeaker can be deactivated EFalse otherwise. + */ + inline TBool CanDeactivateLoudspeaker() const; + + /** + * Return whether or not audio is permanently stopped. + * + * @return ETrue if audio is permanently stopped. + */ + inline TBool IsAudioPermanentlyStopped() const; + +private: // from TVtUpdateableFlagContainer + + /** + * @see TVtUpdateableFlagContainer::UpdateFlags + */ + void UpdateFlags(); + +private: + + // Enumeration for audio state flags. + enum TFlags + { + /** Is set if audio is currently enabled. */ + EIsAudio = ( 1<<0 ), + /** Is set if BT handsfree can be activated. */ + ECanActivateBtHf = ( 1<<1 ), + /** Is set if BT handsfree can be deactivated. */ + ECanDeactivateBtHf = ( 1<<2 ), + /** Is set if loudspeaker can be activated. */ + ECanActivateLoudspeaker = ( 1<<3 ), + /** Is set if loudspeaker can be deactivated. */ + ECanDeactivateLoudspeaker = ( 1<<4 ), + /** Set if audio is permanently stopped */ + EIsAudioPermanentlyStopped = ( 1<<5 ) + }; + + // Reference to engine model instance + CVtEngModel& iModel; + + }; + +#include "tvtuiaudiostate.inl" + +#endif // T_VTUIAUDIOSTATE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuiaudiostate.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuiaudiostate.inl Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2007 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: Audio state class inline methods. +* +*/ + + +// ----------------------------------------------------------------------------- +// TVtUiAudioState::TVtUiAudioState +// ----------------------------------------------------------------------------- +// +TVtUiAudioState::TVtUiAudioState( CVtEngModel& aModel ) +: iModel( aModel ) + { + } + +// ----------------------------------------------------------------------------- +// TVtUiAudioState::IsAudio +// ----------------------------------------------------------------------------- +// +TBool TVtUiAudioState::IsAudio() const + { + return IsFlag( EIsAudio ); + } + +// ----------------------------------------------------------------------------- +// TVtUiAudioState::CanActivateBtHf +// ----------------------------------------------------------------------------- +// +TBool TVtUiAudioState::CanActivateBtHf() const + { + return IsFlag( ECanActivateBtHf ); + } + +// ----------------------------------------------------------------------------- +// TVtUiAudioState::CanDeactivateBtHf +// ----------------------------------------------------------------------------- +// +TBool TVtUiAudioState::CanDeactivateBtHf() const + { + return IsFlag( ECanDeactivateBtHf ); + } + +// ----------------------------------------------------------------------------- +// TVtUiAudioState::CanActivateLoudspeaker +// ----------------------------------------------------------------------------- +// +TBool TVtUiAudioState::CanActivateLoudspeaker() const + { + return IsFlag( ECanActivateLoudspeaker ); + } + +// ----------------------------------------------------------------------------- +// TVtUiAudioState::CanDeactivateLoudspeaker +// ----------------------------------------------------------------------------- +// +TBool TVtUiAudioState::CanDeactivateLoudspeaker() const + { + return IsFlag( ECanDeactivateLoudspeaker ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsAudioPermanentlyStopped +// ----------------------------------------------------------------------------- +// +TBool TVtUiAudioState::IsAudioPermanentlyStopped() const + { + return IsFlag( EIsAudioPermanentlyStopped ); + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuicmdcontexttype.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuicmdcontexttype.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2007 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: Command context types. +* +*/ + + +#ifndef T_VTUICMDCONTEXTTYPE_H +#define T_VTUICMDCONTEXTTYPE_H + +/** + * Command context types + * + * @since S60 3.2 + */ +enum TVtUiCmdContextType + { + /** Context type not defined yet */ + EVtUiCmdContextTypeUndefined = 0, + + /** Context type menu */ + EVtUiCmdContextTypeMenu, + + /** Context type softkey */ + EVtUiCmdContextTypeSoftkey, + + /** Context type toolbar */ + EVtUiCmdContextTypeToolbar, + + /** Context type execution */ + EVtUiCmdContextTypeExecution, + + /** Context type number entry */ + EVtUiCmdContextTypeNumberEntry + + }; + +#endif // T_VTUICMDCONTEXTTYPE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuicmdpolicypriority.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuicmdpolicypriority.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2007 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: Command policy priorities. +* +*/ + + +#ifndef T_VTUICMDPOLICYPRIORITY_H +#define T_VTUICMDPOLICYPRIORITY_H + +/** + * Command priority enumeration + * + * @since S60 3.2 + */ +enum TVtUiCmdPolicyPriority + { + /** Undefined priority value */ + EVtUiCmdPolicyPriorityUndefined = 0, + + /** Lowest possible priority */ + EVtUiCmdPolicyPriorityLowest = 1, + + /** Number entry policy priority */ + EVtUiCmdPolicyPriorityNumberEntry, + + /** Menu policy priority */ + EVtUiCmdPolicyPriorityMenu = 100, + + /** Softkey policy priority */ + EVtUiCmdPolicyPrioritySoftkey = 200, + + /** Toolbar policy priority */ + EVtUiCmdPolicyPriorityToolbar = 300, + + /** Primary policy priority, must be highest */ + EVtUiCmdPolicyPriorityPrimary, + + /** Highest possible priority */ + EVtUiCmdPolicyPriorityHighest = EVtUiCmdPolicyPriorityPrimary + + }; + +#endif // T_VTUICMDPOLICYPRIORITY_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuicmdvalidatorcallback.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuicmdvalidatorcallback.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2007 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: Command validator callback class definition. +* +*/ + + +#ifndef T_VTUICMDVALIDATORCALLBACK_H +#define T_VTUICMDVALIDATORCALLBACK_H + +#include + +/** + * MVtUiCmdValidatorCallBack + * + * Command validator callback API. + * + * @since S60 v3.2 + */ +class MVtUiCmdValidatorCallBack + { + +public: + + /** + * Invokes callback call. + */ + virtual TBool Call( TInt ) const = 0; + + }; + +/** + * TVtUiCmdValidatorCallBack + * + * Validator callback wrapper to maintain type safety. Also allows use of + * different types of instances for invocation of callback. + * + * @since S60 v3.2 + */ +template < class T > +NONSHARABLE_CLASS( TVtUiCmdValidatorCallBack ) +: public MVtUiCmdValidatorCallBack + { + + // Callback method type definition + typedef TBool ( T::*TCallBackMethod )( TInt ) const; + +public: + + /** + * Constructor + * + * @param aInstance Instance on which callback method will be called. + * @param aMethod Callback method to be called. + */ + TVtUiCmdValidatorCallBack( const T& aInstance, TCallBackMethod aMethod ); + + /** + * Executes callback. + * + * @param aParameter Callback parameter, e.g. command Id or resource Id. + * @return Callback result. + */ + TBool Call( TInt aParameter ) const; + +private: + + // Instance from which callback method will be invoke + const T* iInstance; + + // Callback method pointer + TCallBackMethod iMethod; + + }; + +#include "tvtuicmdvalidatorcallback.inl" + +#endif // T_VTUICMDVALIDATORCALLBACK_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuicmdvalidatorcallback.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuicmdvalidatorcallback.inl Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2007 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: Command validator callback class inline methods. +* +*/ + + +// ----------------------------------------------------------------------------- +// TVtUiCmdValidatorCallBack< T >::TVtUiCmdValidatorCallBack +// ----------------------------------------------------------------------------- +// +template < class T > +TVtUiCmdValidatorCallBack< T >::TVtUiCmdValidatorCallBack( + const T& aInstance, TCallBackMethod aMethod ) + : iInstance( &aInstance ), iMethod( aMethod ) + { + } + +// ----------------------------------------------------------------------------- +// TVtUiCmdValidatorCallBack< T >::Call +// ----------------------------------------------------------------------------- +// +template < class T > +TBool TVtUiCmdValidatorCallBack< T >::Call( TInt aCommandId ) const + { + return ( iInstance->*iMethod )( aCommandId ); + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuicommandmodifierpriority.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuicommandmodifierpriority.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2006 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: Command modifier priorities. +* +*/ + + +#ifndef VTUICOMMANDMODIFIERPRIORITIES_H +#define VTUICOMMANDMODIFIERPRIORITIES_H + +/** + * Enumerates Modifier priorities + * + * @since S60 3.2 + */ +enum TVtUiCmdModifierPriority + { + /** Undefined priority value */ + EVtUiCmdModifierPriorityUndefined = 0, + + /** Lowest possible priority */ + EVtUiCmdModifierPriorityLowest = 1, + + /** Menu Modifier priority */ + EVtUiCmdModifierPriorityToolbar = 100, + + /** Menu Modifier priority */ + EVtUiCmdModifierPriorityNumberEntry = 101, + + /** Highest possible priority */ + EVtUiCmdModifierPriorityHighest = 500, + }; + +#endif // VTUICOMMANDMODIFIERPRIORITIES_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuilocalvariation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuilocalvariation.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,231 @@ +/* +* Copyright (c) 2007 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: Video Telephone local variation class definition. +* +*/ + + +#ifndef T_VTUILOCALVARIATION_H +#define T_VTUILOCALVARIATION_H + +#include + +#include "tvtflagcontainer.h" + +// User selectable Call answer status values +const TInt KAllwaysQuery = 0; +const TInt KAllwaysAllow = 2; +const TInt KNumberOfTbButtons = 6; + +/** + * TVtUiVariationBase + * + * Base class for local variation classes. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiVariationBase ) : public TVtFlagContainer + { +public: + + /** + * Reads variations from central reposityory. + * and set default value in case error + */ + virtual void ReadL( const TInt adefault = -1 ); + +protected: + + /** + * Returns UID of the repository to be read. + */ + virtual const TUid& Uid() const = 0; + + /** + * ID of the key inside repository to be read. + */ + virtual TUint32 Key() const = 0; + + /** + * Gets key value. + */ + virtual TUint32 ReceiveValue() const; + + }; + +/** + * TVtUiVideoTelephonyVariation + * + * Video Telephony variation class. Reads VT local variation flags from the + * CenRep and contains methods to query flag states. This class should be + * instanced only once and same instance should be passesd as reference to + * modules that need this local variation information. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiVideoTelephonyVariation ) : public TVtUiVariationBase + { + +public: + + /** + * Return whether or not ScalingMethodENearest is set in local variation. + * + * @return ETrue if ScalingMethodENearest local variation flag is set, + * EFalse otherwise. + */ + inline TBool IsScalingMethodENearest() const; + + /** + * Return whether or not ScalingMethodEBilinear is set in local variation. + * + * @return ETrue if ScalingMethodEBilinear local variation flag is set, + * EFalse otherwise. + */ + inline TBool IsScalingMethodEBilinear() const; + + /** + * Return whether or not EnableBitReversal is set in local variation. + * + * @return ETrue if EnableBitReversal local variation flag is set, EFalse + * otherwise. + */ + inline TBool IsEnableBitReversal() const; + +private: // from TVtUiVariationBase + + /** + * @see TVtUiVariationBase::Uid + */ + const TUid& Uid() const; + + /** + * @see TVtUiVariationBase::Key + */ + TUint32 Key() const; + }; + +/** + * TVtUiActiveIdleVariation + * + * Active Idle variation class. Reads AI local variation flags from the + * CenRep and contains methods to query flag states. This class should be + * instanced only once and same instance should be passesd as reference to + * modules that need this local variation information. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiActiveIdleVariation ) : public TVtUiVariationBase + { + +public: + /** + * Return whether or not active idle is enabled in local variation. + * + * @return ETrue if active idle is enabled in local variation. + */ + TBool IsActiveIdleEnabled(); + +private: // from TVtUiVariationBase + + /** + * @see TVtUiVariationBase::Uid + */ + const TUid& Uid() const; + + /** + * @see TVtUiVariationBase::Key + */ + TUint32 Key() const; + +private: + }; + +/** + * TVtUiGsMuteVariation + * + * General settings (Gs) variation class. Reads GS local variation flags from the + * CenRep and contains methods to query flag states and values. This class should be + * instanced only once and same instance should be passesd as reference to + * modules that need this local variation information. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiGsMuteVariation ) : public TVtUiVariationBase + { + +public: + + /** + * Returns Gs mute state value from CanRep. + * + * @return Gs mute state value. + */ + TUint32 GsMuteState(); + +private: // from TVtUiVariationBase + + /** + * @see TVtUiVariationBase::Uid + */ + const TUid& Uid() const; + + /** + * @see TVtUiVariationBase::Key + */ + TUint32 Key() const; + +private: + }; + +/** + * TVtUiToolbarVariation + * + * Toolbar variation class. Reads TB local variation flags from the + * CenRep and contains methods to query flag states and values. This class should be + * instanced only once and same instance should be passesd as reference to + * modules that need this local variation information. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiToolbarVariation ) : public TVtUiVariationBase + { + +public: + /** + * Returns number of toolbar buttons from CanRep. + * + * @return number of toolbar buttons. + */ + TUint32 NumberOfButtons(); + +private: // from TVtUiVariationBase + + /** + * @see TVtUiVariationBase::Uid + */ + const TUid& Uid() const; + + /** + * @see TVtUiVariationBase::Key + */ + TUint32 Key() const; + +private: + }; + + +#include "tvtuilocalvariation.inl" + +#endif // T_VTUILOCALVARIATION_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuilocalvariation.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuilocalvariation.inl Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2007 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: Video Telephone local variation class inline methods. +* +*/ + + +#include "VideoTelephonyVariant.hrh" + +// TVtUiVideoTelephonyVariation + +// ----------------------------------------------------------------------------- +// TVtUiVideoTelephonyVariation::IsScalingMethodENearest +// ----------------------------------------------------------------------------- +// +TBool TVtUiVideoTelephonyVariation::IsScalingMethodENearest() const + { + return IsFlag( KVTLVFlagScalingMethodENearest ); + } + +// ----------------------------------------------------------------------------- +// TVtUiVideoTelephonyVariation::IsScalingMethodEBilinear +// ----------------------------------------------------------------------------- +// +TBool TVtUiVideoTelephonyVariation::IsScalingMethodEBilinear() const + { + return IsFlag( KVTLVFlagScalingMethodEBilinear ); + } + +// ----------------------------------------------------------------------------- +// TVtUiVideoTelephonyVariation::IsEnableBitReversal +// ----------------------------------------------------------------------------- +// +TBool TVtUiVideoTelephonyVariation::IsEnableBitReversal() const + { + return IsFlag( KVTLVFlagEnableBitReversal ); + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuimediastate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuimediastate.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,216 @@ +/* +* Copyright (c) 2007 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: Media state class definition. +* +*/ + + +#ifndef T_VTUIMEDIASTATE_H +#define T_VTUIMEDIASTATE_H + +#include + +#include "tvtflagcontainer.h" + +class MVtEngMedia; +class MVtEngCommandHandler; + +/** + * TVtUiMediaState + * + * Contains information about media's (video) current status. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiMediaState ) : public TVtUpdateableFlagContainer + { +public: + + /** + * Constructor. + * + * @param aMedia Reference to VT engine media object. + * @param aCommandHandler Reference to command handler object. + */ + inline TVtUiMediaState( MVtEngMedia& aMedia, + MVtEngCommandHandler& aCommandHandler ); + + /** + * Return whether or not video is being sent. + * + * @return ETrue if video is being sent. + */ + inline TBool IsVideo() const; + + /** + * Return whether or not any camera is available in device. + * + * @return ETrue if any camera is available in device. + */ + inline TBool HasCamera() const; + + /** + * Return whether or not freeze is supported for active video source. + * + * @return ETrue if freeze is supported for active video source. + */ + inline TBool IsFreezeSupported() const; + + /** + * Return whether or not active video source is frozen. + * + * @return ETrue if video is frozen. + */ + inline TBool IsFrozen() const; + + /** + * Return whether or not share is active. + * + * @return ETrue if still image is being shared. + */ + inline TBool IsSharing() const; + + /** + * Return whether or not sharing is being initialized. + * + * @return ETrue if still image sharing is being initialized. + */ + inline TBool IsInitializingShare() const; + + /** + * Return whether or not primary camera is being used by VT. + * + * @return ETrue if primary camera is being used. + */ + inline TBool IsPrimaryCameraInUse() const; + + /** + * Return whether or not secondary camera is being used by VT. + * + * @return ETrue if secondary camera is being used. + */ + inline TBool IsSecondaryCameraInUse() const; + + /** + * Return whether or not it is possible to share. + * + * @return ETrue if sharing is not allowed. + */ + inline TBool IsNotAbleToShare() const; + + /** + * Return whether or not device has primary camera. + * + * @return ETrue if primary camera is available. + */ + inline TBool HasPrimaryCamera() const; + + /** + * Return whether or not device has secondary camera. + * + * @return ETrue if secondary camera is available. + */ + inline TBool HasSecondaryCamera() const; + + /** + * Return whether or not active video source supports contrast setting. + * + * @return ETrue if contrast settingis allowed. + */ + inline TBool IsContrastSupported() const; + + /** + * Return whether or not active video source supports white balance setting. + * + * @return ETrue if white balance setting is allowed. + */ + inline TBool IsWhiteBalanceSupported() const; + + /** + * Return whether or not active video source supports color tone setting. + * + * @return ETrue if colour tone setting is allowed. + */ + inline TBool IsColorToneSupported() const; + + /** + * Return whether or not active video source supports brightness setting. + * + * @return ETrue if brightness setting is allowed. + */ + inline TBool IsBrightnessSupported() const; + + /** + * Return whether or not video is permanently stopped. + * + * @return ETrue if video is permanently stopped. + */ + inline TBool IsVideoPermanentlyStopped() const; + +private: // from TVtUpdateableFlagContainer + + /** + * @see TVtUpdateableFlagContainer::UpdateFlags + */ + void UpdateFlags(); + +private: + + // Enumeration for media state flags. + enum TFlags + { + /** Set if video is currently enabled. */ + EIsVideo = ( 1<<0 ), + /** Set if device has any cameras */ + EHasCamera = ( 1<<1 ), + /** Set if current active video source supports freezing */ + EIsFreezeSupported = ( 1<<2 ), + /** Set if current active video source is frozen */ + EIsFrozen = ( 1<<3 ), + /** Set if sharing is active */ + EIsSharing = ( 1<<4 ), + /** Set if sharing is being initialized */ + EIsInitializingShare = ( 1<<5 ), + /** Set if device's primary camera is being used by VT application */ + EIsPrimaryCameraInUse = ( 1<<6 ), + /** Set if device's secondary camera is being used by VT application */ + EIsSecondaryCameraInUse = ( 1<<7 ), + /** Set if it is not possible to share */ + EIsNotAbleToShare = ( 1<<8 ), + /** Set if device has primary camera */ + EHasPrimaryCamera = ( 1<<9 ), + /** Set if device has secondary camera */ + EHasSecondaryCamera = ( 1<<10 ), + /** Set if current video source supports contrast setting */ + EIsContrastSupported = ( 1<<11 ), + /** Set if current video source supports white balance setting */ + EIsWhiteBalanceSupported = ( 1<<12 ), + /** Set if current video source supports color tone setting */ + EIsColorToneSupported = ( 1<<13 ), + /** Set if current video source supports brightness setting */ + EIsBrightnessSupported = ( 1<<14 ), + /** Set if video is permanently stopped*/ + EIsVideoPermanentlyStopped = ( 1<<15 ) + }; + + // Reference to engine media instance. + MVtEngMedia& iMedia; + + // Reference to engine command handler instance. + MVtEngCommandHandler& iCommandHandler; + }; + +#include "tvtuimediastate.inl" + +#endif // T_VTUIMEDIASTATE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuimediastate.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuimediastate.inl Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2007 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: Media state class inline methods. +* +*/ + + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::TVtUiMediaState +// ----------------------------------------------------------------------------- +// +TVtUiMediaState::TVtUiMediaState( MVtEngMedia& aMedia, + MVtEngCommandHandler& aCommandHandler ) + : iMedia( aMedia ), iCommandHandler( aCommandHandler ) + { + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsVideo +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsVideo() const + { + return IsFlag( EIsVideo ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::HasCamera +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::HasCamera() const + { + return IsFlag( EHasCamera ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsFreezeSupported +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsFreezeSupported() const + { + return IsFlag( EIsFreezeSupported ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsFrozen +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsFrozen() const + { + return IsFlag( EIsFrozen ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsSharing +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsSharing() const + { + return IsFlag( EIsSharing ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsInitializingShare +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsInitializingShare() const + { + return IsFlag( EIsInitializingShare ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsPrimaryCameraInUse +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsPrimaryCameraInUse() const + { + return IsFlag( EIsPrimaryCameraInUse ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsSecondaryCameraInUse +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsSecondaryCameraInUse() const + { + return IsFlag( EIsSecondaryCameraInUse ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsNotAbleToShare +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsNotAbleToShare() const + { + return IsFlag( EIsNotAbleToShare ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::HasPrimaryCamera +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::HasPrimaryCamera() const + { + return IsFlag( EHasPrimaryCamera ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::HasSecondaryCamera +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::HasSecondaryCamera() const + { + return IsFlag( EHasSecondaryCamera ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsContrastSupported +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsContrastSupported() const + { + return IsFlag( EIsContrastSupported ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsWhiteBalanceSupported +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsWhiteBalanceSupported() const + { + return IsFlag( EIsWhiteBalanceSupported ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsColorToneSupported +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsColorToneSupported() const + { + return IsFlag( EIsColorToneSupported ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsBrightnessSupported +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsBrightnessSupported() const + { + return IsFlag( EIsBrightnessSupported ); + } + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::IsVideoPermanentlyStopped +// ----------------------------------------------------------------------------- +// +TBool TVtUiMediaState::IsVideoPermanentlyStopped() const + { + return IsFlag( EIsVideoPermanentlyStopped ); + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuistates.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuistates.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,679 @@ +/* +* Copyright (c) 2007 - 2008 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: UI states class definition. +* +*/ + + +#ifndef T_VTUISTATES_H +#define T_VTUISTATES_H + +#include + +#include "tvtuimediastate.h" +#include "tvtuiaudiostate.h" + +class CVtEngModel; +class MVtEngCameraPreferences; + +/** + * TVtUiStates + * + * Contains information about Application UI's current status. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiStates ) : public TVtFlagContainer + { + +public: // enumerations + + /** + * Application execution state (will be set by the app state classes) + */ + enum TVtUiExecState + { + EExecStateStarting, + EExecStateRunning, + EExecStateResetting, + EExecStateFinalized + }; + +public: + + /** + * Constructor. + */ + TVtUiStates( CVtEngModel& aModel ); + + /** + * Updates UI states. + */ + void Update(); + + /** + * Return whether or not ColorToneSetting + * is supported by current camera. + * + * @return ETrue if at least one color tone setting is available, + * EFalse otherwise. + */ + TBool IsColorToneSettingAvailable() const; + + /** + * Return whether or not WhiteBalanceSetting + * is supported by current camera. + * + * @return ETrue if at least one white balance setting is available, + * EFalse otherwise. + */ + TBool IsWhiteBalanceSettingAvailable() const; + + /** + * Return whether or not ontrast setting + * is supported by current camera. + * + * @return ETrue if at contrast setting is available, + * EFalse otherwise. + */ + TBool IsContrastSettingAvailable() const; + + /** + * Return whether or not brightness setting + * is supported by current camera. + * + * @return ETrue if brightness setting is available, + * EFalse otherwise. + */ + TBool IsBrightnessSettingAvailable() const; + + /** + * Returns reference to media state object + * + * @return Reference to media state object. + */ + inline const TVtUiMediaState& MediaState() const; + + /** + * Returns reference to audio state object + * + * @return Reference to audio state object. + */ + inline const TVtUiAudioState& AudioState() const; + + /** + * Sets or clears EIsCLIReceived + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetCLIReceived( TBool aSet ); + + /** + * Check if EIsCLIReceived is set + * + * @return ETrue if EIsCLIReceived is set EFalse otherwise + */ + inline TBool IsCLIReceived() const; + + /** + * Sets or clears EIsLayoutChangeNeeded + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetLayoutChangeNeeded( TBool aSet ); + + /** + * Check if EIsLayoutChangeNeeded is set + * + * @return ETrue if EIsLayoutChangeNeeded is set EFalse otherwise + */ + inline TBool IsLayoutChangeNeeded() const; + + /** + * Sets or clears EIsBlankControlAdded + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetBlankControlAdded( TBool aSet ); + + /** + * Check if EIsBlankControlAdded is set + * + * @return ETrue if EIsBlankControlAdded is set EFalse otherwise + */ + inline TBool IsBlankControlAdded() const; + + /** + * Sets or clears EIsLaunchOkOptionsMenu + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetLaunchOkOptionsMenu( TBool aSet ); + + /** + * Check if EIsLaunchOkOptionsMenu is set + * + * @return ETrue if EIsLaunchOkOptionsMenu is set EFalse otherwise + */ + inline TBool IsLaunchOkOptionsMenu() const; + + /** + * Sets or clears EIsDeviceLockOn + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetDeviceLockOn( TBool aSet ); + + /** + * Check if EIsDeviceLockOn is set + * + * @return ETrue if EIsDeviceLockOn is set EFalse otherwise + */ + inline TBool IsDeviceLockOn() const; + + /** + * Sets or clears EDetailsReceived + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetDetailsReceived( TBool aSet ); + + /** + * Check if EDetailsReceived is set + * + * @return ETrue if EDetailsReceived is set EFalse otherwise + */ + inline TBool IsDetailsReceived() const; + + /** + * Sets or clears EWaitingForFirstFrame + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetWaitingForFirstFrame( TBool aSet ); + + /** + * Check if EWaitingForFirstFrame is set + * + * @return ETrue if EWaitingForFirstFrame is set EFalse otherwise + */ + inline TBool IsWaitingForFirstFrame() const; + + /** + * Sets or clears EUseSQCif + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetUseSQCif( TBool aSet ); + + /** + * Check if EUseSQCif is set + * + * @return ETrue if EUseSQCif is set EFalse otherwise + */ + inline TBool IsUseSQCif() const; + + /** + * Sets or clears EIsViewFindersInitialPlaceContextPane + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetViewFindersInitialPlaceContextPane( TBool aSet ); + + /** + * Check if EIsViewFindersInitialPlaceContextPane is set + * + * @return ETrue if EIsViewFindersInitialPlaceContextPane is set EFalse + * otherwise + */ + inline TBool IsViewFindersInitialPlaceContextPane() const; + + /** + * Sets or clears EViewFinderToMainPane + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetViewFinderToMainPane( TBool aSet ); + + /** + * Check if EViewFinderToMainPane is set + * + * @return ETrue if EViewFinderToMainPane is set EFalse otherwise + */ + inline TBool IsViewFinderToMainPane() const; + + /** + * Sets or clears EIsCaptureModeOn + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetCaptureModeOn( TBool aSet ); + + /** + * Check if EIsCaptureModeOn is set + * + * @return ETrue if EIsCaptureModeOn is set EFalse otherwise + */ + inline TBool IsCaptureModeOn() const; + + /** + * Sets or clears EIsThisApplicationForeground + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetThisApplicationForeground( TBool aSet ); + + /** + * Check if EIsThisApplicationForeground is set + * + * @return ETrue if EIsThisApplicationForeground is set EFalse otherwise + */ + inline TBool IsThisApplicationForeground() const; + + /** + * Sets or clears EIsDisableBlindSetting + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetDisableBlindSetting( TBool aSet ); + + /** + * Check if EIsDisableBlindSetting is set + * + * @return ETrue if EIsDisableBlindSetting is set EFalse otherwise + */ + inline TBool IsDisableBlindSetting() const; + + /** + * Sets or clears EExecShowCameraInUse + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetExecShowCameraInUse( TBool aSet ); + + /** + * Check if EExecShowCameraInUse is set + * + * @return ETrue if EExecShowCameraInUse is set EFalse otherwise + */ + inline TBool IsExecShowCameraInUse() const; + + /** + * Check if EIsZoomModeOn is set + * + * @return ETrue if EIsZoomModeOn is set EFalse otherwise + */ + inline TBool IsZoomModeOn() const; + + /** + * Sets or clears EIsZoomModeOn + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetZoomModeOn( TBool aSet ); + + /** + * Check if EIsWhiteBalanceModeOn is set + * + * @return ETrue if EIsWhiteBalanceModeOn is set EFalse otherwise + */ + inline TBool IsWhiteBalanceModeOn() const; + + /** + * Sets or clears EIsWhiteBalanceModeOn + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetWhiteBalanceModeOn( TBool aSet ); + + /** + * Check if EIsColorToneModeOn is set + * + * @return ETrue if EIsColorToneModeOn is set EFalse otherwise + */ + inline TBool IsColorToneModeOn() const; + + /** + * Sets or clears EIsColorToneModeOn + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetColorToneModeOn( TBool aSet ); + + /** + * Check if EBrightnessModeOn is set + * + * @return ETrue if EBrightnessModeOn is set EFalse otherwise + */ + inline TBool IsBrightnessModeOn() const; + + /** + * Sets or clears EBrightnessModeOn + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetBrightnessModeOn( TBool aSet ); + + /** + * Check if EContrastModeOn is set + * + * @return ETrue if EContrastModeOn is set EFalse otherwise + */ + inline TBool IsContrastModeOn() const; + + /** + * Sets or clears EContrastModeOn + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetContrastModeOn( TBool aSet ); + + /** + * Sets or clears EIsNumberEntryOpen + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetIsNumberEntryOpen( TBool aSet ); + + /** + * Check if EIsNumberEntryOpen is set + * + * @return ETrue if EIsNumberEntryOpen is set EFalse otherwise + */ + inline TBool IsNumberEntryOpen() const; + + /** + * Sets or clears EIsToolbarAvailable + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetIsToolbarAvailable( TBool aSet ); + + /** + * Check if IsToolbarAvailable is set + * + * @return ETrue if IsToolbarAvailable is set EFalse otherwise + */ + inline TBool IsToolbarAvailable() const; + + /** + * Sets or clears EIsWaitingCall + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetWaitingCall( TBool aSet ); + + /** + * Check if there is waiting video/voice call. + * + * @return ETrue if waiting call is ongoing, EFalse otherwise + */ + inline TBool IsWaitingCall() const; + + /** + * Sets or clears EIsSelectingShare + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetSelectingShare( TBool aSet ); + + /** + * Check if user is selecting file to be shared. + * + * @return ETrue if user is selecting file, EFalse otherwise + */ + inline TBool IsSelectingShare() const; + + /** + * Sets or clears EIsDialerOpen + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetIsDialerOpen( TBool aSet ); + + /** + * Check if video DTMF dialer is open. + * + * @return ETrue if dialer is open, EFalse otherwise + */ + inline TBool IsDialerOpen() const; + + /** + * Sets or clears EIsFixedToolbarVisible + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetIsFixedToolbarVisible( TBool aSet ); + + /** + * Check if fixed toolbar is visible. + * + * @return ETrue iftoolbar is visible, EFalse otherwise + */ + inline TBool IsFixedToolbarVisible() const; + + /** + * Sets or clears EIsDialerActivating + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetIsDialerActivating( TBool aSet ); + + /** + * Check if dialer is being activated + * + * @return ETrue if dialer is being activated, EFalse otherwise + */ + inline TBool IsDialerActivating() const; + + /** + * Adjusts command activating reference count + * + * @param aSet ETrue if setting will be increased, EFalse if + * decreased. + */ + void SetIsCommandActivating( TBool aSet ); + + /** + * Check if command activating ref.count is greater than zero + * + * @return ETrue if any command is being activated, EFalse otherwise + */ + inline TBool IsCommandActivating() const; + + /** + * Check if EIsVolumeModeOn is set + * + * @return ETrue if EIsVolumeModeOn is set EFalse otherwise + */ + inline TBool IsVolumeModeOn() const; + + /** + * Sets or clears EIsVolumeModeOn + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetVolumeModeOn( TBool aSet ); + + /** + * Check if EIsVideoQualityModeOn is set + * + * @return ETrue if EIsVideoQualityModeOn is set EFalse otherwise + */ + inline TBool IsVideoQualityModeOn() const; + + /** + * Sets or clears EIsVideoQualityModeOn + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + + inline void SetVideoQualityModeOn( TBool aSet ); + /** + * Sets or clears EIsFloatingToolbarVisible + * + * @param aSet ETrue if setting will be set, EFalse otherwise. + */ + inline void SetIsFloatingToolbarVisible( TBool aSet ); + + /** + * Check if floating toolbar is visible. + * + * @return ETrue iftoolbar is visible, EFalse otherwise + */ + inline TBool IsFloatingToolbarVisible() const; + + /** + * Returns application's execution state. + * @return Application's current execution state. + */ + TVtUiExecState ExecState() const; + +private: // methods to be accessed only by certain classes (see friends) + + /** + * Sets application's execution state. + * @param aState Application's new execution state. + */ + void SetExecState( const TVtUiExecState aState ); + +private: + + // Enumeration for ui state flags. + enum TFlags + { + /** Set if CLI is received */ + EIsCLIReceived = ( 1<<0 ), + + /** Set if layout change is needed */ + EIsLayoutChangeNeeded = ( 1<<1 ), + + /** Set if blank control has been added to control stack */ + EIsBlankControlAdded = ( 1<<2 ), + + /** Set if launch ok in options menu */ + EIsLaunchOkOptionsMenu = ( 1<<3 ), + + /** Set if device lock is on */ + EIsDeviceLockOn = ( 1<<4 ), + + /** Set if details have been received */ + EDetailsReceived = ( 1<<5 ), + + /** Set if waiting for first frame */ + EWaitingForFirstFrame = ( 1<<6 ), + + /** Set if SQCIF is being used */ + EUseSQCif = ( 1 << 7 ), + + /** Set if images was in context pane before freeze, unset if not */ + EViewFindersInitialPlaceContextPane = ( 1<<8 ), + + /** Set if viewfinder has to be moved to mainpane, when imageshare is + ready */ + EViewFinderToMainPane = ( 1<<9 ), + + /** Set if capture mode is on, unset if off */ + EIsCaptureModeOn = ( 1<<10 ), + + /** Set if application on foreground */ + EIsThisApplicationForeground = ( 1<<11 ), + + /** Set if blind setting should be temporarily disabled. + This is used in preventing blind bitmap from flashing + while operations involving multiple engine commands/events + take place (e.g. 'Swap image places' and layout switch). */ + EIsDisableBlindSetting = ( 1<<12 ), + + /** Set if camera in use note should be shown. */ + EExecShowCameraInUse = ( 1<<13 ), + + /** Set if zooming slider indicators is shown in navi pane. + Toolbar also dims other toolbar controls except zoom + mode control.*/ + EIsZoomModeOn = ( 1<<14 ), + + /** Set if contrast mode is on, unset if off */ + EIsContrastModeOn = ( 1<<15 ), + + /** Set if brightness mode is on, unset if off */ + EIsBrightnessModeOn = ( 1<<16 ), + + /** Set if number entry is open in UI (do not use this flag in new code) + */ + EIsNumberEntryOpen = ( 1<<17 ), + + /** Set if toolbar is available in UI */ + EIsToolbarAvailable = ( 1<<18 ), + + /** Set if waiting call exists */ + EIsWaitingCall = ( 1<<19 ), + + /** Set if initializing share */ + EIsSelectingShare = ( 1<<20 ), + + /** Set if initializing share */ + EIsDialerOpen = ( 1<<21 ), + + /** Set if white balance mode is on, unset if off */ + EIsWhiteBalanceModeOn = ( 1<<22 ), + + /** Set if color tone mode is on, unset if off */ + EIsColorToneModeOn = ( 1 << 23 ), + + /** Set if fixed toolar is visible, unset if not */ + EIsFixedToolbarVisible = ( 1 << 24 ), + + /** Set if dialer is being activated, unset if not */ + EIsDialerActivating = ( 1 << 25 ), + + /** Set if volume mode is on, unset if off */ + EIsVolumeModeOn = ( 1 << 26 ), + + /** Set if floating toolar is visible, unset if not */ + EIsFloatingToolbarVisible = ( 1 << 27 ), + + /** Set if video quality mode is on, unset if not */ + EIsVideoQualityModeOn = ( 1 << 28 ) + }; + + // Engine media state + TVtUiMediaState iMediaState; + + // Engine audio state + TVtUiAudioState iAudioState; + + // Refrence to engine + CVtEngModel& iModel; + + // Refrence to camera prefrences + MVtEngCameraPreferences* iCameraPref; + + // Application execution state + TVtUiExecState iExecState; + + // Reference count of command activating. Enables command to be set + // active several times and action to take only when count is reset + // back to zer0. + TUint iCommandActivatingRefCount; + +private: // friends + + friend class TVtUiAppStateBase; + + }; + +#include "tvtuistates.inl" + +#endif // T_VTUISTATES_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtuistates.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtuistates.inl Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,596 @@ +/* +* Copyright (c) 2007 - 2008 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: UI states class inline methods. +* +*/ + + +// ----------------------------------------------------------------------------- +// TVtUiStates::MediaState +// ----------------------------------------------------------------------------- +// +const TVtUiMediaState& TVtUiStates::MediaState() const + { + return iMediaState; + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::AudioState +// ----------------------------------------------------------------------------- +// +const TVtUiAudioState& TVtUiStates::AudioState() const + { + return iAudioState; + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetCLIReceived +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetCLIReceived( TBool aSet ) + { + aSet ? SetFlag( EIsCLIReceived ) : ClearFlag( EIsCLIReceived ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsCLIReceived +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsCLIReceived() const + { + return IsFlag( EIsCLIReceived ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetLayoutChangeNeeded +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetLayoutChangeNeeded( TBool aSet ) + { + aSet ? SetFlag( EIsLayoutChangeNeeded ) : + ClearFlag( EIsLayoutChangeNeeded ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsLayoutChangeNeeded +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsLayoutChangeNeeded() const + { + return IsFlag( EIsLayoutChangeNeeded ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetBlankControlAdded +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetBlankControlAdded( TBool aSet ) + { + aSet ? SetFlag( EIsBlankControlAdded ) : + ClearFlag( EIsBlankControlAdded ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsBlankControlAdded +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsBlankControlAdded() const + { + return IsFlag( EIsBlankControlAdded ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetLaunchOkOptionsMenu +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetLaunchOkOptionsMenu( TBool aSet ) + { + aSet ? SetFlag( EIsLaunchOkOptionsMenu ) : + ClearFlag( EIsLaunchOkOptionsMenu ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsLaunchOkOptionsMenu +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsLaunchOkOptionsMenu() const + { + return IsFlag( EIsLaunchOkOptionsMenu ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetDeviceLockOn +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetDeviceLockOn( TBool aSet ) + { + aSet ? SetFlag( EIsDeviceLockOn ) : + ClearFlag( EIsDeviceLockOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsDeviceLockOn +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsDeviceLockOn() const + { + return IsFlag( EIsDeviceLockOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetDetailsReceived +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetDetailsReceived( TBool aSet ) + { + aSet ? SetFlag( EDetailsReceived ) : + ClearFlag( EDetailsReceived ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsDetailsReceived +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsDetailsReceived() const + { + return IsFlag( EDetailsReceived ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetWaitingForFirstFrame +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetWaitingForFirstFrame( TBool aSet ) + { + aSet ? SetFlag( EWaitingForFirstFrame ) : + ClearFlag( EWaitingForFirstFrame ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsWaitingForFirstFrame +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsWaitingForFirstFrame() const + { + return IsFlag( EWaitingForFirstFrame ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetUseSQCif +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetUseSQCif( TBool aSet ) + { + aSet ? SetFlag( EUseSQCif ) : + ClearFlag( EUseSQCif ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsUseSQCif +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsUseSQCif() const + { + return IsFlag( EUseSQCif ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetViewFindersInitialPlaceContextPane +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetViewFindersInitialPlaceContextPane( TBool aSet ) + { + aSet ? SetFlag( EViewFindersInitialPlaceContextPane ) : + ClearFlag( EViewFindersInitialPlaceContextPane ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsViewFindersInitialPlaceContextPane +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsViewFindersInitialPlaceContextPane() const + { + return IsFlag( EViewFindersInitialPlaceContextPane ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetViewFinderToMainPane +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetViewFinderToMainPane( TBool aSet ) + { + aSet ? SetFlag( EViewFinderToMainPane ) : + ClearFlag( EViewFinderToMainPane ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsViewFinderToMainPane +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsViewFinderToMainPane() const + { + return IsFlag( EViewFinderToMainPane ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetCaptureModeOn +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetCaptureModeOn( TBool aSet ) + { + aSet ? SetFlag( EIsCaptureModeOn ) : + ClearFlag( EIsCaptureModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsCaptureModeOn +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsCaptureModeOn() const + { + return IsFlag( EIsCaptureModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetThisApplicationForeground +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetThisApplicationForeground( TBool aSet ) + { + aSet ? SetFlag( EIsThisApplicationForeground ) : + ClearFlag( EIsThisApplicationForeground ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsThisApplicationForeground +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsThisApplicationForeground() const + { + return IsFlag( EIsThisApplicationForeground ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetDisableBlindSetting +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetDisableBlindSetting( TBool aSet ) + { + aSet ? SetFlag( EIsDisableBlindSetting ) : + ClearFlag( EIsDisableBlindSetting ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsDisableBlindSetting +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsDisableBlindSetting() const + { + return IsFlag( EIsDisableBlindSetting ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetExecShowCameraInUse +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetExecShowCameraInUse( TBool aSet ) + { + aSet ? SetFlag( EExecShowCameraInUse ) : + ClearFlag( EExecShowCameraInUse ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsExecShowCameraInUse +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsExecShowCameraInUse() const + { + return IsFlag( EExecShowCameraInUse ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsZoomModeOn +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsZoomModeOn() const + { + return IsFlag( EIsZoomModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetZoomModeOn +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetZoomModeOn( TBool aSet ) + { + aSet ? SetFlag( EIsZoomModeOn ) : + ClearFlag( EIsZoomModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsWhiteBalanceModeOn +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsWhiteBalanceModeOn() const + { + return IsFlag( EIsWhiteBalanceModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetWhiteBalanceModeOn +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetWhiteBalanceModeOn( TBool aSet ) + { + aSet ? SetFlag( EIsWhiteBalanceModeOn ) : + ClearFlag( EIsWhiteBalanceModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsColorToneModeOn +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsColorToneModeOn() const + { + return IsFlag( EIsColorToneModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetColorToneModeOn +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetColorToneModeOn( TBool aSet ) + { + aSet ? SetFlag( EIsColorToneModeOn ) : + ClearFlag( EIsColorToneModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsBrightnessModeOn +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsBrightnessModeOn() const + { + return IsFlag( EIsBrightnessModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetBrightnessModeOn +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetBrightnessModeOn( TBool aSet ) + { + aSet ? SetFlag( EIsBrightnessModeOn ) : + ClearFlag( EIsBrightnessModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsContrastModeOn +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsContrastModeOn() const + { + return IsFlag( EIsContrastModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetContrastModeOn +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetContrastModeOn( TBool aSet ) + { + aSet ? SetFlag( EIsContrastModeOn ) : + ClearFlag( EIsContrastModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetIsNumberEntryOpen +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetIsNumberEntryOpen( TBool aSet ) + { + aSet ? SetFlag( EIsNumberEntryOpen ) : + ClearFlag( EIsNumberEntryOpen ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsNumberEntryOpen +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsNumberEntryOpen() const + { + return IsFlag( EIsNumberEntryOpen ); + } + + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetIsToolbarAvailable +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetIsToolbarAvailable( TBool aSet ) + { + aSet ? SetFlag( EIsToolbarAvailable ) : + ClearFlag( EIsToolbarAvailable ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsToolbarAvailable +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsToolbarAvailable() const + { + return IsFlag( EIsToolbarAvailable ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates:::SetWaitingCall +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetWaitingCall( TBool aSet ) + { + aSet ? SetFlag( EIsWaitingCall ) : + ClearFlag( EIsWaitingCall ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsWaitingCall +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsWaitingCall() const + { + return IsFlag( EIsWaitingCall ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates:::SetSelectingShare +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetSelectingShare( TBool aSet ) + { + aSet ? SetFlag( EIsSelectingShare ) : + ClearFlag( EIsSelectingShare ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsSelectingShare +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsSelectingShare() const + { + return IsFlag( EIsSelectingShare ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetIsDialerOpen +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetIsDialerOpen( TBool aSet ) + { + aSet ? SetFlag( EIsDialerOpen ) : + ClearFlag( EIsDialerOpen ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsDialerOpen +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsDialerOpen() const + { + return IsFlag( EIsDialerOpen ); + } + + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetIsFixedToolbarVisible +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetIsFixedToolbarVisible( TBool aSet ) + { + aSet ? SetFlag( EIsFixedToolbarVisible ) : + ClearFlag( EIsFixedToolbarVisible ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsFixedToolbarVisible +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsFixedToolbarVisible() const + { + return IsFlag( EIsFixedToolbarVisible ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetIsDialerActivating +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetIsDialerActivating( TBool aSet ) + { + aSet ? SetFlag( EIsDialerActivating ) : + ClearFlag( EIsDialerActivating ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsDialerActivating +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsDialerActivating() const + { + return IsFlag( EIsDialerActivating ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsCommandActivating +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsCommandActivating() const + { + return iCommandActivatingRefCount > 0; + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsVolumeModeOn +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsVolumeModeOn() const + { + return IsFlag( EIsVolumeModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetVolumeModeOn +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetVolumeModeOn( TBool aSet ) + { + aSet ? SetFlag( EIsVolumeModeOn ) : + ClearFlag( EIsVolumeModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetIsFloatingToolbarVisible +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetIsFloatingToolbarVisible( TBool aSet ) + { + aSet ? SetFlag( EIsFloatingToolbarVisible ) : + ClearFlag( EIsFloatingToolbarVisible ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsFloatingToolbarVisible +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsFloatingToolbarVisible() const + { + return IsFlag( EIsFloatingToolbarVisible ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsVideoQualityModeOn +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsVideoQualityModeOn() const + { + return IsFlag( EIsVideoQualityModeOn ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetVideoQualityModeOn +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetVideoQualityModeOn( TBool aSet ) + { + aSet ? SetFlag( EIsVideoQualityModeOn ) : + ClearFlag( EIsVideoQualityModeOn ); + } \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/compman/cvtuicomponentmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/compman/cvtuicomponentmanager.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,435 @@ +/* +* Copyright (c) 2006 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: Component manager implementation. +* +*/ + + +#ifndef C_VTUICOMPONENTMANAGER_H +#define C_VTUICOMPONENTMANAGER_H + +#include + +#include "mvtuicomponentmanager.h" +#include "mvtuicomponent.h" +#include "tvtuicomponentstate.h" + +/** + * CVtUiComponentManager + * + * Component manager implementation. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiComponentManager ) + : public CBase, public MVtUiComponentManager + { + +public: // public methods + + /** + * Static constructor. + * + * @return Newly created instance of CVtUiComponentManager class. + */ + static CVtUiComponentManager* NewL(); + + /** + * Destructor. + */ + ~CVtUiComponentManager(); + + /** + * Called when a Ws event is delivered. + * + * @param aEvent Window server event. + * @param aDestination Event destination control. + */ + void HandleWsEventL( const TWsEvent& aEvent, CCoeControl *aDestination ); + + /** + * Called when a resource change is informed. + * + * @param aType Type of change. + */ + void HandleResourceChangeL( TInt aType ); + + /** + * Called when a keyevent needs handling. + * + * @param aKeyEvent Key event structure. + * @param aCode Event code. + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType); + + /** + * Called when a layout change is informed. + * + */ + void HandleLayoutChangeL(); + +public: // from MVtUiComponentManager + + /** + * @see MVtUiComponentManager::ChangeWsEventRegistration + */ + TInt ChangeWsEventRegistration( MVtUiWindowServerEventObserver& aObserver, + TAction aAction ); + + /** + * @see MVtUiComponentManager::ChangeResourceChangeRegistration + */ + TInt ChangeResourceChangeRegistration( + MVtUiResourceChangeObserver& aObserver, + TAction aAction ); + + /** + * @see MVtUiComponentManager::ChangeKeyEventRegistration + */ + TInt ChangeKeyEventRegistration( MVtUiKeyEventObserver& aComponent, + TAction aAction ); + + /** + * @see MVtUiComponentManager::ChangeLayoutChangeRegistration + */ + TInt ChangeLayoutChangeRegistration( MVtUiLayoutChangeObserver& aComponent, + TAction aAction ); + + /** + * @see MVtUiComponentManager::ChangeComponentRegistration + */ + TInt ChangeComponentRegistration( TVtUiComponentState& aComponentState, + TAction aAction ); + + /** + * @see MVtUiComponentManager::RequestActivation + */ + void RequestActivationL( MVtUiComponent::TComponentId aId ); + + /** + * @see MVtUiComponentManager::DeActivateComponentL + */ + void DeActivateComponentL( MVtUiComponent::TComponentId aId ); + +private: // private classes + + /** + * TStateListItem + * + * Contains one component's state in state list. + */ + class TStateListItem + { + + public: // public type definitions + + /** + * Compare by key type definition. + */ + typedef TInt (*TKeyCmpFunc) + ( const MVtUiComponent::TComponentId*, const TStateListItem& ); + + public: // public methods + + /** + * Constructor + * + * @param aState Constant reference to component state. + */ + TStateListItem( const TVtUiComponentState& aState ); + + /** + * Returns component id. + * + * @return Component's id. + */ + MVtUiComponent::TComponentId ComponentId() const; + + /** + * Returns component's state. + * + * @return Component's state. + */ + TVtUiComponentState::TState State() const; + + /** + * Sets component's state. + * + * @param aState Component's new state. + */ + void SetState( TVtUiComponentState::TState aState ); + + /** + * Returns const reference to block list. + * + * @return Constant reference to block list. + */ + const TVtUiBlockList& BlockList() const; + + /** + * Sets this object as root. + */ + void SetRoot(); + + /** + * Returns ETrue if this object is root. + * + * @return ETrue if this item is root, EFalse otherwise. + */ + TBool IsRoot() const; + + /** + * Sets this object as visited. + */ + void SetVisited(); + + /** + * Returns ETrue if this object is visited. + * + * @return ETrue if this item has been visited, EFalse otherwise. + */ + TBool IsVisited() const; + + public: // static public methods + + /** + * Returns TLinearOrder for RArray operations. Ordered by component id. + * + * @return TLinearOrder insntace for RArray operations. Ordering will + * be done based on component Id. + */ + static TLinearOrder< TStateListItem > LinearOrder(); + + /** + * Returns key order function for RArray operations. + * + * @return Key compare method pointer for RArray operations. + */ + static TKeyCmpFunc KeyOrder(); + + /** + * Returns TLinearOrder for RArray operations. Ordered by component + * state. + * + * @return TLinearOrder instance for RArray operations. Ordering will + * be done based on component state. + */ + static TLinearOrder< TStateListItem > StateOrder(); + + private: // static private methods + + /** + * StateListItem compare method. + */ + static TInt ItemCmpFunc( const TStateListItem& aItem1, + const TStateListItem& aItem2 ); + + /** + * StateListItem vs key compare method. + */ + static TInt KeyCmpFunc( const MVtUiComponent::TComponentId* aKey, + const TStateListItem& aItem ); + + /** + * StateListItem by state compare method. + */ + static TInt StateCmpFunc( const TStateListItem& aItem1, + const TStateListItem& aItem2 ); + + private: // data + + // Component's ID + MVtUiComponent::TComponentId iComponentId; + + // Component's state + TVtUiComponentState::TState iState; + + // Block mask (IDs which will be blocked by this component) + TVtUiBlockListBitField iBlockList; + + // ETrue if this component is the root compoent, EFalse otherwise + TBool iIsRoot; + + // ETrue if this component has been already visited (i.e. evaluated) + TBool iIsVisited; + + }; + + /** + * TStateList + * + * Contains list of component states. This list can be modified and when all + * modifications are ready, the whole list can be commited at once. + * + */ + class TStateList + { + + public: // public methods + + /** + * Constructor. + */ + TStateList(); + + /** + * Destructor. + */ + ~TStateList(); + + /** + * Add new item to state list. + * + * @param aItem Reference to item to be added to the list. + */ + void AddItemL( TStateListItem& aItem ); + + /** + * Returns number of items in state list. + * + * @return Number of items on list. + */ + TInt ItemCount() const; + + /** + * Find state list item by component id. + * + * @param aComponentId Id of component that will be searched. + * @return Index of the component or KErrNotFound if component with + * given Id could not be found. + */ + TInt FindItem( MVtUiComponent::TComponentId aComponentId ) const; + + /** + * Returns reference to state list item at given index. + * + * @param aIndex Index of the item to be fetched. + * @return Reference to item at given index. + */ + TStateListItem& At( TInt aIndex ); + + /** + * Returns const reference to state list item at given index. + * + * @param aIndex Index of the item to be fetched. + * @return Constant reference to item at given index. + */ + const TStateListItem& At( TInt aIndex ) const; + + /** + * Sorts list using given linear order. + * + * @param aOrder TLinearObject that will be used in sorting. + */ + void Sort( + TLinearOrder< CVtUiComponentManager::TStateListItem > aOrder ); + + private: // data + + // List items + RArray< TStateListItem > iItems; + + }; + +private: // enumerations + + /** + * Activation actions + */ + enum TActivationAction + { + /** Hide component */ + EHide, + /** Show component */ + EShow + }; + +private: + + /** + * Constructor + */ + CVtUiComponentManager(); + + /** + * 2nd constructor, may leave + */ + void ConstructL(); + + /** + * Adds or removes component from given array. + */ + template < class T > + TInt AddOrRemoveComponent( RPointerArray< T >& aArray, T* aComponent, + TAction aAction ); + + /** + * Returns linear order object for array operations. + */ + static TLinearOrder< MVtUiComponent > ComponentOrder(); + + /** + * Returns linear order object for array operations. + */ + static TLinearOrder< TVtUiComponentState > ComponentStateOrder(); + + /** + * Starts activation process. + */ + void DoActivationL( TVtUiComponentState& aComponentState, + TVtUiComponentState::TState aNewState ); + + /** + * Starts deactivation process. + */ + void DoDeactivationL( TVtUiComponentState& aComponentState, + TVtUiComponentState::TState aNewState ); + + /** + * Calculates activation. + */ + void CalculateActivationL( const TVtUiBlockList& aBlockList, + const TVtUiBlockList& aExclList, TStateList& aStateList, + TActivationAction aAction ); + + /** + * Commits activation calculation results. + */ + void CommitStateListL( TStateList& aList ); + + /** + * Constructs component state list before the calculations. + */ + void ConstructStateListL( TStateList& aList ); + +private: // data + + // Window server event listeners + RPointerArray< MVtUiWindowServerEventObserver > iWsEventObservers; + + // Resource change event listeners + RPointerArray< MVtUiResourceChangeObserver > iResourceChangeObservers; + + // Key event listeners + RPointerArray< MVtUiKeyEventObserver > iKeyEventObservers; + + // Layout change listeners + RPointerArray< MVtUiLayoutChangeObserver > iLayoutChangeObservers; + + // Registered components + RPointerArray< TVtUiComponentState > iComponents; + + }; + +#endif // C_VTUICOMPONENTMANAGER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/compman/mvtuicomponent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/compman/mvtuicomponent.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2006 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: VT UI Component API definition. +* +*/ + + +#ifndef M_VTUICOMPONENT_H +#define M_VTUICOMPONENT_H + +#include + +class CCoeControl; + +/** + * MVtUiComponent + * + * UI component API definition. + * + * @since S60 v3.2 + */ +class MVtUiComponent + { + +public: // enumerations + + /** + * Component Ids. + */ + enum TComponentId + { + /** NULL component Id */ + EComponentIdNull = 0, + /** Toobar component Id */ + EComponentIdToolbar = ( 1 << 0 ), + /** Number entry component Id */ + EComponentIdNumberEntry = ( 1 << 1 ), + /** Video quality component id */ + EComponentIdVideoQuality = ( 1 << 2 ), + /** White balance feature id */ + EComponentIdWhiteBalance = ( 1 << 3 ), + /** Color tone component id */ + EComponentIdColorTone = ( 1 << 4 ), + /** Brightness component id */ + EVComponentIdBrightness = ( 1 << 5 ), + /** Contrast component id */ + EVComponentIdContrast = ( 1 << 6 ), + /** Dialer component id */ + EComponentIdDialer = ( 1 << 7 ), + /** Volume component id */ + EComponentIdVolume = ( 1 << 8 ), + /** Zoom component id */ + EComponentIdZoom = ( 1 << 9 ) + }; + +public: // public methods + + /** + * Returns component id. + * + * @return Component's id. + */ + virtual TComponentId ComponentId() const = 0; + + /** + * Returns this component as a CCoeControl. + * + * @return Component as a pointer to CCoeControl or NULL if this component + * is not inherited from CCoeControl. + */ + virtual CCoeControl* ComponentAsControl() = 0; + + /** + * Activates component. + */ + virtual void DoActivateL() = 0; + + /** + * Deactivates component. + */ + virtual void DoDeactivateL() = 0; + + }; + +#endif // M_VTUICOMPONENT_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/compman/mvtuicomponentmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/compman/mvtuicomponentmanager.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2006 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: VT UI Component manager API definition. +* +*/ + + +#ifndef M_VTUICOMPONENTMANAGER_H +#define M_VTUICOMPONENTMANAGER_H + +#include + +#include "mvtuicomponent.h" + +class TVtUiComponentState; +class MVtUiWindowServerEventObserver; +class MVtUiResourceChangeObserver; +class MVtUiKeyEventObserver; +class MVtUiLayoutChangeObserver; + +/** + * MVtUiComponentManager + * + * Component manager API definition. + * + * @since S60 v3.2 + */ +class MVtUiComponentManager + { + +public: // enumerations + + /** + * Registration action. + */ + enum TAction + { + /** Register action */ + ERegister, + + /** Unregister action */ + EUnregister + }; + +public: // public methods + + /** + * Register or unregister Ws event listening. + * + * @param aComponent Observer whose registration will be changed. + * @param aAction Registration action + * @see MVtUiComponentManager::TAction + * @return KErrNone if registration action succeeded. + */ + virtual TInt ChangeWsEventRegistration( + MVtUiWindowServerEventObserver& aComponent, + TAction aAction ) = 0; + + /** + * Register or unregister resource change event listening. + * + * @param aComponent Observer whose registration will be changed. + * @param aAction Registration action + * @see MVtUiComponentManager::TAction + * @return KErrNone if registration action succeeded. + */ + virtual TInt ChangeResourceChangeRegistration( + MVtUiResourceChangeObserver& aComponent, + TAction aAction ) = 0; + + /** + * Register or unregister key event listening. + * + * @param aComponent Observer whose registration will be changed. + * @param aAction Registration action + * @see MVtUiComponentManager::TAction + * @return KErrNone if registration action succeeded. + */ + virtual TInt ChangeKeyEventRegistration( MVtUiKeyEventObserver& aComponent, + TAction aAction ) = 0; + + /** + * Register or unregister layout change listening. + * + * @param aComponent Observer whose registration will be changed. + * @param aAction Registration action + * @see MVtUiComponentManager::TAction + * @return KErrNone if registration action succeeded. + */ + virtual TInt ChangeLayoutChangeRegistration( MVtUiLayoutChangeObserver& aComponent, + TAction aAction ) = 0; + + /** + * Register or unregister component. + * + * @param aComponent Observer whose registration will be changed. + * @param aAction Registration action + * @see MVtUiComponentManager::TAction + * @return KErrNone if registration action succeeded. + */ + virtual TInt ChangeComponentRegistration( TVtUiComponentState& aComponent, + TAction aAction ) = 0; + + /** + * Request component activation. + * + * @param aId Id of component to be activated. + */ + virtual void RequestActivationL( MVtUiComponent::TComponentId aId ) = 0; + + /** + * Deactivate component. + * + * @param aId Id of component to be deactivated. + */ + virtual void DeActivateComponentL( MVtUiComponent::TComponentId aId ) = 0; + + }; + +#endif // M_VTUICOMPONENTMANAGER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/compman/mvtuikeyeventobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/compman/mvtuikeyeventobserver.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006 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: Key event observer API for components. +* +*/ + + +#ifndef M_VTUIKEYEVENTOBSERVER_H +#define M_VTUIKEYEVENTOBSERVER_H + +#include +#include + +/** + * MVtUiKeyEventObserver + * + * Keyevent observer API definition. + * + * @since S60 v3.2 + */ +class MVtUiKeyEventObserver + { + +public: + + /** + * Called when key event handling is required. + * + * @param aEvent The key event. + * @param aCode The type of key event: EEventKey, EEventKeyUp or + * EEventKeyDown. + * @return Indicates whether or not the key event was used. + */ + virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode aCode ) = 0; + + }; + +#endif // M_VTUIKEYEVENTOBSERVER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/compman/mvtuilayoutchangeobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/compman/mvtuilayoutchangeobserver.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2007 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: Layout change observer API definition. +* +*/ + + +#ifndef M_VTUILAYOUTCHANGEOBSERVER_H +#define M_VTUILAYOUTCHANGEOBSERVER_H + +#include + +/** + * MVtUiLayoutChangeObserver + * + * Layout change observer API definition. + * + * @since S60 v3.2 + */ +class MVtUiLayoutChangeObserver + { + +public: + + /** + * Called when layout have been changed. + * + */ + virtual void HandleLayoutChangeL() = 0; + + }; + +#endif // M_VTUIRESOURCECHANGEOBSERVER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/compman/mvtuiresourcechangeobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/compman/mvtuiresourcechangeobserver.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2006 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: Resource change observer API definition. +* +*/ + + +#ifndef M_VTUIRESOURCECHANGEOBSERVER_H +#define M_VTUIRESOURCECHANGEOBSERVER_H + +#include + +/** + * MVtUiResourceChangeObserver + * + * Resource change observer API definition. + * + * @since S60 v3.2 + */ +class MVtUiResourceChangeObserver + { + +public: + + /** + * Called when resources have been changed. + * + * @param aType The type of resources that have changed. + */ + virtual void HandleResourceChangeL( TInt aType ) = 0; + + }; + +#endif // M_VTUIRESOURCECHANGEOBSERVER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/compman/mvtuiwindowservereventobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/compman/mvtuiwindowservereventobserver.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2006 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: Window Server event observer API definition. +* +*/ + + +#ifndef M_VTUIWINDOWSERVEREVENTOBSERVER_H +#define M_VTUIWINDOWSERVEREVENTOBSERVER_H + +class TWsEvent; +class CCoeControl; + +/** + * MVtUiWindowServerEventObserver + * + * Window Server event observer API definition. + * + * @since S60 v3.2 + */ +class MVtUiWindowServerEventObserver + { + +public: + + /** + * Called when window server event handling is required. + * + * @param aEvent A window server event. + * @param aDestination The control associated with the event. + * This is only relevant for pointer events. + */ + virtual void HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ) = 0; + + }; + +#endif // M_VTUIWINDOWSERVEREVENTOBSERVER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/compman/tvtuiblocklists.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/compman/tvtuiblocklists.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,217 @@ +/* +* Copyright (c) 2006 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: VT UI component state definition. +* +*/ + + +#ifndef T_VTUIBLOCKLISTS_H +#define T_VTUIBLOCKLISTS_H + +#include + +#include "mvtuicomponent.h" + +/** + * CVtUiBlockListIterator + * + * Class for iterating through component's block list. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiBlockListIterator ) : public CBase + { + +public: // public abstract methods + + /** + * Returns ETrue if there is more component Ids left in the iterator. + * + * @return ETrue if there is more Ids left, EFalse otherwise. + */ + virtual TBool HasNext() const = 0; + + /** + * Returns next component id. + * + * @return Next component Id. + */ + virtual MVtUiComponent::TComponentId Next() = 0; + + }; + +/** + * TVtUiBlockList + * + * Base class for component block lists. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiBlockList ) + { + +public: // public methods + + /** + * Destructor. + */ + virtual ~TVtUiBlockList(); + +public: // public abstract methods + + /** + * Returns ETrue if block list is empty. + * + * @return ETrue if this block list is empty, EFalse otherwise. + */ + virtual TBool IsEmpty() const = 0; + + /** + * Returns ETrue if block list contains given component id. + * + * @param aId Component Id to check. + * @return ETrue if this block list contains given component Id, EFalse + * otherwise. + */ + virtual TBool Contains( MVtUiComponent::TComponentId aId ) const = 0; + + /** + * Merges this block list with given block list. + * + * @param aBlockList List to merge into this block list. + */ + virtual void Union( const TVtUiBlockList& aBlockList ) = 0; + + /** + * Returns new instance of block list iterator. Instance is owned by the + * caller, but it is also pushed to cleanupstack. + * + * @return Instance to block list iterator. Iterator is for this block + * list instance. + */ + virtual CVtUiBlockListIterator* IteratorLC() const = 0; + +protected: // protected methods + + /** + * Constructor. + */ + TVtUiBlockList(); + + }; + +/** + * TVtUiBlockListBitField + * + * Component block list in which component IDs are defined as bits (i.e. + * only single bit is set per ID). + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiBlockListBitField ) : public TVtUiBlockList + { + +public: // public methods + + /** + * Default construct, initialized block list as empty. + */ + TVtUiBlockListBitField(); + + /** + * Constructor that initializes block list. + * + * @param aBlockMask Component Ids that will be added to block list. + */ + TVtUiBlockListBitField( TUint aBlockMask ); + +public: // from + + /** + * @see TVtUiBlockList::IsEmpty + */ + TBool IsEmpty() const; + + /** + * @see TVtUiBlockList::Contains + */ + TBool Contains( MVtUiComponent::TComponentId aId ) const; + + /** + * @see TVtUiBlockList::Union + */ + void Union( const TVtUiBlockList& aBlockList ); + + /** + * @see TVtUiBlockList::IteratorLC + */ + CVtUiBlockListIterator* IteratorLC() const; + +private: // inner classes + + /** + * CVtUiBListIteratorBF + * + * @since S60 v3.2 + */ + class CVtUiBListIteratorBF : public CVtUiBlockListIterator + { + + public: // public methods + + /** + * Static constructor + * + * @param aBlockMask Components Ids. + */ + static CVtUiBListIteratorBF* NewLC( const TUint& aBlockMask ); + + private: // private methods + + /** + * Constructor + */ + CVtUiBListIteratorBF( const TUint& aBlockMask ); + + private: // from CVtUiBlockListIterator + + /** + * @see CVtUiBlockListIterator::HasNext + */ + TBool HasNext() const; + + /** + * @see CVtUiBlockListIterator::Next + */ + MVtUiComponent::TComponentId Next(); + + private: // data + + // Blockmask from TVtUiBlockListBitField + const TUint iBlockMask; + + // Current id + TUint iCurrent; + + }; + +private: // data + + // Block list as bit field, this requires that component ids are defined + // as bitfields. + TUint iBlockMask; + + }; + +#endif // T_VTUIBLOCKLISTS_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/compman/tvtuicomponentstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/compman/tvtuicomponentstate.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2006 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: VT UI component state definition. +* +*/ + + +#ifndef T_VTUICOMPONENTSTATE_H +#define T_VTUICOMPONENTSTATE_H + +#include + +#include "tvtuiblocklists.h" + +/** + * TVtUiComponentState + * + * Component state definition. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUiComponentState ) + { + +public: // enumerations + + enum TState + { + /** Component is inactive */ + EInactive, + + /** Component is activated but some other component is blocking it */ + EWaiting, + + /** Component is active */ + EActive + }; + +public: // public methods + + /** + * Activate component. + */ + void ActivateComponentL(); + + /** + * Blocks component. + */ + void BlockComponentL(); + + /** + * Deactivates component. + */ + void DeActivateComponentL(); + + /** + * Returns component's state. + * + * @return Component's current state. + */ + TState State() const; + + /** + * Returns component. + * + * @return Constant reference to component. + */ + const MVtUiComponent& Component() const; + + /** + * Returns const reference to the block list. + * + * @return Constant reference to component's block list. + */ + const TVtUiBlockList& BlockList() const; + + /** + * Returns reference to the block list. + * + * @return Reference to component's block list. + */ + TVtUiBlockList& BlockList(); + +protected: // protected methods + + /** + * Constructor + * + * @param aComponent Component for this state instance. + * @param aBlockList Block list for this state intance. + */ + TVtUiComponentState( MVtUiComponent& aComponent, + const TVtUiBlockList& aBlockList ); + +protected: + + // Reference to component + MVtUiComponent& iComponent; + + // Blocklist + TVtUiBlockListBitField iBlockList; + + // Component's state + TState iState; + + }; + +#endif // T_VTUICOMPONENTSTATE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/cvtuiappshutter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/cvtuiappshutter.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 2007 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: Class responsible for application exit. +* +*/ + + +#ifndef C_VTUIAPPSHUTTER_H +#define C_VTUIAPPSHUTTER_H + +#include + +#include +#include +#include + +class CAsyncCallBack; +class MVtUiShutterObserver; +class MVtUiStateContext; + +/** +* Shutdown service for the application. This is singleton +* which deletes itself when shutdown is complete. +* +* @since S60 v3.2 +*/ +class CVtUiAppShutter : public CBase + { +public: + + /** + * Returns the instance of application shutter. + * + * @param aComms for sending call ending related commands to Phone. + * @param aObserver observer informed when shutdown is completed. + * @return the application shutter + */ + static CVtUiAppShutter* InstanceL( + MVtUiShutterObserver& aObserver ); + + /** + * Starts shutdown. + */ + void StartShutdown(); + + /** + * Starts shutdown because emergency call was requested by the user. + * If supplied number is detected other than emergency number this method + * leaves KErrArgument. + * @param aStateContext for accessing emergency number and local + * variation. + */ + void ShutdownWithEmergencyCallL( MVtUiStateContext& aStateContext ); + + /** + * Callback from emergency caller. + */ + void EmergencyCallDoneL(); + +private: + + /** + * Exits the application if no pending shutdown preparation + * is ongoing. Deletes itself as last action. + */ + void ShutdownIfReadyAndDestroy(); + + + /** + * Enques async callback. + */ + void EnqueCallbackL( TCallBack& aCallback ); + + /** + * Asynch callback handling response to emergency call creation. + */ + static TInt EmergencyResponseCallback( TAny* aAny ); + + /** C++ constructor */ + CVtUiAppShutter( MVtUiShutterObserver& aObserver ); + + /** destructor */ + ~CVtUiAppShutter(); + +private: // for making shutdown with emergency call + class CEmergencyCaller : public CBase, private MPhCltEmergencyCallObserver + { + public: + /** + * Dials emergency call. Object destroys itself when + * response is received. + */ + static CEmergencyCaller* DialEmergencyL( + CVtUiAppShutter& aObserver, + MVtUiStateContext& aStateContext ); + + // Destructor + ~CEmergencyCaller(); + + private: // C++ constructor + + CEmergencyCaller( + CVtUiAppShutter& aObserver, + MVtUiStateContext& aStateContext ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + private: // from MPhCltEmergencyCallObserver + /** + * @see MPhCltEmergencyCallObserver::HandleEmergencyDialL + */ + virtual void HandleEmergencyDialL( const TInt aStatus ); + + private: // Data + + // Emergency number + TPhCltTelephoneNumber iNumber; + + // Phone Server session + RPhCltServer iServer; + + // Emergency call handler + CPhCltEmergencyCall* iEmergency; + + // Observer for callback + CVtUiAppShutter& iObserver; + + // State context for gettin entered numbers and local variation + MVtUiStateContext& iStateContext; + }; +private: // Data + + /** + * Guard flags for completing shutdown. + * All must be cleared before shutdown + * can be completed. + */ + enum TShutterFlags + { + /** Waiting for call on StartShutdown() */ + EShutterWaitingStart, + /** Waiting for callback on emegency call request */ + EShutterWaitingEmergencyCallback, + }; + + // Asynch callback + CAsyncCallBack* iCallback; + + // guard flags + TBitFlags8 iPendingStateFlags; + + // Observer to notify when application exit + // is allowed. + MVtUiShutterObserver& iObserver; + + // Handles emergency call dialling + CEmergencyCaller* iEmergencyCaller; + + }; + +#endif // C_VTUIAPPSHUTTER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/cvtuidtmfbuffer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/cvtuidtmfbuffer.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2007 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: DTMF buffer definition. +* +*/ + + +#ifndef C_VTUIDTMFBUFFER_H +#define C_VTUIDTMFBUFFER_H + +#include +#include "mvtuinumbersource.h" + +class CCoeEnv; +class TKeyEvent; + +// Maximum size of the DTMF buffer +const TInt KVtUiDTMFBufferSize = 64; + +/** +* TVtUiBaseComponentState +* +* Base componentstate definition. +* +* @since S60 v5.0 +*/ +class CVtUiDTMFBuffer : public CActive, public MVtUiNumberSource + { + +public: + + /** + * Static construction method. + * @param aCoeEnv Reference to CoeEnv object. + * @return Pointer to newly created instance of CVtUiDTMFBuffer. + */ + static CVtUiDTMFBuffer* NewL( const CCoeEnv& aCoeEnv ); + + /** + * C++ destructor. + */ + ~CVtUiDTMFBuffer(); + + /** + * Append one character to DTMF buffer. + * @param aChar Character to append. + * @return ETrue if the given character was appended (i.e. it is a DTMF) + */ + TBool Append( TChar aChar ); + + /** + * Clears the contents of the DTMF buffer. + */ + void Reset(); + + /** + * Promote this instance as current number source. + */ + void Activate(); + + /** + * Demote this instance from current number source position. + */ + void Deactivate(); + +public: // from MVtUiNumberSource + + /** + * @see MVtUiNumberSource::GetContents + */ + void GetContents( TDes& aContents ) const; + +private: // from CActive + + /** + * @see CActive::DoCancel + */ + void DoCancel(); + + /** + * @see CActive::RunL + */ + void RunL(); + +private: + + /** + * C++ constructor + */ + CVtUiDTMFBuffer( const CCoeEnv& aCoeEnv ); + + /** + * 2nd constructor, may leave. + */ + void ConstructL(); + + /** + * Starts buffer modification monitoring timer. If this timer expires, + * buffer will be reset. Timer is restarted when new character is added to + * the buffer. + */ + void StartTimer(); + + /** + * Called when buffer modification monitoring timer has expired. + */ + void TimerExpired( TInt aError ); + + /** + * Clears the contents of the DTMF buffer. + */ + void ResetBuffer(); + +private: + + // Reference to coeenv + const CCoeEnv& iCoeEnv; + + // Timer instance + RTimer iTimer; + + // DTMF buffer + TBuf< KVtUiDTMFBufferSize > iBuffer; + + }; + +#endif // C_VTUIDTMFBUFFER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/cvtuivideocontrolbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/cvtuivideocontrolbase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,354 @@ +/* +* Copyright (c) 2006 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: Base class for video control. +* +*/ + + +#ifndef C_VTUIVIDEOCONTROLBASE_H +#define C_VTUIVIDEOCONTROLBASE_H + +#include +#include +#include + +#include "MVtUiVideoWindow.h" +#include "CVtUiBitmapManager.h" + +// FORWARD DECLARATIONS +class CVtUiBitmapManager; +class TAknTextLineLayout; +class CAknsBasicBackgroundControlContext; +/** + * CVtUiVideoControlBase + * + * Video control base class. + * + * @since S60 v5.0 + */ +class CVtUiVideoControlBase : public CCoeControl, public MVtUiVideoWindow + { + +protected: // enumerations + + // Rendering hints + enum TRenderingHint + { + // If this hint is set, then control's background is filled with color + // at index 0. This hint is mutually exclusive with ESkinnedBackground. + // If neither EColoredBackground nor ESkinnedBackground is set, then + // no background drawing is done. + EColoredBackground, + + // If this is set, then control's background is skinned. This hint is + // mutually exclusive with EColoredBackground. If neither + // EColoredBackground nor ESkinnedBackground is set, then no background + // drawing is done. + ESkinnedBackground, + + // If this hint is set, then no blind icon is drawn. + ENoBlindIcon, + + // If this hint is set, then no waiting text is shown. + ENoWaitingText + }; + +public: + + /** + * Destructor + */ + ~CVtUiVideoControlBase(); + +protected: + + /** + * Constructor + */ + CVtUiVideoControlBase( CVtUiBitmapManager& aBitmapManager ); + + /** + * 2nd constructor + */ + void BaseConstructL(); + + /** + * Sets (enables) rendering hints + */ + void SetRenderingHint( TRenderingHint aHint ); + + /** + * Clears (disables) rendering hints + */ + void ClearRenderingHint( TRenderingHint aHint ); + + /** + * Returns reference to bitmap manager. + */ + CVtUiBitmapManager& BitmapManager() const; + + /** + * Returns pointer to bitmap with given ID. + */ + CFbsBitmap* Bitmap( TVtUiBitmapPoolId aId ) const; + + /** + * Fixes given point suitable for DP (e.g. x coordinates of the point is + * even). + */ + TPoint AdjustPointForDP( const TPoint aPoint ) const; + + /** + * Fixes given rect suitable for DP (e.g. x coordinates and width of the + * rectangle are even). + */ + TRect AdjustRectForDP( const TRect aRect ) const; + +protected: // virtual methods + + /** + * Gets waiting text layout. + */ + virtual TAknTextLineLayout WaitingTextLayout( TInt aLine ); + + /** + * The size changed method. If you need to do special handling after the + * control's size has changed, overwrite this method. + */ + virtual void HandleSizeChanged(); + + /** + * Draws control background using current skin. If you need special + * background rendering in inherited control, override this method. + * There is no need to check ESkinnedBackground hint again in this method + * because it has been checked prior to calling. + */ + virtual void DrawSkinnedBackground( CWindowGc& aGc ) const; + + /** + * Draws control background using color. If you need special + * background rendering in inherited control, override this method. + * There is no need to check EColoredBackground hint again in this method + * because it has been checked prior to calling. + */ + virtual void DrawColoredBackground( CWindowGc& aGc ) const; + + /** + * Draws waiting text. If you need special waiting text rendering in + * inherited control, override this method. + * There is no need to check ENoWaitingText hint again in this method + * because it has been checked prior to calling. + */ + virtual TBool DrawWaitingText( CWindowGc& aGc ) const; + + /** + * Draws blind icon. If you need special blind icon rendering in inherited + * control, override this method. + * There is no need to check ENoBlindIcon hint again in this method + * because it has been checked prior to calling. + */ + virtual void DrawBlind( CWindowGc& aGc ) const; + + /** + * Draws stream. If you need special stream rendering in inherited control, + * override this method. iStreamBitmap cannot be NULL if this method is + * called. + */ + virtual void DrawStream( CWindowGc& aGc ) const; + + /** + * Returns blitting position (top-left corner) coordinates for the stream. + */ + virtual TPoint StreamBlitPosition() const; + + /** + * Returns clipping rectangle for the stream. + */ + virtual TRect StreamClippingRect() const; + + /** + * Returns pointer to blind bitmap or NULL if no bitmap is present. + */ + virtual CFbsBitmap* BlindImage() const; + + /** + * Returns pointer to blind mask or NULL if no mask is present. + */ + virtual CFbsBitmap* BlindMask() const; + + /** + * Returns blit position for blind icon. + */ + virtual TPoint BlindBlitPosition() const; + +public: // from MVtUiVideoWindow + + /** + * @see MVtUiVideoWindow::Reset + */ + void Reset(); + + /** + * @see MVtUiVideoWindow::SetBlind + */ + void SetBlind( TBool aStatus ); + + /** + * @see MVtUiVideoWindow::SetStreamBitmap + */ + void SetStreamBitmap( CFbsBitmap* aStreamBitmap ); + + /** + * @see MVtUiVideoWindow::SetStreamBitmapReserve + */ + void SetStreamBitmapReserve( CFbsBitmap* aStreamBitmap ); + + /** + * @see MVtUiVideoWindow::SetWaiting + */ + void SetWaiting( TBool aShowWaitingText ); + + /** + * @see MVtUiVideoWindow::Redraw + */ + void Redraw(); + + /** + * @see CCoeControl::MopSupplyObject + */ + TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); + + /** + * Set remote video control + */ + virtual void SetRemoteVideoControl( CCoeControl* aRemoteControl ); + + /** + * Layout the postion and the size of the remote video control + */ + virtual void LayoutRemoteVideo(); + + /** + * Returns pointer to remote video control or NULL if no remote video control is present. + */ + CCoeControl * RemoteVideoControl(); + +private: // from CCoeControl + + /** + * @see CCoeControl::Draw + */ + void Draw( const TRect& aRect ) const; + + /** + * @see CCoeControl::SizeChanged + */ + void SizeChanged(); + + /** + * @see CCoeControl::PositionChanged + */ + void PositionChanged(); + +private: + + /** + * Redraws stream bitmap. + */ + void RedrawStream(); + + /** + * Wraps waiting text if needed. + */ + void WrapOnDemand(); + + /** + * Wraps waiting text. + */ + void WrapWaitingTextL(); + + /** + * The draw method. + */ + void DoDraw( CWindowGc& aGc ) const; + + /** + * Draws control background. + */ + void DoDrawBackground( CWindowGc& aGc ) const; + + /** + * Draws waiting text. + */ + TBool DoDrawWaitingText( CWindowGc& aGc ) const; + + /** + * Draws blind icon. + */ + void DoDrawBlind( CWindowGc& aGc ) const; + + /** + * Draws stream. + */ + void DoDrawStream( CWindowGc& aGc ) const; + + TBool IsAlphaZero() const; + + void SetAlpha( CWindowGc& aGc ) const; + +protected: + + // ETrue if blind icon is shown. + TBool iBlindStatus; + + // Reference to stream bitmap. + CFbsBitmap* iStreamBitmap; + + // ETrue if waiting text should be shown. + TBool iWaitingTextShow; + + // Owned wrapped waiting text. + HBufC* iWaitingTextWrapped; + + // Owned wrapped waiting text. + CArrayFix< TPtrC >* iWaitingTextWrappedArray; + + // First line layout of waiting text. + TAknLayoutText iWaitingTextLine1Layout; + + // Second line layout of waiting text. + TAknLayoutText iWaitingTextLine2Layout; + + // Owned: background context. + CAknsBasicBackgroundControlContext* iBgContext; + + // Reference to remote video control. + CCoeControl* iRemoteVideoControl; + +private: + + // Pointer to bitmap manager. + CVtUiBitmapManager* iBitmapManager; + + // Rendering hints + TBitFlags32 iHints; + + // FrameUpdate() is called from AO. + CAsyncCallBack* iAsyncFrameUpdated; + + mutable TBool iSetAlpha; + + }; + +#endif // C_VTUIVIDEOCONTROLBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/cvtuifeaturebase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/cvtuifeaturebase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2006 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: CVtUiFeatureBase implementation. +* +*/ + + +#ifndef C_VTUIFEATUREBASE_H +#define C_VTUIFEATUREBASE_H + +// INCLUDES +#include +#include "mvtuifeature.h" + +// CLASS DECLARATION +class CVtUiAppUi; +class CVtUiFeatureManager; + +/** +* Base class for Video Telephone application features. +* +* @since S60 3.2 +*/ +class CVtUiFeatureBase : public CBase, public MVtUiFeature + { + public: // public methods + /** + * C++ destructor. + */ + ~CVtUiFeatureBase(); + + public: // from MVtUiFeature + + /** @see MVtUiFeature */ + virtual void StartL(); + + /** @see MVtUiFeature */ + virtual void Stop() = 0; + + /** @see MVtUiFeature */ + virtual void InitFeatureL() = 0; + + /** @see MVtUiFeature */ + TVtUiFeatureState State() const; + + /** @see MVtUiFeature */ + TVtUiFeatureId Id() const; + + protected: + /** + * C++ constructor + * + */ + CVtUiFeatureBase( TVtUiFeatureId aId, + CVtUiFeatureManager& aFeatureManager ); + + /** + * BaseConstructL + * For child class to use. + * Calls constructL. + */ + void BaseConstructL(); + + /** + * Callback function that inits the features. + * @param aAny pointer to an instance of the class. + * @return always KErrNone. + */ + static TInt DoInitFeaturesL( TAny* aAny ); + + + protected: // data + + // Feature's unique Id + const TVtUiFeatureId iId; + + // Reference to featuremanager + CVtUiFeatureManager& iFeatureManager; + + // Features current state + MVtUiFeature::TVtUiFeatureState iFeatureState; + + // Owned asynch callback. + CAsyncCallBack* iAsyncCallback; + + }; + +#endif // C_VTUIFEATUREBASE_H \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/cvtuifeaturemanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/cvtuifeaturemanager.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2004-2006 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: Feature manager for Video Telephone application. +* +*/ + + +#ifndef C_VTUIFEATUREMANAGER_H +#define C_VTUIFEATUREMANAGER_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION +class MVtUiFeature; +class CVtUiAppUi; +class CVtUiFeatureBase; +class TVtUiStates; +class MVtUiCommandManager; +class MVtUiComponentManager; +class CVtEngModel; +/** +* Feature manager for Video Telephone application. +* +* @since S60 v3.2 +*/ +class CVtUiFeatureManager : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CVtUiFeatureManager* NewL( CVtUiAppUi& aAppUi, + TVtUiStates& aUiStates, MVtUiCommandManager& aCommandManager, + MVtUiComponentManager& aComponentManager ); + + /** + * Destructor. + */ + ~CVtUiFeatureManager(); + + public: // New functions + + /** + * Return reference to CVtUiAppUi class. + */ + CVtUiAppUi& AppUi(); + + /** + * GetFeatureById + */ + MVtUiFeature* GetFeatureById( TInt aId ); + + /** + * TVtUiStates + */ + TVtUiStates& UiStates(); + + /** + * Command Manager + */ + MVtUiCommandManager& CommandManager(); + + /** + * Component Manager + */ + MVtUiComponentManager& ComponentManager(); + + /** + * Return reference to CVtEngModel class. + */ + CVtEngModel& Model(); + + private: + + /** + * Second phase constructor + */ + void ConstructL(); + + /** + * c++ constructor + */ + CVtUiFeatureManager( CVtUiAppUi& aAppUi, TVtUiStates& aUiStates, + MVtUiCommandManager& aCommandManager, + MVtUiComponentManager& aComponentManager ); + + /** + * Creates all features + */ + void CreateFeaturesL(); + + private: // data + + // Feature list + RPointerArray< CVtUiFeatureBase > iFeatures; + + // Ref to application ui. + CVtUiAppUi& iAppUi; + + // Reference to UI states instance + TVtUiStates& iUiStates; + + // Reference to command manager API + MVtUiCommandManager& iCommandManager; + + // Reference to component manager API + MVtUiComponentManager& iComponentManager; + + // Engine model. + CVtEngModel* iModel; + + }; + +#endif // C_VTUIFEATUREMANAGER_H +// End of File \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/dialer/cvtuicmdclosedialer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/dialer/cvtuicmdclosedialer.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007 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: Dialer close command. +* +*/ + + +#ifndef C_VTUICMDCLOSEDIALER_H +#define C_VTUICMDCLOSEDIALER_H + +#include "cvtuifeaturecmdbase.h" + +class MVtUiCommandManager; + +/** + * CVtUiCmdCloseDialer + * + * @since S60 v5.0 + */ +class CVtUiCmdCloseDialer : public CVtUiFeatureCmdBase + { + +public: + + /** + * Static constructor + * + * @param aCommandManager Reference to command manager. + * @param aFeature Reference to minidialer feature. + * @return Newly created instance to CVtUiCmdCloseDialer. + */ + static CVtUiCmdCloseDialer* NewL( MVtUiCommandManager& aCommandManager, + MVtUiFeature& aFeature ); + + /** + * Destructor + */ + ~CVtUiCmdCloseDialer(); + +private: // from CVtUiFeatureCmdBase + + /** + * @see CVtUiFeatureCmdBase::HandleL + */ + void HandleL(); + + /** + * @see CVtUiFeatureCmdBase::IsEnabled + */ + TBool CVtUiCmdCloseDialer::IsEnabled() const; + +private: + + /** + * Constructor + */ + CVtUiCmdCloseDialer( MVtUiCommandManager& aCommandManager, + MVtUiFeature& aFeature ); + + /** + * 2nd constructor + */ + void ConstructL(); + +private: + + // Reference to command manager API. + MVtUiCommandManager& iCommandManager; + + }; + +#endif // C_VTUICMDCLOSEDIALER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/dialer/cvtuicmdopendialer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/dialer/cvtuicmdopendialer.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2007 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: Dialer open command. +* +*/ + + +#ifndef C_VTUICMDOPENDIALER_H +#define C_VTUICMDOPENDIALER_H + +#include "cvtuifeaturecmdbase.h" + +class MVtUiCommandManager; + +/** + * CVtUiCmdOpenDialer + * + * @since S60 v5.0 + */ +class CVtUiCmdOpenDialer : public CVtUiFeatureCmdBase + { + +public: + + /** + * Static constructor + * + * @param aCommandManager Reference to command manager. + * @param aFeature Reference to minidialer feature. + * @return Newly created instance to CVtUiCmdOpenDialer. + */ + static CVtUiCmdOpenDialer* NewL( MVtUiCommandManager& aCommandManager, + MVtUiFeature& aFeature ); + + /** + * Destructor + */ + ~CVtUiCmdOpenDialer(); + +private: + + /** + * Constructor + */ + CVtUiCmdOpenDialer( MVtUiCommandManager& aCommandManager, + MVtUiFeature& aFeature ); + + /** + * 2nd constructor + */ + void ConstructL(); + +private: + + // Reference to command manager API. + MVtUiCommandManager& iCommandManager; + + }; + +#endif // C_VTUICMDOPENDIALER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/dialer/cvtuidialer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/dialer/cvtuidialer.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2007 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: Dialer UI feature. +* +*/ + + +#ifndef C_VTUIDIALER_H +#define C_VTUIDIALER_H + +#include "cvtuifeaturebase.h" +#include "mvtuidialer.h" + +class CVtUiFeatureCmdBase; +class CVtUiDialerContainer; + +/** + * CVtUiDialer + * + * Mini dialer UI feature definition. + * + * @since S60 v5.0 + */ +class CVtUiDialer : public CVtUiFeatureBase, public MVtUiDialer + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to featuremanager. + * @return Newly created instance to CVtUiDialer. + */ + static CVtUiDialer* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiDialer(); + +public: // from CVtUiFeatureBase + + /** + * @see CVtUiFeatureBase::StartL + */ + void StartL(); + + /** + * @see CVtUiFeatureBase::Stop + */ + void Stop(); + + /** + * @see CVtUiFeatureBase::InitFeatureL + */ + void InitFeatureL(); + +private: // from MVtUiDialer + + /** + * @see MVtUiDialer::VideoWindow + */ + MVtUiVideoWindow& VideoWindow() const; + + /** + * @see MVtUiDialer::VideoControl + */ + CCoeControl& VideoControl() const; + +private: + + /** + * Constructor + */ + CVtUiDialer( CVtUiFeatureManager& aFeatureManager ); + + /** + * 2nd constructor + */ + void ConstructL(); + + /** + * Preapres feature before start. + */ + void PrepareL(); + + /** + * Unprepares feature after stop. + */ + void Unprepare(); + +private: + + // Open command + CVtUiFeatureCmdBase* iCmdOpen; + + // Open command + CVtUiFeatureCmdBase* iCmdClose; + + // Dialer container + CVtUiDialerContainer* iDialerContainer; + + }; + +#endif // C_VTUIDIALER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/dialer/cvtuidialercontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/dialer/cvtuidialercontainer.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,263 @@ +/* +* Copyright (c) 2007 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: Dialer container class. +* +*/ + + +#ifndef C_VTUIDIALERCONTAINER_H +#define C_VTUIDIALERCONTAINER_H + +#include +#include "CVtUiAppUi.h" +#include "mvtuicomponent.h" +#include "mvtuiresourcechangeobserver.h" +#include "mvtuikeyeventobserver.h" +#include "mvtuinumbersource.h" +#include "tvtuicomponentstate.h" + +// FORWARD DECLARATIONS +class MVtUiVideoWindow; +class MVtUiComponentManager; +class CVtUiBitmapManager; +class CVtUiDialerVideoControl; +class CVideoDTMFDialer; +class TVtUiStates; +class CVtUiDialerSKModifier; +class CVtUiFeatureManager; +class CVtUiDTMFBuffer; +class CAknsBasicBackgroundControlContext; + +// CONSTANTS +const TInt KVtUiDigitBufferSize = 128; + +/** + * TVtUiMiniDialerComponentState + * + * Mini dialer component state definition. + * + * @since S60 v5.0 + */ +class TVtUiDialerComponentState : public TVtUiComponentState + { + +public: + + /** + * Constructor + */ + TVtUiDialerComponentState( MVtUiComponent& aComponent ); + + }; + +/** + * CVtUiDialerContainer + * + * Mini dialer UI feature definition. + * + * @since S60 v5.0 + */ +class CVtUiDialerContainer : public CCoeControl, + public MVtUiResourceChangeObserver, public MVtUiComponent, + public MVtUiNumberSource, public MVtUiKeyEventObserver + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + * @param aComponentManager Reference to component manager. + * @param aBitmapManager Reference to bitmap manager. + * @return Newly created instance of CVtUiDialerContainer. + */ + static CVtUiDialerContainer* + NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiDialerContainer(); + + /** + * Registers component to component manager's event handling mechanism. + * @exception May leave with error KErrAlreadyExists, if the component + * has already been registered. + */ + void RegisterComponentL(); + + /** + * Unregisters component from component manager's event handling mechanism. + */ + void UnregisterComponent(); + + /** + * Returns video window. + * @return Pointer to video window. + */ + MVtUiVideoWindow* ComponentAsVideoWindow(); + + /** + * @see CCoeControl::MopSupplyObject + */ + TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); + +private: // from MVtUiResourceChangeObserver + + /** + * @see MVtUiResourceChangeObserver::HandleResourceChangeL + */ + void HandleResourceChangeL( TInt aType ); + + +private: // from MVtUiComponent + + /** + * @see MVtUiComponent::ComponentId + */ + TComponentId ComponentId() const; + + /** + * @see MVtUiComponent::ComponentAsControl + */ + CCoeControl* ComponentAsControl(); + + /** + * @see MVtUiComponent::DoActivateL + */ + void DoActivateL(); + + /** + * @see MVtUiComponent::DoDeactivateL + */ + void DoDeactivateL(); + +private: // from MVtUiNumberSource + + /** + * @see MVtUiNumberSource::GetContents + */ + void GetContents( TDes& aContents ) const; + +private: // from MVtUiKeyEventObserver + + /** + * @see MVtUiNumberSource::OfferKeyEventL + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode aCode ); + +private: // from CCoeControl + + /** + * @see CCoeControl::Draw + */ + void Draw( const TRect& aRect ) const; + + /** + * @see CCoeControl::SizeChanged + */ + void SizeChanged(); + + /** + * @see CCoeControl::PositionChanged + */ + void PositionChanged(); + + /** + * @see CCoeControl::CountComponentControls + */ + TInt CountComponentControls() const; + + /** + * @see CCoeControl::ComponentControl + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + +private: + + /** + * Constructor + */ + CVtUiDialerContainer( CVtUiFeatureManager& aFeatureManager ); + + /** + * 2nd constructor + */ + void ConstructL( CVtUiBitmapManager& aBitmapManager ); + + /** + * Layouts this control. + */ + void LayoutDialerContainer(); + + /** + * Returns dialer's rect (wrapper to VtUiLayout). + */ + TRect DialerRect() const; + + /** + * Resets digit buffer. + */ + void Reset(); + + /** + * Appends new digit to digit buffer. If buffer is full, oldest digit is + * deleted. + */ + void AppendDigit( TChar aDigit ); + + /** + * Static callback method for deactivating dialer asynchronously. + */ + static TInt ASyncDoDeactivate( TAny* aSelf ); + +private: + + // Component state + TVtUiDialerComponentState iComponentState; + + // Feature manager instance + CVtUiFeatureManager* iFeatureManager; + + // Component manager + MVtUiComponentManager* iComponentManager; + + // UI states + TVtUiStates& iUiStates; + + // Video control instance + CVtUiDialerVideoControl* iVideoControl; + + // Dialer instance + CVideoDTMFDialer* iDialer; + + // Buffer for digits + CVtUiDTMFBuffer* iInputBuffer; + + // Rendering mode + CVtUiAppUi::TRenderingMode iMode; + + // Softkey modifier for dialer feature + CVtUiDialerSKModifier* iSKModifier; + + // Asynccallback instance for handling asynchronous deactivation. + CAsyncCallBack* iAsyncDeactivate; + + // Owned: background context. + CAknsBasicBackgroundControlContext* iBgContext; + + }; + +#endif // C_VTUIDIALERCONTAINER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/dialer/cvtuidialerskmodifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/dialer/cvtuidialerskmodifier.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2007 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: Dialer feature softkey modifier class. +* +*/ + + +#ifndef C_VTUIDIALERSKMODIFIER_H +#define C_VTUIDIALERSKMODIFIER_H + +// INCLUDES +#include +#include "cvtuicommandmodifybase.h" + +// FORWARD DECLARATIONS +class CVtUiFeatureManager; + +/** + * CVtUiDialerSKModifier + * + * Modifies softkeys for dialer control. + * + * @since S60 v5.0 + */ +class CVtUiDialerSKModifier : public CVtUiCommandModifyBase + { + +public: // static methods + /** + * Static constructor. + * + */ + static CVtUiDialerSKModifier* NewL( CVtUiFeatureManager& aFeatureMgr ); + + /** + * Destructor + */ + ~CVtUiDialerSKModifier(); + +public: // from base class + + /** + * @See CVtUiCommandModifyBase::ModifyCommandsL + */ + virtual void ModifyCommandsL( MVtUiCommandSetting& aCommandSettings ); + + /** + * @See CVtUiCommandModifyBase::Supports + */ + virtual TBool Supports( MVtUiCommandSetting::Type aType ) const; + +private: + /** + * C++ constructor + * + */ + CVtUiDialerSKModifier( CVtUiFeatureManager& aFeatureMgr ); + +private: // data + + // refrence to appui + CVtUiFeatureManager& iFeatureMgr; + + }; + +#endif // C_VTUIDIALERSKMODIFIER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/dialer/cvtuidialervideocontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/dialer/cvtuidialervideocontrol.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2007 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: Video control. +* +*/ + + +#ifndef C_VTUIDIALERVIDEOCONTROL_H +#define C_VTUIDIALERVIDEOCONTROL_H + +#include "cvtuivideocontrolbase.h" + +/** + * CVtUiDialerVideoControl + * + * Mini dialer UI feature definition. + * + * @since S60 v5.0 + */ +class CVtUiDialerVideoControl : public CVtUiVideoControlBase + { + +public: + + /** + * Static constructor + * @param aBitmapManager Reference to bitmap manager. + * @return Newly created instance of CVtUiDialerVideoControl. + */ + static CVtUiDialerVideoControl* NewL( CVtUiBitmapManager& aBitmapManager ); + + /** + * Destructor + */ + ~CVtUiDialerVideoControl(); +public: + /** + * LayoutRemoteVideo + */ + void LayoutRemoteVideo(); + +private: + + /** + * Constructor + */ + CVtUiDialerVideoControl( CVtUiBitmapManager& aBitmapManager ); + + /** + * 2nd constructor + */ + void ConstructL(); + +private: // from CVtUiVideoControlBase + + /** + * @see CVtUiVideoControlBase::WaitingTextLayout + */ + TAknTextLineLayout WaitingTextLayout( TInt aLine ); + + }; + +#endif // C_VTUIDIALERVIDEOCONTROL_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/dialer/mvtuidialer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/dialer/mvtuidialer.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2007 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: Dialer API for VT application. +* +*/ + + +#ifndef M_VTUIDIALER_H +#define M_VTUIDIALER_H + +class MVtUiVideoWindow; +class CCoeControl; + +/** + * MVtUiDialer + * + * Mini dialer UI feature API for AppUi. + * + * @since S60 v5.0 + */ +class MVtUiDialer + { + +public: + + /** + * Get reference to video window control + * @return Reference to video window. + */ + virtual MVtUiVideoWindow& VideoWindow() const = 0; + + /** + * Get reference to video window control + * @return Reference to video control. + */ + virtual CCoeControl& VideoControl() const = 0; + + }; + +#endif // diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/menu/cvtuimenucontext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/menu/cvtuimenucontext.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2006 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: Menu context class definition. +* +*/ + + +#ifndef C_VTUIMENUCONTEXT_H +#define C_VTUIMENUCONTEXT_H + +#include + +#include "cvtuicmdcontext.h" + +/** + * CVtUiMenuContext + * + * Menu command context class definition. + * + * @since S60 v3.2 + */ +class CVtUiMenuContext : public CVtUiCmdContext + { + +public: // public methods + + /** + * C++ destructor. + * + */ + ~CVtUiMenuContext(); + + /** + * Leave safe destructor. + * + */ + static CVtUiMenuContext* NewL( MVtUiCommandManager& aCommandManager ); + +public: // from CVtUiCmdContext + + /** + * @see CVtUiCmdContext::ValidateL + */ + void ValidateL( CVtUiCmdValidationActionBase& aAction ); + +private: + + /** + * C++ constructor + * + * @param aPriority Validator priority. + */ + CVtUiMenuContext( MVtUiCommandManager& aCommandManager ); + + /** + * 2nd consttuctor, may leave. + */ + void ConstructL(); + +private: // data + + }; + +#endif // C_VTUIMENUCONTEXT_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/menu/cvtuimenuitemdimmeraction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/menu/cvtuimenuitemdimmeraction.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2006 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: Menu dimmer action class definition. +* +*/ + + +#ifndef C_VTUIMENUITEMDIMMERACTION_H +#define C_VTUIMENUITEMDIMMERACTION_H + +#include + +#include "cvtuicmdvalidationactionbase.h" + +class CEikMenuPane; + +/** + * CVtUiCmdValidationActionBase + * + * Menu item dimmer action definition. + * + * @since S60 v3.2 + */ +class CVtUiMenuItemDimmerAction : public CVtUiCmdValidationActionBase + { + +public: + + /** + * Leave-safe constructor. + * + */ + static CVtUiMenuItemDimmerAction* NewL(); + + /** + * Sets menu pane instance. + * + */ + void SetMenuPane( CEikMenuPane* aMenuPane ); + +public: // from CVtUiCmdValidationActionBase + + /** + * @see CVtUiCmdValidationActionBase::ProcessL + */ + void ProcessL( const MVtUiCmdValidatorCallBack& aCallBack ); + + /** + * @see CVtUiCmdValidationActionBase::EndProcess + */ + void EndProcess(); + +private: + + /** + * C++ constructor. + * + */ + CVtUiMenuItemDimmerAction(); + + /** + * Sets given menu command dimmed in menu. + * + */ + void SetItemDimmed( TInt aCommandId ); + +private: // data + + // Menu pane instance this action is currently working on + CEikMenuPane* iMenuPane; + + }; + +#endif // C_VTUIMENUITEMDIMMERACTION_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/menu/cvtuimenus.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/menu/cvtuimenus.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2006 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: Menu UI feature. +* +*/ + + +#ifndef C_VTUIMENUS_H +#define C_VTUIMENUS_H + +#include "cvtuifeaturebase.h" +#include "mvtuicommandui.h" + +class CVtUiMenuContext; +class CVtUiMenuItemDimmerAction; +class CEikMenuPane; +class CVtUiCommandModifyBase; + +/** + * CVtUiMenus + * + * Menu feature definition. + * + * @since S60 v3.2 + */ +class CVtUiMenus : public CVtUiFeatureBase, public MVtUiCommandUi + { + +public: + + /** + * Static constructor + */ + static CVtUiMenus* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiMenus(); + +public: + + /** + * Sets menu context. + */ + void SetMenuPane( CEikMenuPane* aMenuPane ); + +public: // from CVtUiFeatureBase + + /** + * @see CVtUiFeatureBase::StartL + */ + void StartL(); + + /** + * @see CVtUiFeatureBase::Stop + */ + void Stop(); + + /** + * @see CVtUiFeatureBase::InitFeatureL + */ + void InitFeatureL(); + +public: // from MVtUiCommandUi + + /** + * @see MVtUiCommandUi::RefreshL + */ + void RefreshL(); + + /** + * @see MVtUiCommandUi::AddCommandModifier + */ + TInt AddCommandModifier( CVtUiCommandModifyBase& ); + + /** + * @see MVtUiCommandUi::RemoveCommandModifier + */ + void RemoveCommandModifier( CVtUiCommandModifyBase& ); + +private: + + /** + * Constructor + */ + CVtUiMenus( CVtUiFeatureManager& aFeatureManager ); + + /** + * 2nd constructor + */ + void ConstructL(); + +private: + + // Menu context instance + CVtUiMenuContext* iMenuCommandContext; + + // Menu dimmer action instance + CVtUiMenuItemDimmerAction* iMenuDimmerAction; + + }; + +#endif // C_VTUIMENUS_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/menu/tvtuimenucommanditerator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/menu/tvtuimenucommanditerator.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2006 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: Menu command iterator class definition. +* +*/ + + +#ifndef T_VTUIMENUCOMMANDITERATOR_H +#define T_VTUIMENUCOMMANDITERATOR_H + +#include "mvtuicommanditerator.h" + +/** + * TVtUiMenuCommandIterator + * + * Menu command iterator class definition. + * + * @since S60 v3.2 + */ +class TVtUiMenuCommandIterator : public MVtUiCommandIterator + { + +public: // public methods + + /** + * C++ constructor + * + */ + TVtUiMenuCommandIterator( CEikMenuPane& aMenuPane ); + +public: // from MVtUiCommandIterator + + /** + * @see MVtUiCommandIterator::HasNext + */ + TBool HasNext() const; + + /** + * @see MVtUiCommandIterator::Next + */ + TInt Next(); + +private: + + // Pointer to menu pane to be iterated + CEikMenuPane* iMenuPane; + + // Current iteration point + TInt iCurrent; + + }; + +#endif // T_VTUIMENUCOMMANDITERATOR_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/mvtuifeature.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/mvtuifeature.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2004-2006 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: Observer interface for handling features +* +*/ + + +#ifndef MVTUIFEATURE_H +#define MVTUIFEATURE_H + +// INCLUDES +#include + +#include "tvtuifeatureids.h" + +// CLASS DECLARATION + +/** +* Interface for handling features +* +* @since S60 v3.2 +*/ +class MVtUiFeature + { + public: // New functions + /** + * ENotSupported + * feature is not supported in current configuration. + * EUnprepared + * starting may require some init code to run. + * EPreparing + * running initialization code. + * EReady + * feature can be started. + * EActive + * feature is running. + * EDisabled + * feature is supported but cannot be started at this time. + * EFailed + * started but failed (maybe temporary or permanent, feature specific) + */ + enum TVtUiFeatureState + { + ENotSupported, + EUnprepared, + EPreparing, + EReady, + EActive, + EDisabled, + EFailed + }; + + /** + * Starts the feature. + */ + virtual void StartL() = 0; + + /** + * Stops the feature. + */ + virtual void Stop() = 0; + + /** + * Current state of the feature + */ + virtual TVtUiFeatureState State() const = 0; + + /** + * Id() + */ + virtual TVtUiFeatureId Id() const = 0; + }; + +#endif // MVTUIFEATURE_H +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/numberentry/CVtUiNumberEntryControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/numberentry/CVtUiNumberEntryControl.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,196 @@ +/* +* Copyright (c) 2006 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: Number entry control for Video Telephone application. +* +*/ + + + +#ifndef CVTUINUMBERENTRYCONTROL_H +#define CVTUINUMBERENTRYCONTROL_H + +// INCLUDES +#include +#include + +#include "mvtuicomponent.h" +#include "tvtuicomponentstate.h" +#include "mvtuinumbersource.h" + +// FORWARD DECLARATIONS +class MVtUiFeature; +class MVtUiComponentManager; +class TVtUiStates; +class MVtUiNumberEntryControlObserver; +class CVtUiDTMFBuffer; + +// CLASS DECLARATION + +/** +* TVtUiNumberEntryComponentState +* +* Component state implementation for Number Entry control. Component state is +* used by the Component Manager. +* +* @since S60 3.2 +*/ +class TVtUiNumberEntryComponentState : public TVtUiComponentState + { + +public: + + /** + * Constructor. + */ + TVtUiNumberEntryComponentState( MVtUiComponent& aComponent ); + + }; + +/** +* Number entry control for Video Telephone application. +* +* @since Series 60 2.6 +*/ +class CVtUiNumberEntryControl + : public CCoeControl, public MVtUiComponent + { + public: // Constructors and destructor + + /** + * C++ constructor. + * @param aAppUi application ui. + * @param aUiStates ui states + */ + CVtUiNumberEntryControl( MVtUiFeature& aFeature, + TVtUiStates& aUiStates ); + + /** + * Symbian constructor. + * @param aRect initial area. + */ + void ConstructL( const TRect& aRect ); + + /** + * C++ destructor. + */ + ~CVtUiNumberEntryControl(); + + public: // New functions + + /** + * Opens number entry. + * @return ETrue if number entry was opened, EFalse otherwise. + */ + TBool OpenNumberEntry(); + + /** + * Returns ETrue if number entry is open. + * @return ETrue if number entry is open. + */ + TBool IsNumberEntryOpen() const; + + /** + * Closes number entry. + */ + void CloseNumberEntry(); + + /** + * Register component to component manager. + */ + void RegisterComponentL( MVtUiComponentManager& aComponentManager ); + + /** + * Unregister component to component manager. + */ + void UnregisterComponent( MVtUiComponentManager& aComponentManager ); + + /** + * Adds number entry control observer. + */ + void SetNumberEntryControlObserver( + MVtUiNumberEntryControlObserver* aObserver ); + + public: // Functions from base classes + + /** + * @see CCoeControl::OfferKeyEventL. + */ + virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + private: + + /** + * Callback function to close number entry. + * @param aAny pointer to an instance of this class. + * @return KErrNone. + */ + static TInt DoCloseNumberEntry( TAny* aAny ); + + /** + * Called from DoCloseNumberEntry when number entry needs to be closed. + */ + void HandleTimeoutCloseNumberEntry(); + + /** + * Return ETrue if menu or dialog is being displayed. + */ + TBool IsDisplayingMenuOrDialog() const; + + private: // from MVtUiComponent + + /** + * @see MVtUiComponent::ComponentId + */ + TComponentId ComponentId() const; + + /** + * @see MVtUiComponent::ComponentAsControl + */ + CCoeControl* ComponentAsControl(); + + /** + * @see MVtUiComponent::DoActivateL + */ + void DoActivateL(); + + /** + * @see MVtUiComponent::DoDeactivateL + */ + void DoDeactivateL(); + + private: + + // Reference to feature that owns this control. + MVtUiFeature& iFeature; + + // Number entry area layout. + TAknLayoutRect iNumberEntryAreaLayout; + + // Component state + TVtUiNumberEntryComponentState iComponentState; + + // UI States + TVtUiStates& iUiStates; + + // Number entry control observer + MVtUiNumberEntryControlObserver* iControlObserver; + + // Buffer for digits + CVtUiDTMFBuffer* iInputBuffer; + }; + +#endif // CVTUINUMBERENTRYCONTROL_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/numberentry/cvtuinumberentry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/numberentry/cvtuinumberentry.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,120 @@ +/* +* Copyright (c) 2006 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: Number entry UI feature definition. +* +*/ + + +#ifndef C_VTUINUMBERENTRY_H +#define C_VTUINUMBERENTRY_H + +#include "mvtuicommandui.h" +#include "cvtuifeaturebase.h" +#include "mvtuinumberentrycontrolobserver.h" +#include "cvtuifeaturemanager.h" + +class CVtUiNumberEntryControl; + +/** + * CVtUiNumberEntry + * + * NumberEntry UI feature. + * + * @since S60 v3.2 + */ + class CVtUiNumberEntry : public CVtUiFeatureBase, + public MVtUiNumberEntryControlObserver + { + +public: + + /** + * Static constructor + */ + static CVtUiNumberEntry* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiNumberEntry(); + +public: // from CVtUiFeatureBase + + /** + * @see CVtUiFeatureBase::StartL + */ + void StartL(); + + /** + * @see CVtUiFeatureBase::Stop + */ + void Stop(); + + /** + * @see CVtUiFeatureBase::InitFeatureL + */ + void InitFeatureL(); + +public: // from MVtUiNumberEntryControlObserver + + /** + * @see MVtUiNumberEntryControlObserver::ControlActivatedL + */ + void ControlActivatedL(); + + /** + * @see MVtUiNumberEntryControlObserver::ControlDeactivated + */ + void ControlDeactivated(); + +private: + + /** + * Constructor + */ + CVtUiNumberEntry( CVtUiFeatureManager& aFeatureManager ); + + /** + * 2nd constructor + */ + void ConstructL(); + + /** + * Prepares feature + */ + void PrepareL(); + + /** + * Unprepares feature + */ + void Unprepare(); + + /** + * Creates number entry control instance + */ + void CreateNumberEntryControlL(); + + /** + * Deletes number entry control instance + */ + void DeleteNumberEntryControl(); + +private: + + // Owned number entry control instance. + CVtUiNumberEntryControl* iNumberEntryControl; + + }; + +#endif // C_VTUINUMBERENTRY_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/numberentry/mvtuinumberentrycontrolobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/numberentry/mvtuinumberentrycontrolobserver.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2006 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: Key event observer API for components. +* +*/ + + +#ifndef M_VTUINUMBERENTRYCONTROLOBSERVER_H +#define M_VTUINUMBERENTRYCONTROLOBSERVER_H + +/** +* MVtUiNumberEntryControlObserver +* +* Observer API for number entry control. +* +* @since S60 v3.2 +*/ +class MVtUiNumberEntryControlObserver + { + +public: + + /** + * Called when number entry control is activated. + */ + virtual void ControlActivatedL() = 0; + + /** + * Called when number entry control is deactivated. + */ + virtual void ControlDeactivated() = 0; + + }; + +#endif // M_VTUINUMBERENTRYCONTROLOBSERVER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/cvtuibrightness.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/cvtuibrightness.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2007 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: Brightness ui feature +* +*/ + + +#ifndef C_VTUIBRIGHTNESS_H +#define C_VTUIBRIGHTNESS_H + +#include "cvtuiprefsliderbase.h" + +/** +* CVtUiBrightness +* +* Brightness ui feature +* +* @since S60 v3.2 +*/ +class CVtUiBrightness : public CVtUiPrefSliderBase + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + */ + static CVtUiBrightness* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiBrightness(); + +public: // from CVtUiPrefSliderBase + + /** + * @see CVtUiPrefSliderBase::StartL + */ + void StartL(); + + /** + * @see CVtUiPrefSliderBase::Stop + */ + void Stop(); + +protected: + + /* + * Constructor + */ + CVtUiBrightness( CVtUiFeatureManager& aFeatureManager ); + + /** + * 2nd constructor + */ + void ConstructL(); + + }; + +#endif // C_VTUIBRIGHTNESS_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/cvtuibrightnesspopup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/cvtuibrightnesspopup.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2007 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: Brightness popup +* +*/ + + +#ifndef C_VTUIBRIGHTNESSPOPUP_H +#define C_VTUIBRIGHTNESSPOPUP_H + +#include "tvtuicomponentstate.h" +#include "cvtuiprefpopupbase.h" + + +/** +* CVtUiBrightnessPopup +* +* Brightness popup definition. +* +* @since S60 v3.2 +*/ +class CVtUiBrightnessPopup : public CVtUiPrefPopupBase + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + */ + static CVtUiBrightnessPopup* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiBrightnessPopup(); + +protected: // from CVtUiPrefPopupBase + + // @see CVtUiPrefPopupBase::CurrentValue + TInt CurrentValue() ; + +private: + + /** + * Constructor + */ + CVtUiBrightnessPopup( CVtUiFeatureManager& aFeatureManager ); + + /* + * 2nd constructor + */ + void ConstructL(); + + }; + +#endif // C_VTUIBRIGHTNESSPOPUP_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/cvtuicolortone.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/cvtuicolortone.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2007 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: Color tone feature. +* +*/ + + +#ifndef C_VTUICOLORTONE_H +#define C_VTUICOLORTONE_H + +#include +#include "cvtuiprefsettinglistbase.h" +#include "cvtuifeaturebase.h" +#include "tvtuicomponentstate.h" +#include "mvtuicomponent.h" +#include "mvtuilayoutchangeobserver.h" + +/** +* TVtUiColorToneComponentState +* +* Video quality componentstate definition. +* +* @since S60 v3.2 +*/ +class TVtUiColorToneComponentState : public TVtUiComponentState + { + +public: + + /** + * Constructor + * @param aComponent Reference to component. + */ + TVtUiColorToneComponentState( MVtUiComponent& aComponent ); + + }; + +/** +* CVtUiColorTone +* +* Color tone UI feature definition. +* +* @since S60 v3.2 +*/ +class CVtUiColorTone : public CVtUiPrefSettingListBase, + public MVtUiComponent, public MVtUiLayoutChangeObserver + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + */ + static CVtUiColorTone* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiColorTone(); + +public: // from MVtUiFeature + + /** + * @see MVtUiFeature::StartL + */ + void StartL(); + + /** + * @see MVtUiFeature::Stop + */ + void Stop(); + + /** + * @see MVtUiFeature::InitFeatureL + */ + void InitFeatureL(); + +public: // from MVtUiComponent + + /** + * @see MVtUiComponent::ComponentId + */ + MVtUiComponent::TComponentId ComponentId() const; + + /** + * @see MVtUiComponent::ComponentAsControl + */ + CCoeControl* ComponentAsControl(); + + /** + * @see MVtUiComponent::DoActivateL + */ + void DoActivateL(); + + /** + * @see MVtUiComponent::DoDeactivateL + */ + void DoDeactivateL(); + +public: // from MVtUiComponentManager + + /** + * @see MVtUiComponentManager::HandleLayoutChangeL + */ + void HandleLayoutChangeL(); + +protected: // from base class + + /** + * @see CVtUiPrefSettingListBase::CurrentSelection + */ + virtual TInt CurrentSelection(); + + /** + * @see CVtUiPrefSettingListBase::SetItemsL + */ + virtual void SetItemsL( CDesCArray& aArray ); + + /** + * @see CVtUiPrefSettingListBase::SettingPageResId + */ + virtual TInt SettingPageResId() const; + + /** + * @see CVtUiPrefSettingListBase::SettingPageItemChangedL + */ + virtual void SettingPageItemChangedL( TInt aIndex ); + +private: + + /** + * Constructor + */ + CVtUiColorTone( CVtUiFeatureManager& aFeatureManager ); + + // Maps color tone enum to array index + TInt MapCTEnumToArrayIndex( MVtEngCameraPreferences::TColorTone& + aColorTone ) const; + + // Maps arrya index to color tone enum + MVtEngCameraPreferences::TColorTone MapArrayIndexToCTEnum( + TInt aIndex) const; + + // Callback function that stops the feature. + static TInt DoStopL( TAny* aAny ); + + // Callback function that starts the feature. + static TInt DoStartL( TAny* aAny ); + +private: + + // Component state + TVtUiColorToneComponentState iComponentState; + + }; + +#endif // CVTUICOLORTONE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/cvtuicontrast.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/cvtuicontrast.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2007 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: Contrast ui feature +* +*/ + + +#ifndef C_VTUICONTRAST_H +#define C_VTUICONTRAST_H + +#include "cvtuiprefsliderbase.h" + + +/** +* CVtUiContrast +* +* Contrast ui feature +* +* @since S60 v3.2 +*/ +class CVtUiContrast : public CVtUiPrefSliderBase + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + */ + static CVtUiContrast* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiContrast(); + +public: // from CVtUiPrefSliderBase + + /** + * @see CVtUiPrefSliderBase::StartL + */ + void StartL(); + + /** + * @see CVtUiPrefSliderBase::Stop + */ + void Stop(); + +protected: + + /* + * Constructor + */ + CVtUiContrast( CVtUiFeatureManager& aFeatureManager ); + + /** + * 2nd constructor + */ + void ConstructL(); + + }; + +#endif // C_VTUICONTRAST_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/cvtuicontrastpopup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/cvtuicontrastpopup.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2007 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: Contrast popup +* +*/ + + +#ifndef C_VTUICONTRASTPOPUP_H +#define C_VTUICONTRASTPOPUP_H + +#include "tvtuicomponentstate.h" +#include "cvtuiprefpopupbase.h" + + +/** +* CVtUiContrastPopup +* +* Contrast popup definition. +* +* @since S60 v3.2 +*/ +class CVtUiContrastPopup : public CVtUiPrefPopupBase + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + */ + static CVtUiContrastPopup* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiContrastPopup(); + +protected: // from CVtUiPrefPopupBase + + // @see CVtUiPrefPopupBase::CurrentValue + TInt CurrentValue(); + +private: + + /** + * Constructor + */ + CVtUiContrastPopup( CVtUiFeatureManager& aFeatureManager ); + + /* + * 2nd constructor + */ + void ConstructL(); + + }; + +#endif // C_VTUICONTRASTPOPUP_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/cvtuiprefpopupbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/cvtuiprefpopupbase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2007 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: Base class for video preference popups +* +*/ + + +#ifndef C_VTUIPREFPOPUPBASE_H +#define C_VTUIPREFPOPUPBASE_H + + +#include "cvtuipopupbase.h" + +class MVtEngCameraPreferences; +class CVtUiFeatureManager; +/* +* CVtUiPrefPopupBase +* +* Base class for video preference popups +* +* @since S60 v3.2 +*/ +class CVtUiPrefPopupBase : public CVtUiPopupBase + { + +public: + + /** + * Destructor + */ + ~CVtUiPrefPopupBase(); + + +public: // from CVtUiPopupBase + + /** + * @see CVtUiPopupBase::HandleControlEventL + */ + void HandleControlEventL( + CCoeControl* aControl,TCoeEvent aEventType ); + + /** + * @see CVtUiPopupBase::UpdatePopupL + */ + void UpdatePopupL(); + +private: // from base class + + /** + * @see CVtUiPopupBase::OfferKeyEventL + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode aCode ); + +protected: // new functions + + // Does the actual viewfinder adjusting + void AdjustVideoL( TInt aValue ); + + // from base class CVtUiPopupBase::DoActivateL() + void DoActivateL(); + + // Gets current adjustvalue + virtual TInt CurrentValue() = 0; + +protected: + + /** + * Constructor + */ + CVtUiPrefPopupBase( CVtUiFeatureManager& aFeatureManager, + TVtUiBlockListBitField aBitField, TComponentId aComponentId, + TInt aCmdId ); + + /** + * 2nd constructor + */ + void BaseConstructL(); + +protected: + + // Pointer to camera preferences + MVtEngCameraPreferences* iCameraPref; + + // Reference to feature manager + CVtUiFeatureManager& iFeatureManager; + + // Engine command id + TInt iEngineCommandId; + + // Current value + TInt iCurrent; + }; + +#endif // C_VTUIPREFPOPUPBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/cvtuiprefsettinglistbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/cvtuiprefsettinglistbase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2007 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: Base class for video preference setting list. +* +*/ + + +#ifndef C_VTUIPEFSETTINGLISTBASE_H +#define C_VTUIPEFSETTINGLISTBASE_H + +#include +#include "mvtuicommandui.h" +#include "cvtuifeaturebase.h" +#include "mvtuicomponent.h" +#include "tvtuicomponentstate.h" +#include "tvtuifeatureids.h" +#include "mvtuisettingpageobserver.h" + +class CVtUiAppUi; +class CVtUiTransparentSettingPage; +class MVtEngCameraPreferences; + +/** +* CVtUiPrefSettingListBase +* +* Base class for color tone and white balance +* +* @since S60 v3.2 +*/ +class CVtUiPrefSettingListBase : public CVtUiFeatureBase, + public MAknSettingPageObserver, MVtUiSettingPageObserver + { + +public: + + /** + * Destructor + */ + ~CVtUiPrefSettingListBase(); + + /** + * has pending settingpange changed cmd cause camera cover switched. + */ + TBool IsPendingCmd(); + + /** + * handle pending settingpange command + */ + void HandlePendingCmdL(); + +public: // from MVtUiFeature + + /** + * @see MVtUiFeature::Stop + */ + virtual void Stop() = 0; + + /** + * @see MVtUiFeature::InitFeatureL + */ + virtual void InitFeatureL(); + +protected: // from MAknSettingPageObserver + + /** + * @see MAknSettingPageObserver::HandleSettingPageEventL + */ + void HandleSettingPageEventL( + CAknSettingPage* aSettingPage, + TAknSettingPageEvent aEventType ); + +protected: // from MVtUiSettingPageObserver + + /** + * @see MVtUiSettingPageObserver::ListStateChangedL + */ + void ListStateChangedL(); + +protected: + + // Gets currently selected list item + virtual TInt CurrentSelection() = 0; + + // Set items to setting page + virtual void SetItemsL( CDesCArray& aArray ) = 0; + + // Gets resource id for selection list + virtual TInt SettingPageResId() const = 0; + + // This function gets called when focus is moved + // to new item in the settin page list + virtual void SettingPageItemChangedL( TInt aIndex ) = 0; + + // Start function calls this + void StartSettingPageL(); + + // Stop function calls this + void StopSettingPageL(); + +public: // from CCoeControl + + /* + * @see CCoeControl::SizeChanged + */ + void SizeChanged(); + +public: + + /** + * Updates setting pages background bitmap + * @param aFrame Bitmap for setting page's backgound. + */ + void UpdateBackground( CFbsBitmap* aFrame ); + + /** + * Updates setting value + * E.g disabling video will reset camera settings. and + * after enabling video camera setting value needs to be restored. + */ + void UpdateSettingL(); + +protected: + + /** + * Constructor + */ + CVtUiPrefSettingListBase( CVtUiFeatureManager& aFeatureManager, + TVtUiFeatureId aFeatureId ); + + /** + * 2nd constructor + */ + void ConstructL(); + + // Reads item from resource and appends it to the array + void ReadAndAppendItemL( CDesCArray& aItems, TInt aResId ); + +private: + + // Does the initialisation of the setting page + void CreateSettingPageL(); + + // Resizes backround bitmap + void ResizeBackroundBitmapRect( ); + + // Sort controls window position + void SortControlsWindowPoistion(); + +protected: + + // Pointer to camera preferences + MVtEngCameraPreferences* iCameraPref; + + // The original value (which was active when the + // setting page was launched) + TInt iOriginalSelection; + + // Supported color tone or white balance modes + TUint32 iSupportedModes; + + // Contains currenltly supported items in setting page + RArray< TInt> iActiveItems; + + // whether or not has a pending command + TBool iPendingSettingChangeCmd; + +private: + + // Owned setting page instance + CVtUiTransparentSettingPage* iSettingPage; + + // Background bitmap for setting page + CFbsBitmap* iViewfinderBitmap; + + // Currently focused value + TInt iCurrentSelection; + + // Position of bitmap's top left corner + TPoint iBitmapTopLeftCorner; + + // Background bitmap's clip rect + TRect iBitmapClippingRect; + + // Reference to appui + CVtUiAppUi& iAppUi; + }; + +#endif // CVTUIPEFSETTINGLISTBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/cvtuiprefsliderbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/cvtuiprefsliderbase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2007 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: Base class for video pref sliders +* +*/ + + +#ifndef CVTUIPREFSLIDERBASE_H +#define CVTUIPREFSLIDERBASE_H + +#include "cvtuisliderbase.h" + +class CVtUiPopupBase; + +/** +* CVtUiPrefSliderBase +* +* Base class for video pref sliders +* +* @since S60 v3.2 +*/ +class CVtUiPrefSliderBase : public CVtUiSliderBase + { + +public: + + /** + * Destructor + */ + ~CVtUiPrefSliderBase(); + +public: // from CVtUiSliderBase + + /** + * @see CVtUiSliderBase::StartL + */ + void StartL(); + + /** + * @see CVtUiSliderBase::Stop + */ + void Stop(); + + /** + * @see CVtUiSliderBase::InitFeatureL + */ + void InitFeatureL(); + +protected: + + /* + * Constructor + */ + CVtUiPrefSliderBase( CVtUiFeatureManager& aFeatureManager, + TVtUiFeatureId aFeatureId ); + + /** + * 2nd constructor + */ + void BaseConstructL( ); + + }; + +#endif // CVTUIPREFSLIDERBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/cvtuiprefsliderskmodifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/cvtuiprefsliderskmodifier.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2007 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: Video preference slider softkey modifier class definition. +* +*/ + + +#ifndef C_VTUIPREFSLIDERMODIFIER_H +#define C_VTUIPREFSLIDERMODIFIER_H + +#include +#include "cvtuicommandmodifybase.h" + +class CVtUiAppUi; + +/** +* CVtUiPrefSliderSKModifier +* +* Video preference slider softkey modifier class definition. +* +* @since S60 v3.2 +*/ +class CVtUiPrefSliderSKModifier : public CVtUiCommandModifyBase + { + public: // static methods + /** + * Static constructor. + * @param aAppUi Reference to command appui. + * @param aResourceId Reference resource id. + */ + static CVtUiPrefSliderSKModifier* NewL( CVtUiAppUi& aAppUi, + TInt aResourceId ); + + /** + * Destructor + */ + ~CVtUiPrefSliderSKModifier(); + + public: // from base class + + /** + * @See CVtUiCommandModifyBase::ModifyCommandsL + */ + virtual void ModifyCommandsL( MVtUiCommandSetting& aCommandSettings ); + + /** + * @See CVtUiCommandModifyBase::Supports + */ + virtual TBool Supports( MVtUiCommandSetting::Type aType ) const; + + private: + /** + * C++ constructor + * + */ + CVtUiPrefSliderSKModifier( CVtUiAppUi& aAppUi, TInt aResourceId ); + + /** + * 2nd constructor + */ + void ConstructL(); + + private: // data + + // refrence to appui + CVtUiAppUi& iAppUi; + + // softkey resource id + TInt iResourceId; + + }; + +#endif // C_VTUIPREFSLIDERMODIFIER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/cvtuitransparentsettingpage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/cvtuitransparentsettingpage.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,108 @@ +/* +* Copyright (c) 2007 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: CVtUiTransparentSettingPage API definition. +* +*/ + + +#ifndef CVTUITRANSPARENTSETTINGPAGE_H +#define CVTUITRANSPARENTSETTINGPAGE_H + +#include + +class MVtUiSettingPageObserver; +class CAknsBasicBackgroundControlContext; + +/** +* CVtUiTransparentSettingPage +* +* CVtUiTransparentSettingPage API definition. +* +* @since S60 v3.2 +*/ +class CVtUiTransparentSettingPage : public CAknTransparentCameraSettingPage +{ +public: // public methods + /** + * handle layoutChange + */ + void HandleLayoutChangeL(); + + /** + * Constructor. + * @param aResourceID Setting Page to use. + * @param aCurrentSelectionIndex The currently selected index. + * @param aItemArray List of option texts and their selection states. + * @param aAppUi Reference to AppUi. + * @return Newly created instance of CVtUiTransparentSettingPage class. + */ + CVtUiTransparentSettingPage( + TInt aResourceID, + TInt& aCurrentSelectionIndex, + const MDesCArray* aItemArray ); + + /** + * 2nd constructor + */ + void ConstructL(); + + /** + * Destructor + */ + ~CVtUiTransparentSettingPage(); + + /** + * Adds setting page observer. + * @param aObserver Observer for setting page. + */ + void SetSettingPageEventStateObserver( + MVtUiSettingPageObserver* aObserver ); + +private: // from aknsettinpage + + /** + * @see CAknSettinPage::DynamicInitL + */ + void DynamicInitL(); + + /** + * @get the layout data in portrait or landscape mode + */ + void GetTheLayoutData(); + + /** + * @see CAknSettinPage::HandleControlEventL + */ + void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType ); + + /** + * @see CAknSettinPage::HandleResourceChange + */ + void HandleResourceChange(TInt aType); + +private: // new functions + + /* + * Gets rect from layout data. + */ + TRect RectFromLayout( const TAknWindowComponentLayout& + aComponentLayout ) const; + +private: + + // Setting page observer + MVtUiSettingPageObserver* iSettingPageObserver; +}; + +#endif // CVTUITRANSPARENTSETTINGPAGE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/cvtuivideoquality.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/cvtuivideoquality.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2007 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: Video quality feature. +* +*/ + + +#ifndef C_VTUIVIDEOQUALITY_H +#define C_VTUIVIDEOQUALITY_H + +#include +#include "cvtuifeaturebase.h" +#include "mvtuicomponent.h" +#include "tvtuicomponentstate.h" +#include "videotelui.hrh" + +/** +* TVtUiVideoQualityComponentState +* +* Video quality componentstate definition. +* +* @since S60 v3.2 +*/ +class TVtUiVideoQualityComponentState : public TVtUiComponentState + { + +public: + + /** + * Constructor + * @param aComponent Reference to component. + */ + TVtUiVideoQualityComponentState( MVtUiComponent& aComponent ); + + }; + +/** +* CVtUiVideoQuality +* +* Video quality UI feature definition. +* +* @since S60 v3.2 +*/ +class CVtUiVideoQuality : public CVtUiFeatureBase, + public MVtUiComponent + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + */ + static CVtUiVideoQuality* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiVideoQuality(); + +public: // from MVtUiFeature + + /** + * @see MVtUiFeature::StartL + */ + void StartL(); + + /** + * @see MVtUiFeature::Stop + */ + void Stop(); + + /** + * @see MVtUiFeature::InitFeatureL + */ + void InitFeatureL(); + +public: // from MVtUiComponent + + /** + * @see MVtUiComponent::ComponentId + */ + MVtUiComponent::TComponentId ComponentId() const; + + /** + * @see MVtUiComponent::ComponentAsControl + */ + CCoeControl* ComponentAsControl(); + + /** + * @see MVtUiComponent::DoActivateL + */ + void DoActivateL(); + + /** + * @see MVtUiComponent::DoDeactivateL + */ + void DoDeactivateL(); + +private: + + // Creates icons for list + CGulIcon* CreateIconLC( TVtUiBitmapId aIconId, TVtUiBitmapId aMaskId ); + + // Shows the selection list + void ShowSelectionListL(); + + // Async the selection list + static TInt AsyncShowSelectionList( TAny* aPtr ); + + // Reads items from source to target array and updates the selection icon + // if needed. + void SetItemsL( CDesCArray& aTarget,const CDesCArray& aSource ); + + // Return curretly active item. + TInt ActiveItem() const; + + // Item selected, adjust video quality. + void ItemSelectedL( TInt aItemIndex ); + +private: + + /** + * Constructor + */ + CVtUiVideoQuality( CVtUiFeatureManager& aFeatureManager ); + + /** + * 2nd constructor + */ + void ConstructL(); + + /** + * Callback function that stops the feature. + * @param aAny pointer to an instance of the class. + * @return always KErrNone. + */ + static TInt DoStop( TAny* aAny ); + +private: + + // Component state + TVtUiVideoQualityComponentState iComponentState; + + // Async callback for selection list + CAsyncCallBack* iShowSelectionListCallback; + }; + +#endif // CVTUIVIDEOQUALITY_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/cvtuiwhitebalance.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/cvtuiwhitebalance.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,167 @@ +/* +* Copyright (c) 2007 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: White balance feature. +* +*/ + + +#ifndef C_VTUIWHITEBALANCE_H +#define C_VTUIWHITEBALANCE_H + +#include +#include "cvtuiprefsettinglistbase.h" +#include "tvtuicomponentstate.h" +#include "mvtuicomponent.h" +#include "mvtuilayoutchangeobserver.h" + +/** +* TVtUiWhiteBalanceComponentState +* +* Video quality componentstate definition. +* +* @since S60 v3.2 +*/ +class TVtUiWhiteBalanceComponentState : public TVtUiComponentState + { + +public: + + /** + * Constructor + * @param aComponent Reference to component. + */ + TVtUiWhiteBalanceComponentState( MVtUiComponent& aComponent ); + + }; + +/** +* CVtUiWhiteBalance +* +* White balance UI feature definition. +* +* @since S60 v3.2 +*/ +class CVtUiWhiteBalance : public CVtUiPrefSettingListBase, + public MVtUiComponent, public MVtUiLayoutChangeObserver + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + */ + static CVtUiWhiteBalance* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiWhiteBalance(); + +public: // from MVtUiFeature + + /** + * @see MVtUiFeature::StartL + */ + void StartL(); + + /** + * @see MVtUiFeature:Stop + */ + void Stop(); + + /** + * @see MVtUiFeature::InitFeatureL + */ + void InitFeatureL(); + +public: // from MVtUiComponent + + /** + * @see MVtUiComponent::ComponentId + */ + MVtUiComponent::TComponentId ComponentId() const; + + /** + * @see MVtUiComponent::ComponentAsControl + */ + CCoeControl* ComponentAsControl(); + + /** + * @see MVtUiComponent::DoActivateL + */ + void DoActivateL(); + + /** + * @see MVtUiComponent::DoDeactivateL + */ + void DoDeactivateL(); + +public: // from MVtUiComponentManager + + /** + * @see MVtUiComponentManager::HandleLayoutChangeL + */ + void HandleLayoutChangeL(); + +protected: // from base class + + /** + * @see CVtUiPrefSettingListBase::CurrentSelection + */ + virtual TInt CurrentSelection(); + + /** + * @see CVtUiPrefSettingListBase::SetItemsL + */ + virtual void SetItemsL( CDesCArray& aArray ); + + /** + * @see CVtUiPrefSettingListBase::SettingPageResId + */ + virtual TInt SettingPageResId() const; + + /** + * @see CVtUiPrefSettingListBase::SettingPageItemChangedL + */ + virtual void SettingPageItemChangedL( TInt aIndex ); + +private: + + /** + * Constructor + */ + CVtUiWhiteBalance( CVtUiFeatureManager& aFeatureManager ); + + // Maps white balance enum to array index + TInt MapWBEnumToArrayIndex( MVtEngCameraPreferences::TWhiteBalance& + aWhiteBalance ) const; + + // Maps arrya index to white balance enum + MVtEngCameraPreferences::TWhiteBalance MapArrayIndexToWBEnum( TInt aIndex) const; + + // Callback function that stops the feature. + static TInt DoStopL( TAny* aAny ); + + // Callback function that starts the feature. + static TInt DoStartL( TAny* aAny ); + +private: + + // Component state + TVtUiWhiteBalanceComponentState iComponentState; + + }; + +#endif // CVTUIWHITEBALANCE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/prefs/mvtuisettingpageobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/prefs/mvtuisettingpageobserver.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2007 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: Observer API for CVtUiTransparentSettingPage. +* +*/ + + +#ifndef M_VTUISETTINGPAGEOBSERVER_H +#define M_VTUISETTINGPAGEOBSERVER_H + +/** +* MVtUiSettingPageObserver +* +* Observer API for CVtUiTransparentSettingPage. +* +* @since S60 v3.2 +*/ +class MVtUiSettingPageObserver + { + +public: + + /** + * Called when EEventStateChanged event occurs + * in setting page. + */ + virtual void ListStateChangedL() = 0; + + }; + +#endif // M_VTUISETTINGPAGEOBSERVER_H \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/softkey/cvtuisoftkeycontext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/softkey/cvtuisoftkeycontext.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2006 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: Softkey context class definition. +* +*/ + + +#ifndef C_VTUISOFTKEYCONTEXT_H +#define C_VTUISOFTKEYCONTEXT_H + +#include + +#include "cvtuicmdcontext.h" + +/** + * CVtUiSoftkeyContext + * + * Softkey command context class definition. + * + * @since S60 v3.2 + */ +class CVtUiSoftkeyContext : public CVtUiCmdContext + { + +public: // public methods + + /** + * C++ destructor. + */ + ~CVtUiSoftkeyContext(); + + /** + * Static constructor + * @param aCommandManager Reference to command manager. + */ + static CVtUiSoftkeyContext* NewL( MVtUiCommandManager& aCommandManager ); + +public: // virtual methods + + /** + * Make validations. + * + * @param aAction Reference to validation action base. + */ + void ValidateL( CVtUiCmdValidationActionBase& aAction ); + +private: + + /** + * C++ constructor + * + * @param aCommandManager Reference to command manager. + */ + CVtUiSoftkeyContext( MVtUiCommandManager& aCommandManager ); + + /** + * 2nd consttuctor, may leave. + */ + void ConstructL(); + + }; + +#endif // C_VTUISOFTKEYCONTEXT_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/softkey/cvtuisoftkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/softkey/cvtuisoftkeys.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2006 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: Softkey UI feature. +* +*/ + + +#ifndef C_VTUISOFTKEYS_H +#define C_VTUISOFTKEYS_H + +#include "mvtuicommandui.h" +#include "cvtuifeaturebase.h" + +class CEikButtonGroupContainer; +class CVtUiSoftkeySetting; +class CVtUiCommandModifyBase; +class CVtUiSoftkeyValidationAction; +class CVtUiSoftkeyContext; + +/** + * CVtUiSoftkeys + * + * Sofktey UI feature definition. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CVtUiSoftkeys ) : public CVtUiFeatureBase, + public MVtUiCommandUi + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + * @param aButtonGroupContainer Reference to button group container. + */ + static CVtUiSoftkeys* NewL( CVtUiFeatureManager& aFeatureManager, + CEikButtonGroupContainer& aButtonGroupContainer ); + + /** + * Destructor + */ + ~CVtUiSoftkeys(); + +public: + + /** + * Returns reference to application button group container. + */ + CEikButtonGroupContainer& ButtonGroup(); + +public: // from CVtUiFeatureBase + + /** + * @see CVtUiFeatureBase::StartL + */ + void StartL(); + + /** + * @see CVtUiFeatureBase::Stop + */ + void Stop(); + + /** + * @see CVtUiFeatureBase::InitFeatureL + */ + void InitFeatureL(); + +public: // from MVtUiCommandUi + + /** + * @see MVtUiCommandUi::RefreshL + */ + void RefreshL(); + + /** + * @see MVtUiCommandUi::AddCommandModifierL + */ + TInt AddCommandModifier( CVtUiCommandModifyBase& aModifier ); + + /** + * @see MVtUiCommandUi::RemoveCommandModifierL + */ + void RemoveCommandModifier( CVtUiCommandModifyBase& aModifier ); + +private: + + /** + * Constructor + */ + CVtUiSoftkeys( CVtUiFeatureManager& aFeatureManager, + CEikButtonGroupContainer& aButtonGroupContainer ); + + /** + * 2nd constructor + */ + void ConstructL(); + +private: + + // Softkey container + CEikButtonGroupContainer& iButtonGroupContainer; + + // Softkey context instance + CVtUiSoftkeyContext* iSoftkeyCommandContext; + + // Softkey setter + CVtUiSoftkeySetting* iSoftkeySetting; + + // Softkey validation action instance + CVtUiSoftkeyValidationAction* iSoftkeyValidationAction; + + }; + +#endif // C_VTUISOFTKEYS_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/softkey/cvtuisoftkeysetting.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/softkey/cvtuisoftkeysetting.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2006 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: Softkey settings class definition. +* +*/ + + +#ifndef C_VTUISOFTKEYSETTING_H +#define C_VTUISOFTKEYSETTING_H + +#include "cvtuicommandsetting.h" + +class CVtUiSoftkeys; +class CVtUiSoftkeyValidationAction; + +/** + * CVtUiSoftkeySetting + * + * Softkey setting class definition. + * + * @since S60 v3.2 + */ +class CVtUiSoftkeySetting : + public CVtUiCommandSetting< CVtUiSoftkeyValidationAction > + { + +public: + + /** + * Constructor + * @param aSoftkeys Reference to softkeysr. + */ + CVtUiSoftkeySetting( CVtUiSoftkeys& aSoftkeys ); + + /** + * Destructor + */ + ~CVtUiSoftkeySetting(); + +public: // from CVtUiCommandSetting + + /** + * @see CVtUiCommandSetting::DoDefineCommandsL + */ + void DoDefineCommandsL(); + +private: + + // Softkey container + CVtUiSoftkeys* iSoftkeys; + + }; + +#endif // C_VTUISOFTKEYSETTING_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/softkey/cvtuisoftkeyvalidationaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/softkey/cvtuisoftkeyvalidationaction.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2006 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: Softkey validation action class definition. +* +*/ + + +#ifndef C_CVTUISOFTKEYVALIDATIONACTION_H +#define C_CVTUISOFTKEYVALIDATIONACTION_H + +#include + +#include "cvtuicmdvalidationactionbase.h" + +/** + * CVtUiSoftkeyValidationAction + * + * Softkey validation action definition. + * + * @since S60 v3.2 + */ +class CVtUiSoftkeyValidationAction : public CVtUiCmdValidationActionBase + { + +public: + + /** + * Static constructor + */ + static CVtUiSoftkeyValidationAction* NewL(); + +public: // from CVtUiCmdValidationActionBase + + /** + * @see CVtUiCmdValidationActionBase::BeginProcess + */ + void BeginProcess(); + + /** + * @see CVtUiCmdValidationActionBase::ProcessL + */ + void ProcessL( const MVtUiCmdValidatorCallBack& aCallBack ); + +public: // new methods + + /** + * Returns resource id after validation process. + */ + TInt ResourceId() const; + +private: + + /** + * C++ constructor. + * + */ + CVtUiSoftkeyValidationAction(); + +private: // data + + // Index to currently selected softkey + TInt iCurrentIdx; + + }; + +#endif // C_CVTUISOFTKEYVALIDATIONACTION_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/toolbar/cvtuifixedtoolbar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/toolbar/cvtuifixedtoolbar.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2008 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: Fixed toolbar UI feature class definition. +* +*/ + + +#ifndef C_VTUIFIXEDTOOLBAR_H +#define C_VTUIFIXEDTOOLBAR_H + +#include "cvtuitoolbarbase.h" + +/** +* CVtUiFixedToolbar +* +* Toolbar UI feature definition. +* +* @since S60 3.2 +*/ +class CVtUiFixedToolbar : public CVtUiToolbarBase + { + public: // public methods + + /** + * Static constructor. + * @param aFeatureManager feature manager. + */ + static CVtUiFixedToolbar* NewL(CVtUiFeatureManager& aFeatureManager ); + + /** + * C++ destructor. + */ + ~CVtUiFixedToolbar(); + + public: // from CVtUiToolbarBase + + /** + * @see CVtUiToolbarBase::DoActivateL + */ + void DoActivateL(); + + /** + * @see CVtUiToolbarBase::DoDeactivateL + */ + void DoDeactivateL(); + + /** + * @see CVtUiToolbarBase::CreateToolbarButtonsL + */ + void CreateToolbarButtonsL(); + + /** + * @see CVtUiToolbarBase::PopulateCmdsIdsL + */ + void PopulateCmdsIdsL(); + + /** + * @see CVtUiToolbarBase::SetToolbarVisibilityAfterLayoutChange + */ + void SetToolbarVisibilityAfterLayoutChangeL( TBool aVisible ); + + private: + + // Hides/shows toolbar + void MakeToolbarVisible( const TBool aVisible ); + + // Dimms/undimms all toolbar buttons + void DimToolbarbuttons( TBool aIsDimmed ); + + // Sets toolbar visible + static TInt DoShowToolbarL( TAny* aAny ); + + // Sets toolbar buttons dimmed + static TInt DoDimToolbarButtons( TAny* aAny ); + + private: + + /** + * C++ constructor + */ + CVtUiFixedToolbar( CVtUiFeatureManager& aFeatureManager ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + private: // data + + // for callback usage + CIdle* iIdle; + }; + +#endif // C_VTUIFIXEDTOOLBAR_H \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/toolbar/cvtuifloatingtoolbar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/toolbar/cvtuifloatingtoolbar.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2006 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: Floating toolbar UI feature class definition. +* +*/ + + +#ifndef C_VTUIFLOATINGTOOLBAR_H +#define C_VTUIFLOATINGTOOLBAR_H + +#include "cvtuitoolbarbase.h" +#include "mvtuiresourcechangeobserver.h" +#include + +/** +* CVtUiFloatingToolbar +* +* Toolbar UI feature definition. +* +* @since S60 3.2 +*/ +class CVtUiFloatingToolbar : public CVtUiToolbarBase, + public MVtUiResourceChangeObserver + { + public: // public methods + + /** + * Static constructor. + * @param aFeatureManager feature manager. + */ + static CVtUiFloatingToolbar* NewL( CVtUiFeatureManager& + aFeatureManager ); + + /** + * C++ destructor. + */ + ~CVtUiFloatingToolbar(); + + + public: // from CVtUiToolbarBase + + + /** + * @see CVtUiToolbarBase::DoActivateL + */ + void DoActivateL(); + + /** + * @see CVtUiToolbarBase::DoDeactivateL + */ + void DoDeactivateL(); + + /** + * @see CVtUiToolbarBase::CreateToolbarButtonsL + */ + void CreateToolbarButtonsL(); + + /** + * @see CVtUiToolbarBase::PopulateCmdsIdsL + */ + void PopulateCmdsIdsL(); + + public: // from MVtUiResourceChangeObserver + + /** + * @see MVtUiComponent::HandleResourceChangeL + */ + void HandleResourceChangeL( TInt aType ); + + private: + + /** + * C++ constructor + */ + CVtUiFloatingToolbar( CVtUiFeatureManager& aFeatureManager ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + /** + + /* + * Gets rect from layout data. + */ + TRect RectFromLayout( const TAknWindowComponentLayout& + aComponentLayout ) const; + + /* + * Sets toolbar layout. + */ + void LayoutToolbarL(); + + /* + * Gets variety for layoutdata. + */ + TInt GetVariety( TBool aIsLandscapeOrientation ); + + private: // data + + + + }; + +#endif // C_VTUIFLOATINGTOOLBAR_H \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/toolbar/cvtuihidetoolbaritemaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/toolbar/cvtuihidetoolbaritemaction.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2006 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: Toolbar hide item action class definition. +* +*/ + + +#ifndef C_VTUIHIDETOLLBARITEMACTION_H +#define C_VTUIHIDETOLLBARITEMACTION_H + +#include +#include "cvtuicmdvalidationactionbase.h" +#include "tvtuistates.h" + +class CVtUiToolbarBase; + +/** +* CVtUiHideToolbarItemAction +* +* Toolbar hide item action definition. +* +* @since S60 v3.2 +*/ +class CVtUiHideToolbarItemAction : public CVtUiCmdValidationActionBase + { + public: + + /** + * Leave-safe constructor. + * @param aToolbar Pointer to toolbar. + * @param aUiStates Reference to uistates. + */ + static CVtUiHideToolbarItemAction* NewL( CVtUiToolbarBase* aToolbar, + const TVtUiStates& aUiStates ); + + /** + * Destructor + * + */ + ~CVtUiHideToolbarItemAction(); + + public: // from CVtUiCmdValidationActionBase + + /** + * @See CVtUiCmdValidationActionBase::ProcessL + */ + void ProcessL( const MVtUiCmdValidatorCallBack& aCallBack ); + + + /** + * @See CVtUiCmdValidationActionBase::EndProcess + */ + virtual void EndProcess(); + + private: + + /** + * C++ constructor. + * + */ + CVtUiHideToolbarItemAction( CVtUiToolbarBase* aToolbar, + const TVtUiStates& aUiStates ); + + /** + * Sets given toolbar control hidden in toolbar. + * + */ + void SetItemHiddenL( TInt aCommandId ); + + /** + * Decides if toolbar control should be dimmed or shown. + * + */ + void HideOrShowToolbarControlL( TInt aCommandId ); + + private: // data + + // Toolbar instance this action is currently working on + CVtUiToolbarBase* iToolbar; + + // Reference to UI states instance + const TVtUiStates& iUiStates; + }; + +#endif // C_VTUIHIDETOLLBARITEMACTION_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/toolbar/cvtuitoolbarbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/toolbar/cvtuitoolbarbase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,372 @@ +/* +* Copyright (c) 2006 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: Base class for toolbar. +* +*/ + + +#ifndef C_VTUITOOLBAR_H +#define C_VTUITOOLBAR_H + +#include +#include +#include + +#include "mvtuifeature.h" +#include "CVtUiAppUi.h" +#include "cvtuifeaturebase.h" +#include "mvtuicommandui.h" +#include "mvtuicomponent.h" +#include "mvtuiresourcechangeobserver.h" +#include "tvtuicomponentstate.h" +#include "mvtuilayoutchangeobserver.h" +#include + +class MVtuiFeature; +class CAknToolbar; +class CVtUiToolbarItem; +class TVtUiFeatureState; +class TVtUiStates; +class CVtUiToolbarContext; +class CVtUiToolbarCmdPolicy; +class CVtUiHideToolbarItemAction; +class CVtUiFeatureManager; +class CVtUiToolbarSKModifier; +class CVtUiToolbarButton; + +/** +* TVtUiToolbarComponentState +* +* Toolbar componentstate definition. +* +* @since S60 v3.2 +*/ +class TVtUiToolbarComponentState : public TVtUiComponentState + { + +public: + + /** + * Constructor + * @param aComponent Reference to component. + */ + TVtUiToolbarComponentState( MVtUiComponent& aComponent ); + + }; + +/** +* CVtUiToolbar +* +* Toolbar UI feature definition. +* +* @since S60 3.2 +*/ +class CVtUiToolbarBase : public CVtUiFeatureBase, public MAknToolbarObserver, + public MVtUiCommandUi, public MVtUiComponent, + public MVtUiLayoutChangeObserver + { + public: // public methods + + /** + * C++ destructor. + */ + ~CVtUiToolbarBase(); + + public: // from MAknToolbarObserver + + /** + * @see MAknToolbarObserver::DynInitToolbarL + */ + void DynInitToolbarL( + TInt aResourceId, + CAknToolbar* aToolbar ); + + /** + * @see MAknToolbarObserver::DynInitToolbarL + */ + void OfferToolbarEventL( TInt aCommand ); + + public: // from MVtUiFeature + /** + * @see MVtUiFeature::StartL + */ + void StartL(); + + /** + * @see MVtUiFeature::Stop + */ + void Stop(); + + /* + * @see MVtUiFeature::InitFeatureL + */ + void InitFeatureL(); + + public: // from MVtUiCommandUi + + /** + * @see MVtUiCommandUi::RefreshL + */ + void RefreshL(); + + /** + * @see MVtUiCommandUi::AddCommandModifier + */ + TInt AddCommandModifier( CVtUiCommandModifyBase& aModifier ); + + /** + * @see MVtUiCommandUi::RemoveCommandModifier + */ + void RemoveCommandModifier( CVtUiCommandModifyBase& aModifier ); + + public: // from MVtUiComponent + + /** + * @see MVtUiComponent::ComponentId + */ + TComponentId ComponentId() const; + + /** + * @see MVtUiComponent::ComponentAsControl + */ + CCoeControl* ComponentAsControl(); + + /** + * @see MVtUiComponent::DoActivateL + */ + virtual void DoActivateL(); + + /** + * @see MVtUiComponent::DoDeactivateL + */ + virtual void DoDeactivateL(); + + public: // from MVtUiComponentManager + + /** + * @see MVtUiComponentManager::HandleLayoutChangeL + */ + void HandleLayoutChangeL(); + + public: + + /** + * Return number of commands in toolbar. + * @return Number of commands. + */ + TInt NumberOfToolbarControls() const; + + /** + * Maps command id array index to command id. + * @param aIndex Command id array index. + * @return Command id associated with index. + */ + TInt CommandIdByCmdIdsArrayIndex( TInt aIndex ) const; + + /** + * Updates toolbar's buttons states and + * redraws the toolbar. + */ + void UpdateToolbarL(); + + /** + * EHidden + * command is hidden + * EDimmed + * command is dimmed + * EShown + * command is visible + */ + enum TCmdStateFlags + { + ENotInitialized = -1, + EHidden, + EDimmed, + EShown + }; + + /** + * Sets visibility of toolbar commands. + * @param aCmdId command id. + * @param aNewState command's new state. + * @return ETrue if command is available, otherwise EFalse. + */ + void SetCmdIdVisibilityStateL( TInt aCmdId, TCmdStateFlags aNewState); + + /** + * Cheks if command is available in toolbar. + * @param aCmdId command id. + * @return ETrue if command is available, otherwise EFalse. + */ + TBool IsCommandInToolbar( TInt aCmdId ) const; + + protected: + + /** + * C++ constructor + */ + CVtUiToolbarBase( CVtUiFeatureManager& aFeatureManager ); + + /** + * 2nd phase constructor + */ + void BaseConstructL(); + + protected: + + /** + * Creates toolbar buttons + */ + virtual void CreateToolbarButtonsL(); + + /* + * Appends all the commnands used by toolbar to an array. + */ + virtual void PopulateCmdsIdsL(); + + /* + * Sets toolbar visibility after layoutchange + */ + virtual void SetToolbarVisibilityAfterLayoutChangeL( TBool aVisible ); + + /** + * Creates all toolbar items() + */ + void CreateToolbarItemL( TInt aResourceId, + TInt aCommandId, CVtUiAppUi& appUi ); + + /** + * Finds command from array by command id. + */ + CVtUiToolbarButton* FindToolbarItemByCommandId( const TInt aCommandId ); + + /* + * Starts or stops to block pointer events + * @param aIsBlocking ETrue if events are blocked + * otherwise EFalse + */ + void BlockPointerEvents( TBool aIsBlocking ); + + /* + * Starts or stops to block key events + * @param aIsBlocking ETrue if events are blocked + * otherwise EFalse + */ + void BlockKeyEvents( TBool aIsBlocking ); + + /* + * Cheks if dialer component is active + * @return ETrue if dialer is aactive, otherwise EFalse. + */ + TBool IsDialerActive() const; + + /** + * Dims toolbar. + * @param aDimmed ETrue ETrue to dim the toolbar, + * EFalse to set the toolbar as not dimmed + */ + void DimToolbar( const TBool aDimmed, const TBool aDrawNow ); + private: + + /** + * Hides command from toolbar. + */ + void HideToolbarButton( const TInt aCommandId, const TBool aHide, + const TBool aDrawNow ); + + /** + * Dims command from toolbar. + */ + void DimToolbarButton( const TInt aCommandId, const TBool aDimmed, + const TBool aDrawNow ); + + /** + * Maps toggle button id to single command id. + */ + TInt MapCmdIdToChilId( TInt aCmdId ); + + /** + * Maps single command id to toggle button id. + */ + TInt MapCmdIdToParentId( TInt aCmdId ); + + /* + * Checks if command id associated with toggle button is visible. + * Togglle button has two states and two command ids which has their + * own state values. See from .rss file. + */ + TBool IsCmdIdVisibleInToggleButton( TInt aCmdId ); + + /* + * Checks if both command ids in togglebutton are dimmed. + */ + TBool IsToggleButtonHidden( TInt aFirstCmdId, TInt aSecondCmdId ); + + /* + * Removes registrations. + */ + void Clean(); + + protected: // data + + // array of supported commmand ids + RArray iCmdIds; + + // current focus id + TInt iCmdFocus; + + // owned toolbar control + CAknToolbar* iToolbar; + + // Number of supported toolbar buttons + TInt iNumberOfToolbarButtons; + + private: // data + + // struct used by iCmdStates array + class TCommandState + { + public: + TInt iCmdId; + TCmdStateFlags iOldState; + TCmdStateFlags iNewState; + }; + + // owned toolbar item array + RPointerArray iToolBarControls; + + // toolbar context instance + CVtUiToolbarContext* iToolbarCtx; + + // owned hide toolbar item action + CVtUiHideToolbarItemAction* iHideToolbarItemAction; + + // Toolbar command policy instance + CVtUiToolbarCmdPolicy* iToolbarCmdPolicy; + + // owned softkey modifier + CVtUiToolbarSKModifier* iToolbarSKModifier; + + // array which hold state information of the commands + RArray iCmdStates; + + // Component state + TVtUiToolbarComponentState iComponentState; + + // ETrue if capture mode was on in previous update + TBool iWasCaptureModePreviousState; + + }; + +#endif // C_VTUITOOLBAR_H \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/toolbar/cvtuitoolbarbutton.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/toolbar/cvtuitoolbarbutton.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2006 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: CVtUiToolbarButton class definition. +* +*/ + + +#ifndef C_VTUITOOLBARBUTTON_H +#define C_VTUITOOLBARBUTTON_H + +#include + +class CVtUiAppUi; + +/** +* CVtUiToolbarButton +* +* Toolbar button class definition. +* +* @since S60 3.2 +*/ +class CVtUiToolbarButton : public CAknButton + { + public: + + /** + * Static constructor. + * @param aResourceId Resource id. + * @param aAppUi Reference to appui. + * @param aCmdId Reference to command id. + */ + static CVtUiToolbarButton* NewL( TInt aResourceId, + CVtUiAppUi& aAppUi, TInt aCmdId ); + + /** + * Static constructor. + * @param aResourceId Resource id. + * @param aAppUi Reference to appui. + * @param aCmdId Reference to command id. + */ + static CVtUiToolbarButton* NewLC( TInt aResourceId, + CVtUiAppUi& aAppUi, TInt aCmdId ); + + /** + * C++ destructor. + */ + ~CVtUiToolbarButton(); + + /* + * Shows help text for a certain period of time. + */ + void ShowHelpL(); + + /* + * Return commmand id + */ + TInt CmdId() const; + + /* + * Starts or stops to block pointer events + * @param aIsBlocking ETrue if events are blocked + * otherwise EFalse + */ + void BlockPointerEvents( TBool aIsBlocking ); + + /* + * Starts or stops to block key events + * @param aIsBlocking ETrue if events are blocked + * otherwise EFalse + */ + void BlockKeyEvents( TBool aIsBlocking ); + + + /* @see CAknButton::OfferKeyEventL */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /* @see CAknButton::HandlePointerEventL */ + void HandlePointerEventL( const TPointerEvent& + aPointerEvent ); + + /* @see CAknButton::StatesCount */ + TInt StatesCount() const; + + private: + + /** + * Constructor + */ + CVtUiToolbarButton( CVtUiAppUi& aAppUi, TInt aCmdId ); + + private: + + /** + * Checks whether key events should be blocked. + */ + TBool IsCommandActive() const; + + private: + + // reference to appui + CVtUiAppUi& iAppUi; + + // command id + TInt iCmdId; + + // Flag to indicate is key event blocking on + TBool iIsBlockingKeyEvents; + + // Flag to indicate is pointer event blocking on + TBool iIsBlockingPointerEvents; + + // time stamp to limit pointerevents + TTime iTimeStamp; + + TBool isLimitingPointers; + + }; + +#endif // C_VTUITOOLBARBUTTON_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/toolbar/cvtuitoolbarcmdpolicy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/toolbar/cvtuitoolbarcmdpolicy.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,100 @@ +/* +* 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: Toolbar command policy implementation. +* +*/ + + +#ifndef C_VTUITOOLBARCMDPOLICY_H +#define C_VTUITOOLBARCMDPOLICY_H + +#include + +#include "tvtuicmdpolicypriority.h" +#include "cvtuicmdvalidatorbase.h" + +class CVtUiCmdValidationActionBase; +class CVtUiToolbarBase; + +/** +* CVtUiToolbarCmdPolicy +* +* Toolbar command policy implementation. +* +* @since S60 v3.2 +*/ +class CVtUiToolbarCmdPolicy : public CVtUiCmdValidatorBase + { + public: // public methods + + /** + * Static constructor. + * @param aToolbar Reference to toolbar. + */ + static CVtUiToolbarCmdPolicy* NewL( CVtUiToolbarBase& aToolbar ); + + public: // from CVtUiCmdValidatorBase + + /** + * @see CVtUiCmdValidatorBase::ValidateMenuItemsL + */ + void ValidateMenuItemsL( CVtUiCmdValidationActionBase& aAction, + TInt aReferencePriority ); + + /** + * @see CVtUiCmdValidatorBase::ValidateSoftkeyItemsL + */ + void ValidateSoftkeyItemsL( CVtUiCmdValidationActionBase& aAction, + TInt aReferencePriority ); + + /** + * @see CVtUiCmdValidatorBase::ValidateToolbarItemsL + */ + void ValidateToolbarItemsL( CVtUiCmdValidationActionBase& aAction, + TInt aReferencePriority ); + + /** + * @see CVtUiCmdValidatorBase::CustomValidationL + */ + void CustomValidationL( CVtUiCmdCustomValidationActionBase& aAction, + TInt aReferencePriority ); + + /** + * @see CVtUiCmdValidatorBase::ValidatesContext + */ + TBool ValidatesContext( const TVtUiCmdContextType& aCtxType ) + const; + + private: + + /** + * C++ constructor + * + */ + CVtUiToolbarCmdPolicy( CVtUiToolbarBase& aToolbar ); + + /** + * Callback for menu validation. + * + */ + TBool ValidateMenuCommand( TInt aCommandId ) const; + + private: // data + + // Reference to cvtuitoolbar + CVtUiToolbarBase& iToolbar; + + }; + +#endif // C_VTUITOOLBARCMDPOLICY_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/toolbar/cvtuitoolbarcontext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/toolbar/cvtuitoolbarcontext.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2006 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: Toolbar context class definition. +* +*/ + + +#ifndef C_VTUITOOLBARCONTEXT_H +#define C_VTUITOOLBARCONTEXT_H + +#include + +#include "cvtuicmdcontext.h" + +class CVtUiCmdValidatorBase; + +/** Toolbar context reference priority */ +const TInt KVtUiToolbarContextPriority = 50; + +/** +* CVtUiToolbarContext +* +* Toolbar context class definition. +* +* @since S60 v3.2 +*/ +class CVtUiToolbarContext : public CVtUiCmdContext + { + public: // public methods + + /** + * C++ destructor. + * + */ + ~CVtUiToolbarContext(); + + /** + * Leave safe destructor. + * @param aCommandManager Reference to command manager. + */ + static CVtUiToolbarContext* NewL( + MVtUiCommandManager& aCommandManager ); + + public: // from CVtUiCmdContext + + /** + * @see CVtUiCmdContext::ValidateL + */ + void ValidateL( CVtUiCmdValidationActionBase& aAction ); + + private: + + /** + * C++ constructor + * + * @param aCommandManager Reference to command manager. + */ + CVtUiToolbarContext( MVtUiCommandManager& aCommandManager ); + + /** + * 2nd consttuctor, may leave. + */ + void ConstructL(); + + }; + +#endif // C_VTUITOOLBARCONTEXT_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/toolbar/cvtuitoolbarskmodifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/toolbar/cvtuitoolbarskmodifier.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2006 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: Toolbar softkey modifier class definition. +* +*/ + + +#ifndef C_VTUITOOLBARSKMODIFIER_H +#define C_VTUITOOLBARSKMODIFIER_H + +#include +#include "cvtuicommandmodifybase.h" + +class CVtUiAppUi; +class TVtUiStates; + +/** +* CVtUiToolbarSKModifier +* +* Toolbar softkey modifier class definition. +* +* @since S60 v3.2 +*/ +class CVtUiToolbarSKModifier : public CVtUiCommandModifyBase + { + public: // static methods + /** + * Static constructor. + * @param aAppUi Reference to command appui. + * @param aUiStates Reference to uistates. + */ + static CVtUiToolbarSKModifier* NewL( CVtUiAppUi& aAppUi, + const TVtUiStates& aUiStates ); + + /** + * Destructor + */ + ~CVtUiToolbarSKModifier(); + + public: // from base class + + /** + * @See CVtUiCommandModifyBase::ModifyCommandsL + */ + virtual void ModifyCommandsL( MVtUiCommandSetting& aCommandSettings ); + + /** + * @See CVtUiCommandModifyBase::Supports + */ + virtual TBool Supports( MVtUiCommandSetting::Type aType ) const; + + private: + /** + * C++ constructor + * + */ + CVtUiToolbarSKModifier( CVtUiAppUi& aAppUi, + const TVtUiStates& aUiStates ); + + /** + * 2nd constructor + */ + void ConstructL(); + + private: // data + + // refrence to appui + CVtUiAppUi& iAppUi; + + // UI states + const TVtUiStates& iUiStates; + + }; + +#endif // C_VTUITOOLBARSKMODIFIER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/toolbar/tvtuitoolbarcommanditerator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/toolbar/tvtuitoolbarcommanditerator.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2006 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: Toolbar command iterator class definition. +* +*/ + + +#ifndef T_VTUITOOLBARCOMMANDITERATOR_H +#define T_VTUITOOLBARCOMMANDITERATOR_H + +#include "mvtuicommanditerator.h" + +class CVtUiToolbarBase; + +/** +* TVtUiToolbarCommandIterator +* +* Toolbar command iterator class definition. +* +* @since S60 v3.2 +*/ +class TVtUiToolbarCommandIterator : public MVtUiCommandIterator + { + +public: // public methods + + /** + * C++ constructor + * @param aToolbar Reference to toolbar. + */ + TVtUiToolbarCommandIterator( CVtUiToolbarBase& aToolbar ); + +public: // from MVtUiCommandIterator + + /** + * @see MVtUiCommandIterator::HasNext + */ + TBool HasNext() const; + + /** + * @see MVtUiCommandIterator::Next + */ + TInt Next(); + +private: + + // Pointer to Toolbar + CVtUiToolbarBase* iToolbar; + + // Current iteration point + TInt iCurrent; + + }; + +#endif // T_VTUITOOLBARCOMMANDITERATOR_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/tvtuifeatureids.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/tvtuifeatureids.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2006 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: Feature ids. +* +*/ + + +#ifndef T_VTUIFEATUREIDS_H +#define T_VTUIFEATUREIDS_H + +/** + * + * Feature IDs. + * + */ +enum TVtUiFeatureId + { + /** Toolbar feature id */ + EVtUiFeatureIdToolbar = 1, + + /** Softkey feature id */ + EVtUiFeatureIdSoftkey, + + /** Menu feature id */ + EVtUiFeatureIdMenu, + + /** Mini Dialer feature id */ + EVtUiFeatureIdMiniDialer, + + /** Number entry feature id */ + EVtUiFeatureIdNumberEntry, + + /** Video quality feature id */ + EVtUiFeatureIdVideoQuality, + + /** White balance feature id */ + EVtUiFeatureIdWhiteBalance, + + /** Color tone feature id */ + EVtUiFeatureIdColourTone, + + /** Brightness feature id */ + EVtUiFeatureIdBrightness, + + /** Contrast feature id */ + EVtUiFeatureIdContrast, + + /** Dialer feature id */ + EVtUiFeatureIdDialer, + + /** Volume feature id */ + EVtUiFeatureIdVolume, + + /** Zoom feature id */ + EVtUiFeatureIdZoom + }; + +#endif // T_VTUIFEATUREIDS_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/volume/cvtuivolume.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/volume/cvtuivolume.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007 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: Volume ui feature +* +*/ + + +#ifndef C_VTUIVOLUME_H +#define C_VTUIVOLUME_H + +#include "cvtuisliderbase.h" + +/** +* CVtUiVolume +* +* Volume ui feature +* +* @since S60 v3.2 +*/ +class CVtUiVolume : public CVtUiSliderBase + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + */ + static CVtUiVolume* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiVolume(); + + /** + * Refresh volume popup status. + */ + void RefreshL(); + +public: // from CVtUiSliderBase + + /** + * @see CVtUiSliderBase::StartL + */ + void StartL(); + + /** + * @see CVtUiSliderBase::Stop + */ + void Stop(); + + /* + * Return current slider's volume value + */ + TInt GetVolumeValue(); + +protected: + + /* + * Constructor + */ + CVtUiVolume( CVtUiFeatureManager& aFeatureManager ); + + /** + * 2nd constructor + */ + void ConstructL(); + + }; + +#endif // C_VTUIVOLUME_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/volume/cvtuivolumecontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/volume/cvtuivolumecontrol.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2008 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: Volume control adjusts engine side volume values. +* +*/ + + + +#ifndef CVTUIVOLUMECONTROL_H +#define CVTUIVOLUMECONTROL_H + + +#include +#include +#include + +class MVtEngCommandHandler; +class MVtUiEngineCommandManager; +class CVtUiFeatureManager; + + +/** +* Volume control adjusts engine side volume values. +* +* @since Series 60 v5.0 +*/ +class CVtUiVolumeControl + : public CBase, + private MVtEngCommandObserver + { + public: // Constructors and destructor + + // Type for volume settings. + typedef MVtEngAudio::TVtEngOutputVolume TVolume; + + /** + * Constructor. + * + * @param aSelfPtr optional pointer to itself. + * @param aCommandHandler command handler. + * @param aAudio audio interface. + * @param aCommandManager command manager. + * @param aFeatureManager Reference to feature manager. + */ + CVtUiVolumeControl( + MVtEngCommandHandler& aCommandHandler, + MVtEngAudio& aAudio, + MVtUiEngineCommandManager& aCommandManager, + CVtUiFeatureManager& aFeatureManager ); + + /* + * 2nd phase constructor + */ + void ConstructL(); + + /** + * Destructor. + */ + ~CVtUiVolumeControl(); + +public: // New functions + + // Adjust volume to new value + void AdjustVolumeL( TVolume aVolume ); + +private: + + /** + * @see MVtEngCommandObserver::HandleVTCommandPerformedL. + */ + virtual void HandleVTCommandPerformedL( + TVtEngCommandId aCommand, + const TInt aError ); + + // Checks if volume is changed in slider + TBool IsVolumeChangedL(); + +private: + + // Reference to command handler. + MVtEngCommandHandler& iCommandHandler; + + // Reference to audio interface. + MVtEngAudio& iAudio; + + // Reference to command manager. + MVtUiEngineCommandManager& iCommandManager; + + // ETrue if command is performed. + TBool iCommandPerformed; + + // Volume being updated to engine. + TVolume iVolume; + + // Volume pointer descriptor. + TPtrC8 iVolumePtr; + + // Reference to featuremanager + CVtUiFeatureManager& iFeatureManager; + + // Is control adjusting volume + TBool iIsActive; + }; + +#endif // CVtUiVolumeControl_H + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/volume/cvtuivolumepopup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/volume/cvtuivolumepopup.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2007 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: Volume popup definition +* +*/ + + +#ifndef C_VTUIVOLUMEPOPUP_H +#define C_VTUIVOLUMEPOPUP_H + +#include "tvtuicomponentstate.h" +#include "cvtuipopupbase.h" +#include "mvtengaudio.h" + +class CVtUiFeatureManager; +class CVtEngModel; + +/** +* CVtUiVolumePopup +* +* Volume popup definition. +* +* @since S60 v3.2 +*/ +class CVtUiVolumePopup : public CVtUiPopupBase + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + */ + static CVtUiVolumePopup* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiVolumePopup(); + + /** + * Refresh volume popup status. + */ + void RefreshL(); + + /** + * Update volume popup and audio routing + */ + void UpdateVolumeAndRoutingL(); + +private: // from base class + + /** + * @see CVtUiPopupBase::DoActivateL + */ + void DoActivateL(); + + /** + * @see CVtUiPopupBase::OfferKeyEventL + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode aCode ); + + /** + * @see CVtUiPopupBase::HandleControlEventL + */ + void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); + +private: + + /** + * Constructor + */ + CVtUiVolumePopup( CVtUiFeatureManager& aFeatureManager ); + + /* + * 2nd constructor + */ + void ConstructL(); + + /** + * Returns current output volume for given routing. + */ + TInt OutputVolume( MVtEngAudio::TAudioRoutingState aRouting ) const; + + /** + * Updates volume + */ + void UpdateVolumeL(); + +private: + + // Engine model + CVtEngModel& iModel; + + // Stored audio routing state. + MVtEngAudio::TAudioRoutingState iAudioRouting; + + // Stored volume + TInt iVolume; + + // Reference to feature manager + CVtUiFeatureManager& iFeatureManager; + + }; + +#endif // C_VTUIVOLUMEPOPUP_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/zoom/cvtuizoom.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/zoom/cvtuizoom.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007 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: Zoom ui feature +* +*/ + + +#ifndef C_VTUIZOOM_H +#define C_VTUIZOOM_H + +#include "cvtuisliderbase.h" + +/** +* CVtUiZoom +* +* Zoom ui feature +* +* @since S60 v3.2 +*/ +class CVtUiZoom : public CVtUiSliderBase + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + */ + static CVtUiZoom* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiZoom(); + + /** + * Refresh zoom popup status. + */ + void RefreshL(); + +public: // from CVtUiSliderBase + + /** + * @see CVtUiSliderBase::StartL + */ + void StartL(); + + /** + * @see CVtUiSliderBase::Stop + */ + void Stop(); + + /** + * @see CVtUiSliderBase::ComponenStateChangedL + */ + void ComponenStateChangedL(); + +protected: + + /* + * Constructor + */ + CVtUiZoom( CVtUiFeatureManager& aFeatureManager ); + + /** + * 2nd constructor + */ + void ConstructL(); + + }; + +#endif // C_VTUIZOOM_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/features/zoom/cvtuizoompopup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/features/zoom/cvtuizoompopup.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2007 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: Zoom popup definition +* +*/ + + +#ifndef C_VTUIZOOMPOPUP_H +#define C_VTUIZOOMPOPUP_H + +#include "tvtuicomponentstate.h" +#include "cvtuipopupbase.h" + +class CVtUiFeatureManager; +class MVtEngMedia; + +/** +* CVtUiZoomPopup +* +* Zoom popup definition. +* +* @since S60 v3.2 +*/ +class CVtUiZoomPopup : public CVtUiPopupBase + { + +public: + + /** + * Static constructor + * @param aFeatureManager Reference to feature manager. + */ + static CVtUiZoomPopup* NewL( CVtUiFeatureManager& aFeatureManager ); + + /** + * Destructor + */ + ~CVtUiZoomPopup(); + + /** + * Refresh zoom popup status. + */ + void RefreshL(); + +private: // from CVtUiPopupBase + + /** + * @see CVtUiPopupBase::DoActivateL + */ + void DoActivateL(); + +private: // from base class + + /** + * @see CVtUiPopupBase::OfferKeyEventL + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode aCode ); + + /** + * @see CVtUiPopupBase::HandleControlEventL + */ + void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); + +private: + + /** + * Constructor + */ + CVtUiZoomPopup( CVtUiFeatureManager& aFeatureManager ); + + /* + * 2nd constructor + */ + void ConstructL(); + + /* + * Updates zoom adjust range according to current active provider. + */ + void UpdateAdjustRangeL(); + + /** + * Returns current zoom step or KErrNotFound if an error happens. + */ + TInt CurrentZoomStep() const; + + /** + * Returns maximum zoom step or KErrNotFound if an error happens. + */ + TInt MaxZoomStep() const; + + void ScaleAndSetZoomFactorL( TInt aValue ); + +private: + + // Reference to feature manager + CVtUiFeatureManager& iFeatureManager; + + // Engine media + MVtEngMedia& iMedia; + + // Current zoom + TInt iCurrent; + + // Maximum zoom value + TInt iMax; + + }; + +#endif // C_VTUIZOOMPOPUP_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/mvtuinumbersource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/mvtuinumbersource.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2006 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: Number Source API +* +*/ + + +#ifndef M_VTUINUMBERSOURCE_H +#define M_VTUINUMBERSOURCE_H + +#include + +/** + * MVtUiNumberSource + * + * @since S60 v3.2 + */ +class MVtUiNumberSource + { + +public: + + /** + * Gets number typed by the user. + * + */ + virtual void GetContents( TDes& aContents ) const = 0; + + }; + +#endif // M_VTUINUMBERSOURCE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/mvtuishutterobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/mvtuishutterobserver.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2007 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: Interface for reporting application shutdown readiness. +* +*/ + + +#ifndef M_MVTUISHUTTEROBSERVER_H +#define M_MVTUISHUTTEROBSERVER_H + + +/** +* Observer interface for reporting shutdown readiness. +* +* @since S60 v3.2 +*/ +class MVtUiShutterObserver + { +public: + + /** + * Called when application can exit. + */ + virtual void HandleShutdownReady() = 0; + }; + +#endif // M_MVTUISHUTTEROBSERVER_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/mvtuistatecontext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/mvtuistatecontext.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2007 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: Interface for state objects to request application services. +* +*/ + + +#ifndef M_MVTUISTATECONTEXT_H +#define M_MVTUISTATECONTEXT_H + +#include +#include +#include "mvtuishutterobserver.h" + +class TVtUiAppStateBase; +class CVtEngModel; +class MVtUiNumberSource; +class TVtUiVideoTelephonyVariation; + +/** +* Provides service interface for application state objects. +* +* @since S60 v3.2 +*/ +class MVtUiStateContext : public MVtUiShutterObserver + { + public: + + /** + * Starts first phase of startup when prepare is received. + */ + virtual void StartupPhase1L() = 0; + + /** + * Starts application shutdown. + */ + virtual void ShutdownL() = 0; + + /** + * Starts second phase of startup. + */ + virtual void StartupPhase2L() = 0; + + /** + * Sets application to foreground and background. + * @param aForeground ETrue => foreground, EFalse => background + */ + virtual void ChangeApplicationFocus( const TBool aForeground ) = 0; + + /** + * Changes current application state. + * @param aState new state + */ + virtual void ChangeState( TVtUiAppStateBase* aState ) = 0; + + /** + * Starts DTMF tone. + * @param aTone DTMF tone. + */ + virtual void StartDtmfTone( const TChar& aTone ) = 0; + + /** + * Stops tarts DTMF tone. + */ + virtual void StopDtmfTone() = 0; + + /** + * Returns model. + * @return model + */ + virtual CVtEngModel& Model() = 0; + + /** + * Returns video telephony variation. + * @return variation + */ + virtual const TVtUiVideoTelephonyVariation& + VideoTelephonyVariation() const = 0; + /** + * Returns source containing numbers typed by the user. + * @return number soure + */ + virtual MVtUiNumberSource* NumberSource() const = 0; + + /** + * Executes engine command. + * @param aCommand command id + * @param aParams command params + */ + virtual void DoExecuteCmdL( const TVtEngCommandId aCommand, + TDesC8* aParams ) = 0; + + /** + * Refreshes application UI. + * @param aRefreshFlags identifies what to refresh + */ + virtual void RefreshL( const TInt aRefreshFlags ) = 0; + + /** + * Updates engine states. + */ + virtual void RefreshStatesL() = 0; + + /** + * Handles layout change. + */ + virtual void DoHandleLayoutChangedL() = 0; + + /** + * Sets call id. + */ + virtual void SetCallIdL( const TInt aCallId ) = 0; + + /** + * Sets display text of remote end. + */ + virtual TBool SetCallNameL( const TDesC& aName ) = 0; + + /** + + + /** + * Refresh flags + */ + enum TRefreshFlags + { + /** Navipane is refreshed */ + ENaviPane = 0x01, + /** Softkeys are refreshed */ + ESoftkeys = 0x02, + /** Refreshes blind (video availability) status */ + EBlind = 0x04, + /** Refreshes state sync with call handling */ + ESynchronise = 0x08, + /** Refreshes internal states (media etc) */ + EUiStates = 0x10, + /** Refreshes everything */ + EAll = ENaviPane | + ESoftkeys | + EBlind | + ESynchronise | + EUiStates + }; + }; + + +#endif // M_MVTUISTATECONTEXT_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/sliders/cvtuipopupbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/sliders/cvtuipopupbase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,275 @@ +/* +* Copyright (c) 2007 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: Base class for video telephone popups +* +*/ + + +#ifndef C_VTUIPOPUPBASE_H +#define C_VTUIPOPUPBASE_H + +#include + +#include "mvtuicomponent.h" +#include "tvtuicomponentstate.h" +#include "tvtuifeatureids.h" +#include "mvtuiresourcechangeobserver.h" +#include "mvtuikeyeventobserver.h" + +class CAknVolumePopup; +class MVtUiComponentManager; +class MVtUiComponentStateObserver; +class CFbsBitmap; + +/** +* TVtUiBaseComponentState +* +* Base componentstate definition. +* +* @since S60 v3.2 +*/ +class TVtUiBaseComponentState : public TVtUiComponentState + { + +public: + /** + * Constructor + * @param aComponent Reference to component. + */ + TVtUiBaseComponentState( MVtUiComponent& aComponent, + TVtUiBlockListBitField aBitField ); + }; + +/** +* CVtUiPopupBase +* +* Base class for vide telephone popups +* +* @since S60 v3.2 +*/ +class CVtUiPopupBase : public CBase, public MVtUiComponent, + public MVtUiResourceChangeObserver, public MCoeControlObserver, + public MVtUiKeyEventObserver + { + +public: + + /** + * Destructor + */ + ~CVtUiPopupBase(); + +public: // from MVtUiComponent + + /** + * @see MVtUiComponent::ComponentId + */ + TComponentId ComponentId() const; + + /** + * @see MVtUiComponent::ComponentAsControl + */ + CCoeControl* ComponentAsControl(); + + /** + * @see MVtUiComponent::DoActivateL + */ + virtual void DoActivateL(); + + /** + * @see MVtUiComponent::DoDeactivateL + */ + virtual void DoDeactivateL(); + +public: // from MVtUiComponentManager + + /** + * @see MVtUiComponentManager::HandleResourceChangeL + */ + void HandleResourceChangeL( TInt aType ); + +public: // from MCoeControlObserver + + /** + * @see MCoeControlObserver::HandleControlEventL + */ + virtual void HandleControlEventL( + CCoeControl* aControl,TCoeEvent aEventType ) = 0; + +public: // from MVtUiKeyEventObserver + + /** + * @see CCoeControl::MVtUiKeyEventObserver + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aCode ); + +public: // new functions + + /** + * Set popup to be pemanently visible i.e. tapping outside + * the control doesn't close the control. + * @param aPermanent If Etrue popup will be visible all the time, + * otherwise popup is closed and next time will obey timeout. + */ + void SetPermanenVisibility( TBool aPermanent ); + + /** + * Set new component observer + * @param iCompStateObserver New observer + */ + void SetObserver( MVtUiComponentStateObserver& aCompStateObserver ); + + /** + * Gets slider control value. + * @return value within slider control's value range + */ + TInt Value() const; + + /** + * update popup itself + */ + virtual void UpdatePopupL(); + +protected: // new functions + + /** + * Set new value to slider control. + * @param aValue value within slider control's value range. + */ + void SetValue( TInt aValue ); + + /** + * Scales the given value to slider control's value range + * and sets it to the slider control + * @param aValue value within popup control's value range. + */ + void ScaleAndSetValue( TInt aValue ); + + /** + * Gets value from the slider control and scales it + * @return value within popup control's value range + */ + TInt ScaledValue() const; + + /** + * Gets value from the slider control and scales it + * @param aValue value in popup control's value range. + * @return value within slider control's value range + */ + TInt SliderValueWithScaling( TInt aValue ) const; + + /** + * Set new end point values popup control + * These values are not same as slider's range + */ + void SetMinAndMaxValues( TInt aMax, TInt aMin ); + + /* + * Set adjust range of the slider + */ + void SetAdjustRange( TInt aMinimumValue, TInt aMaximumValue, + TInt aStepCount ); + + /** + * Set value type for vertical slider control + */ + void SetValueType( TInt aValueType ); + + /** + * Shows popup. + */ + void ShowPopupL(); + + /** + * Opens popup. + */ + void OpenPopupL(); + + /** + * Closes popup + */ + void ClosePopup(); + + /** + * Set time out time in seconds + */ + void SetTimeOut( TInt aTime ); + + /** + * Checks whether popup is visible + */ + TBool IsPopUpVisible(); + +protected: + + /** + * Constructor + */ + CVtUiPopupBase( MVtUiComponentManager& aComponentManager, + TVtUiBlockListBitField aBitField, TComponentId aComponentId ); + + /** + * 2nd constructor + */ + void BaseConstructL(); + +private: + + /** + * Position of the popup + */ + TPoint PopupPosition() const; + + /** + * Sets popup controls's value + */ + void SetPopupValue( TInt aValue ); + +protected: // Set in child constructor + + // Reference to component manager + MVtUiComponentManager& iComponentManager; + + // Component state + TVtUiBaseComponentState iComponentState; + + // Component id + TComponentId iComponentId; + +private: + + // class for slider handling + CAknVolumePopup* iPopup; + + // Interface for component state observing + MVtUiComponentStateObserver* iCompStateObserver; + + // Maximum value + TInt iMax; + + // Minimum value + TInt iMin; + + // Number of steps + TInt iStepCount; + + // Time out for showing popup + TInt iTimeOutTime; + + // Scaling constant + TInt iScalingConstant; + + }; + +#endif // CVTUIPEFSLIDERBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/sliders/cvtuisliderbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/sliders/cvtuisliderbase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2007 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: Base class for video telephone sliders +* +*/ + + +#ifndef C_VTUISLIDERBASE_H +#define C_VTUISLIDERBASE_H + +#include "cvtuifeaturebase.h" +#include "mvtuicomponent.h" +#include "mvtuicomponentstateobserver.h" + +class CVtUiPopupBase; + +/** +* CVtUiSliderBase +* +* Base class for vide telephone sliders +* +* @since S60 v3.2 +*/ +class CVtUiSliderBase : public CVtUiFeatureBase, public MVtUiComponentStateObserver + { + +public: + + /** + * Destructor + */ + ~CVtUiSliderBase(); + + /** + * update slider itself + */ + void UpdateSlider(); + +public: // from MVtUiFeature + + /** + * @see MVtUiFeature::StartL + */ + void StartL(); + + /** + * @see MVtUiFeature::Stop + */ + void Stop(); + + /** + * @see MVtUiFeature::InitFeatureL + */ + void InitFeatureL(); + +public: // from MVtUiComponentStateObserver + + /** + * @see MVtUiComponentStateObserver::ComponenStateChangedL + */ + virtual void ComponenStateChangedL(); + + /** + * @see CVtUiPopupBase::SetPermanenVisibility + */ + void SetPermanenVisibility( TBool aPermanent ); + +protected: + + /* + * Constructor + */ + CVtUiSliderBase( CVtUiFeatureManager& aFeatureManager, + TVtUiFeatureId aFeatureId ); + + /** + * 2nd constructor + */ + void ConstructL(); + + /** + * Sets popup pointer. + */ + void SetPopup( CVtUiPopupBase* aPopup ); + + /** + * Gets popup reference. + */ + CVtUiPopupBase& Popup(); + + /** + * Gets popup const reference. + */ + const CVtUiPopupBase& Popup() const; + +private: + + // pop up base + CVtUiPopupBase* iPopup; + + }; + +#endif // CVTUIPEFSLIDERBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/sliders/mvtuicomponentstateobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/sliders/mvtuicomponentstateobserver.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2007 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: Observer API for popup based controls +* +*/ + + +#ifndef M_VTUICOMPONENTSTATEOBSERVER_H +#define M_VTUICOMPONENTSTATEOBSERVER_H + +/** +* MVtUiComponentStateObserver +* +* Observer API for popup based controls +* +* @since S60 v3.2 +*/ +class MVtUiComponentStateObserver + { + +public: + + /** + * Called when component state changes + */ + virtual void ComponenStateChangedL() = 0; + + }; + +#endif // M_VTUICOMPONENTSTATEOBSERVER_H \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/tvtuiappstatebase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/tvtuiappstatebase.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,256 @@ +/* +* Copyright (c) 2007 - 2008 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: Base class for application states. +* +*/ + + +#ifndef T_VTUIAPPSTATEBASE_H +#define T_VTUIAPPSTATEBASE_H + +#include +#include +#include "mvtuistatecontext.h" +#include "mvtuishutterobserver.h" +#include "tvtuistates.h" + +/** +* Base class for application states related to application startup, normal +* operation and shutdown. AppUi delegates decision making by forwarding +* events/commands it receives to current state. +* Not all event handlers declared by the base class are applicable in +* all concrete states. All methods returning TEventResponse imply that it may +* consume the event completely and caller should not process it further. +* +* It should be kept in mind that as new functionality is added to application, +* state classes may need changes if e.g. handling of specific event should be +* allowed in appUi. By default event handler in specific state may consume all +* events. Note that in this context e.g. HandleCommandL is considered as an +* event handler. +* +* @since S60 v3.2 +*/ +class TVtUiAppStateBase : public MVtUiShutterObserver + { +public: // new functions + + /** + * Return value from state's event handlers. + */ + enum TEventResponse + { + /** Event was handled by a state and should + * not be further processed by caller. + */ + EEventHandled, + /** Event can be handled by caller. */ + EEventNotHandled + }; + + /** + * Performs state dependent actions when phase 1 of + * startup is completed. + */ + virtual void AppUiStartupPhase1DoneL(); + + /** + * Performs state dependent actions when startup fails. + */ + virtual void AppUiStartupFailedL(); + + /** + * Performs state dependent actions when phase 2 of + * startup is completed. + */ + virtual void AppUiStartupPhase2DoneL(); + + /** + * Handles completion of shutdown. + */ + virtual void ShutdownDoneL(); + + /** + * Handles completion of an VT engine command. + * @param aCommand completed command + * @param aError error + * @return event response, is caller allowed to handle event + */ + virtual TEventResponse HandleVTCommandPerformedL( + const TVtEngCommandId aCommand, + const TInt aError ); + + /** + * Handles event from the engine. + * @param aEvent + * @return event response, is caller allowed to handle event + */ + virtual TEventResponse HandleVtEventL( const TInt aEvent ); + + /** + * Handles command from the user (or application framework). + * @param aCommand + * @return event response, is caller allowed to handle event + */ + virtual TEventResponse HandleCommandL( const TInt aCommand ); + + /** + * Performs state dependent actions for foreground change event. + * @param aIsForeground foreground status passed from UI framework + * @return ETrue if application should behave as in foreground + */ + virtual TBool HandleForegroundChangedL( const TBool aIsForeground ); + + /** + * Performs state dependent previous actions for foreground change event. + * @param aIsForeground foreground status passed from UI framework + * @return ETrue if application should behave as in foreground + */ + virtual TBool PreHandleForegroundChangedL( const TBool aIsForeground ); + /** + * Performs state dependent actions for layout change. + */ + virtual void HandleLayoutChangedL(); + + /** + * Sends DTMF tone if allowed by current state. + * @param aTone DTMF tone to send + */ + virtual void StartDtmfTone( const TChar& aTone ); + + /** + * Stops DTMF tone if allowed by current state. + */ + virtual void StopDtmfTone(); + + /** + * Sets initial application state. + * @param aCtx state context providing services to states + * @param aUiStates ui states + */ + static void SetInitialStateL( + MVtUiStateContext& aCtx, + TVtUiStates& aUiStates); + + /** + * Get whether the shutdown requested + * @return ETrue if shutdown requested + */ + static TBool ShutdownRequested(); + +protected: // for concrete state classes + + /** + * Destructor, for cleanup. + */ + virtual ~TVtUiAppStateBase(); + + /** + * Performs entry action for a state. + */ + virtual void OpenL(); + + /** + * Performs exit action for a state and deletes that state. + */ + virtual void Close(); + + /** + * Sets current state. + */ + void ChangeStateL( TVtUiAppStateBase& aNewState ); + + /** + * Sets transition to resetting state as cleanup item. + */ + void CleanupResetPushL(); + + /** + * Starts shutdown when leave occurred. + */ + static void TransitionToReset( TAny* aAny ); + + + /** + * Ends the call if necessary and starts shutdown. + * @return ETrue if shutdown started. + */ + TBool CheckEndActiveCallL(); + + /** + * Returns engine session state. + * @param aUpdate is state forced to update + * @return session state + */ + MVtEngSessionInfo::TSessionState SessionState( + const TBool aUpdate ) const; + + /** + * Sets forced lights state in the system. + */ + void SetLightsState( const TBool aOn ); + + /** + * Delegates engine command execution to the state context. + */ + template < typename T > + inline void ExecuteEngineCommand( + TInt aCommand, T& aParam ); + + /** + * Sets execution state. + */ + void SetExecState( const TVtUiStates::TVtUiExecState aState ); + +protected: // constructor + + // c++ constructor + TVtUiAppStateBase( MVtUiStateContext& aCtx, TVtUiStates& aUiStates ); + +private: // from MVtUiShutterObserver + + /** + * Handles 'shutdown ready' event. + */ + virtual void HandleShutdownReady(); + +private: // new functions + + /** + * Updates applications lock state and sends to background if + * the device is locked. + */ + void HandleDeviceLockEventL( const TBool aDeviceIsLocked ); + +protected: // data members + + // Context providing services to states + MVtUiStateContext& iCtx; + + // Various application specific state information + TVtUiStates& iUiStates; + + /** Prevents sending end call command to call handling if ETrue. + * It is not allowed when call clearing is network originated. + */ + + /** + * shutdown request received + */ + static TBool iShutdownRequested; + + }; + +#include "tvtuiappstatebase.inl" + +#endif // T_VTUIAPPSTATEBASE_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/tvtuiappstatebase.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/tvtuiappstatebase.inl Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 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: Base class for application states. +* +*/ + + +template < typename T > +inline void TVtUiAppStateBase::ExecuteEngineCommand( + TInt aCommand, T& aParam ) + { + TPtrC8 params( reinterpret_cast< TUint8* >( &aParam ), + sizeof( T ) ); + TRAP_IGNORE( iCtx.DoExecuteCmdL( aCommand, ¶ms ) ); + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/tvtuiappstates.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/tvtuiappstates.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,274 @@ +/* +* Copyright (c) 2007 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: Concrete application state classes +* +*/ + + +#ifndef T_VTUIAPPSTATES_H +#define T_VTUIAPPSTATES_H + +#include "tvtuiappstatebase.h" +#include +#include + +class CAknQueryDialog; + +/** +* Initial application state. Responsible for startup phase 1 and +* startup phase 2 (see EVtUiAppUiStartup in CVtUiAppUi.cpp). +* Certain other state changes are required for phase 2 and history +* of their reception is handled with precondition flags. +* +* @since S60 v3.2 +*/ +class TVtUiStateStarting : public TVtUiAppStateBase + { +public: + /** + * returns singleton instance of TVtUiStateStarting + * @param aCtx state context + * @param aUiStates UI states + * @return singleton + */ + static TVtUiStateStarting* InstanceL( + MVtUiStateContext& aCtx, + TVtUiStates& aUiStates ); + +public: // from TVtUiAppStateBase + + /** @see TVtUiAppStateBase */ + virtual void AppUiStartupPhase1DoneL(); + + /** @see TVtUiAppStateBase */ + virtual void AppUiStartupPhase2DoneL(); + + /** @see TVtUiAppStateBase */ + virtual TEventResponse HandleVtEventL( TInt aEvent ); + + /** @see TVtUiAppStateBase */ + virtual TEventResponse HandleCommandL( const TInt aCommand ); + + /** @see TVtUiAppStateBase */ + virtual TBool HandleForegroundChangedL( TBool aIsForeground ); + +private: // from TVtUiAppStateBase + + /** @see TVtUiAppStateBase */ + virtual void OpenL(); + + /** @see TVtUiAppStateBase */ + virtual void Close(); + +private: // new methods + + void CheckSessionStateL(); + static TInt AsynchOpen( TAny* aAny ); + + void DoOpenL(); + + /** Preconditions that must be passed in order to proceed + * to Phase 2 in startup. + */ + enum TPreconditions + { + /** waiting for CLI from engine*/ + EWaitingCLI, + /** waiting for phase1 to complete */ + EWaitingPhase1ToComplete, + /** waiting for engine to get proper state */ + EWaitingSessionState + }; + + /** + * Clears precondition passed as argument and checks if any + * preconditions hold and if not proceeds to phase 2 of startup. + */ + void CheckPhase2StartupL( const TPreconditions aClearCondition ); + + void HandleCLIReceivedL(); + +private: // constructors and destructors + + // c++ constructor + TVtUiStateStarting( + MVtUiStateContext& aCtx, + TVtUiStates& aUiStates ); + + // Destructor + virtual ~TVtUiStateStarting(); + +private: // data members + + // Precondition for state change to running + TBitFlags8 iPreconditions; + + // Singleton + static TVtUiStateStarting* iInstance; + + // Starts phase1 startup in state state context. Needed because + // initial state is opened from within state context construction. + CAsyncCallBack* iStartCallback; + }; + +/** +* Application state that is active in normal operation. +* +* @since S60 v3.2 +*/ +class TVtUiStateRunning : public TVtUiAppStateBase + { +public: + /** + * returns singleton instance of TVtUiStateRunning + * @param aCtx state context + * @param aUiStates UI states + * @return singleton + */ + static TVtUiStateRunning* InstanceL( + MVtUiStateContext& aCtx, + TVtUiStates& aUiStates ); + +public: // from TVtUiAppStateBase + + /** @see TVtUiAppStateBase */ + virtual TEventResponse HandleVtEventL( TInt aEvent ); + + /** @see TVtUiAppStateBase */ + virtual TEventResponse HandleCommandL( const TInt aCommand ); + + /** @see TVtUiAppStateBase */ + virtual TBool HandleForegroundChangedL( TBool aIsForeground ); + + /** @see TVtUiAppStateBase */ + virtual TBool PreHandleForegroundChangedL( TBool aIsForeground ); + /** @see TVtUiAppStateBase */ + virtual void HandleLayoutChangedL(); + + /** @see TVtUiAppStateBase */ + virtual void StartDtmfTone( const TChar& aTone ); + + /** @see TVtUiAppStateBase */ + virtual void StopDtmfTone(); + + /** @see TVtUiAppStateBase */ + virtual void OpenL(); + +private: // from TVtUiAppStateBase + /** @see TVtUiAppStateBase */ + virtual void Close(); + +private: // constructors and destructors + + // c++ constructor + TVtUiStateRunning( + MVtUiStateContext& aCtx, + TVtUiStates& aUiStates ); + + // Destructor + virtual ~TVtUiStateRunning(); + +private: // new functions + + /** Requests call handling subsystem to initiate a voice call. + * Starts shutdown of the application. + */ + void CreateVoiceCallL(); + + /** Dials emergency call and starts shutdown */ + void DialEmergencyCallL(); + + void ShutdownWithEngineCommandL( const TInt aCommand ); + +private: // data members + // singleton + static TVtUiStateRunning* iInstance; + // Create voice call query instance + CAknQueryDialog* iCreateVoiceCallDlg; + }; + +/** +* Application state that is active during shutdown. +* +* @since S60 v3.2 +*/ +class TVtUiStateResetting : public TVtUiAppStateBase + { +public: + /** + * returns singleton instance of TVtUiStateResetting + * @param aCtx state context + * @param aUiStates UI states + * @param aCommand engine command to send when resetting state activates + * @return singleton + */ + static TVtUiStateResetting* InstanceL( + MVtUiStateContext& aCtx, + TVtUiStates& aUiStates, + const TVtEngCommandId aCommand = KVtEngCommandNone ); + +public: // from TVtUiAppStateBase + + /** @see TVtUiAppStateBase */ + virtual void AppUiStartupFailedL(); + + /** @see TVtUiAppStateBase */ + virtual void ShutdownDoneL(); + + /** @see TVtUiAppStateBase */ + virtual TEventResponse HandleVTCommandPerformedL( + TVtEngCommandId aCommand, + const TInt aError ); + + /** @see TVtUiAppStateBase */ + virtual TEventResponse HandleVtEventL( TInt aEvent ); + + /** @see TVtUiAppStateBase */ + virtual TEventResponse HandleCommandL( const TInt aCommand ); + + /** @see TVtUiAppStateBase */ + virtual TBool HandleForegroundChangedL( TBool aIsForeground ); + + /** @see TVtUiAppStateBase */ + virtual void HandleLayoutChangedL(); + +private: // from TVtUiAppStateBase + + /** @see TVtUiAppStateBase */ + virtual void OpenL(); + + /** @see TVtUiAppStateBase */ + virtual void Close(); + +private: // constructors and destructors + + // c++ constructor + TVtUiStateResetting( + MVtUiStateContext& aCtx, + TVtUiStates& aUiStates, + const TVtEngCommandId aCommand = KVtEngCommandNone ); + + // Destructor + virtual ~TVtUiStateResetting(); + +private: // data members + + // Singleton + static TVtUiStateResetting* iInstance; + + // Used in user originated shutdown (end active call/switch to voice) + TVtEngCommandId iCommand; + }; + +#endif // T_VTUIAPPSTATES_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/tvtuiwsevent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/tvtuiwsevent.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2006 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: VT UI window server event definition. +* +*/ + + +#ifndef T_VTUIWSEVENT_H +#define T_VTUIWSEVENT_H + +#include + +/** + * TVtUiWsEvent + * + * VT UI WS event code enumerations. Name 'code' used instead of 'type' to keep + * naming consistent with with window server. + */ +enum TVtUiWsEventCodes + { + // New number source activated + EVtUiWsEventNumberSourceActivate = EEventUser + 6000, + // Number source deactivated + EVtUiWsEventNumberSourceDeactivate, + // Enter rendering mode + EVtUiWsEventBeginRenderingMode, + // Leave rendering mode + EVtUiWsEventEndRenderingMode + }; + +/** + * TVtUiWsEvent + * + * Base class for VT UI ws events + * + * @since S60 v3.2 + */ +template < class T > +class TVtUiWsEvent : public TWsEvent + { + +public: + + /** + * Constructor + * + * @param aType Event type @see TVtUiWsEventCodes. + */ + inline TVtUiWsEvent( TInt aType, T* aData ); + + /** + * Return data contained in this event. + */ + inline T* Data() const; + + }; + +#include "tvtuiwsevent.inl" + +#endif // T_VTUIWSEVENT_H diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/tvtuiwsevent.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/tvtuiwsevent.inl Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2006 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: VT UI window server event inline methods. +* +*/ + + +// ----------------------------------------------------------------------------- +// TVtUiWsEvent::TVtUiWsEvent +// ----------------------------------------------------------------------------- +// +template < class T > +TVtUiWsEvent< T >::TVtUiWsEvent( TInt aType, T* aData ) + { + SetType( aType ); + Int()[ 0 ] = ( TInt ) aData; + } + +// ----------------------------------------------------------------------------- +// TVtUiWsEvent::Data +// ----------------------------------------------------------------------------- +// +template < class T > +T* TVtUiWsEvent< T >::Data() const + { + return ( T* )Int()[ 0 ]; + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/videotelui.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/videotelui.hrh Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2004-2006 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: Header for constants. +* +*/ + + +#ifndef VIDEOTELUI_HRH +#define VIDEOTELUI_HRH + +// CONSTANTS + +// Video Telephone application UID. +#define KVtUiAppUidValue 0x101F8681 + +// Enumerates commands +enum + { + // Enable submenu + EVtUiCmdEnableMain = 5000, + // Enable video + EVtUiCmdEnableVideo, //5001 + // Enable audio + EVtUiCmdEnableAudio, //5002 + // Enable both video and audio + EVtUiCmdEnableBoth, //5003 + // Disable submenu + EVtUiCmdDisableMain, //5004 + // Disable video + EVtUiCmdDisableVideo, //5005 + // Disable audio + EVtUiCmdDisableAudio, //5006 + // Disable both video and audio + EVtUiCmdDisableBoth, //5007 + // Deactivate BT handsfree + EVtUiCmdDeactivateBT, //5008 + // Deactivet BT and activate HF (used in toolbar) + EVtUiCmdSwitchFromBTToIHF, //5009 + // Activate BT handsfree + EVtUiCmdActivateBT, //5010 + // Activate loudspeaker + EVtUiCmdActivateLoudspeaker, //5011 + // Deactivate loudspeaker + EVtUiCmdDeactivateLoudspeaker, //5012 + // End active call + EVtUiCmdEndActiveCall, //5013 + // Use primary camera + EVtUiCmdUsePrimaryCamera, //5014 + // Use secondary camera + EVtUiCmdUseSecondaryCamera, //5015 + // Swap images' places + EVtUiCmdSwapImagesPlaces, //5016 + // Zoom + EVtUiCmdZoom, //5017 + // Send DTMF + EVtUiCmdSendDTMF, //5018 + // Switch to voice call + EVtUiCmdCreateVoice, //5019 + // Enable capture mode + EVtUiCmdSnapshot, //5020 + // Freeze outgoing video + EVtUiCmdCapture, //5021 + // Disable capture mode + EVtUiCmdCancelCapture, //5022 + // Go to Idle. + EVtUiCmdGoToIdle, //5023 + // Other items + EVtUiCmdOkOptions = 6000, + // Dial emergency + EVtUiCmdDialEmergency, + // Share object image + EVtUiCmdShareObjectImage = 6100, + // Share object video clip + EVtUiCmdShareObjectVideoClip, //6101 + // Stop sharing image object + EVtUiCmdStopSharingObjectImage, //6102 + // Stop sharing video clip object + EVtUiCmdStopSharingObjectVideoClip, //6103 + // Activates zoom mode + EVtUiCmdToolbarActivateZoomMode, //6104 + // Toggles disable video/ enable video + EVtUiCmdToolbarToggleVideo, //6105 + // Toggles mute audio/ unmute audi + EVtUiCmdToolbarToggleMicrophone, //6106 + // Changes audio routing + EVtUiCmdToolbarAudioRouting, //6107 + // Toggles primary/secondary camera + EVtUiCmdToolbarToggleCamera, //6108 + // Adjust video submenu + EVtUiCmdAdjustVideo, //6109 + // Adjust video preferences + EVtUiCmdAdjustVideoVideoQuality, //6110 + // Adjust video white balance + EVtUiCmdAdjustVideoWhiteBalance, //6111 + // Adjust video brightness + EVtUiCmdAdjustVideoBrightness, //6112 + // Adjust video contrast + EVtUiCmdAdjustVideoContrast, //6113 + // Adjust video colour tone + EVtUiCmdAdjustVideoColourTone, //6114 + // Dialer close + EVtUiDialerExit, //6115 + // Dialer emergency call + EVtUiCmdDialerEmergencyCall //6116 + }; + +// Enumerates bitmap identifiers +enum TVtUiBitmapId + { + // Reserved to indicate no bitmap. + EVtUiBitmapNone, + // Viewfinder background. + EVtUiBitmap_qgn_graf_call_video_out_bg, + // Viewfinder background mask. + EVtUiBitmap_qgn_graf_call_video_out_bg_mask, + // Blind in icon. + 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. + EVtUiBitmap_qgn_indi_earpiece_mask, + // Loudspeaker icon. + EVtUiBitmap_qgn_indi_speaker, + // Loudspeaker icon mask. + EVtUiBitmap_qgn_indi_speaker_mask, + // Zoom area mask. + EVtUiBitmap_qgn_graf_zoom_area, + // Zoom direction bitmap. + EVtUiBitmap_qgn_indi_zoom_dir, + // Zoom direction bitmap mask. + EVtUiBitmap_qgn_indi_zoom_dir_mask, + // Zoom area minimum icon. + EVtUiBitmap_qgn_indi_zoom_min, + // Zoom area maximum icon. + EVtUiBitmap_qgn_indi_zoom_max, + // Scalable blind in icon soft mask, + EVtUiBitmap_qgn_indi_call_video_blind_in_mask_icon, + // Scalable blind out icon soft mask, + EVtUiBitmap_qgn_indi_call_video_blind_out_mask_icon, + // Current active list item indicator + EVtUiBitmap_qgn_prop_sub_current, + // Current active list item indicator mask + EVtUiBitmap_qgn_prop_sub_current_mask + }; + +#endif // VIDEOTELUI_HRH + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/loc/videotelui.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/loc/videotelui.loc Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,407 @@ +/* +* Copyright (c) 2004 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: Localisation texts for Video Telephone application. +* +*/ + + +// LOCALISATION STRINGS + +// d: Text shown in fast swap window while there is active video call. +// l: cell_app_pane_t1 +// r: 2.6 +// +#define qtn_apps_videophone_grid "Video tel" + +// d: It is text for menu option. If it is selected, +// d: then submenu is opened containing Video / Audio / Both +// d: items. +// l: list_single_pane_t1_cp2/opt3 +// r: 2.6 +// +#define qtn_incal_enable_main_option "Enable" + +// d: It is text for submenu option. It enables / disables +// d: video. +// l: list_single_popup_submenu_pane_t1 +// r: 2.6 +// +#define qtn_incal_change_video_option "Video" + +// d: It is text for submenu option. It enables / disables +// d: audio. +// l: list_single_popup_submenu_pane_t1 +// r: 2.6 +// +#define qtn_incal_change_audio_option "Audio" + +// d: It is text for submenu option. It enables / disables +// d: both audio and video. +// l: list_single_popup_submenu_pane_t1 +// r: 2.6 +// +#define qtn_incal_change_both_option "Both" + +// d: It is text for menu option. If it is selected, +// d: then submenu is opened containing Video / Audio / Both +// d: items. +// l: list_single_pane_t1_cp2/opt3 +// r: 2.6 +// +#define qtn_incal_disable_main_option "Disable" + +// d: It is text for menu option. If it is selected, +// d: then zoom mode is activated. +// l: list_single_pane_t1_cp2 +// r: 2.6 +// +#define qtn_incal_zoom_own_video "Zoom" + +// d: It is the prompt in confirmation query shown when +// d: incoming video call is answered. +// l: popup_note_window +// r: 3.2 +// +#define qtn_incal_send_video_image "Allow video image?" + +// d: It is text for options menu list item. +// d: It opens touch input window for sending DTMF tones +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_send_dtmf_tone_option "Activate keypad" + +// d: It it text shown in title pane during active +// d: video call. %N is replaced with call index. +// l: title_pane_t2/opt9 +// r: 2.6 +// +#define qtn_call_number_video "Call %N" + +// d: It is text shown in main pane until the first image +// d: is received. +// l: main_list_empty_pane +// r: 2.6 +// +#define qtn_incal_waiting_image "Waiting image..." + +// d: It is text shown in a note when video call is +// d: answered and camera activation fails, because +// d: camera is in use in other application. +// l: popup_note_window +// r: 2.6 +// +#define qtn_incal_close_camcorder "Camera already in use an other application." + +// d: It is text in softkey to enable audio (unmute microphone). +// l: control_pane_t1/opt7 +// r: 2.6 +// +#define qtn_incal_softk_enable_audio "Enable audio" + +// d: It is text for menu option. If it is selected, +// d: then swaps locations of uplink and downlink +// d: video streams. +// l: list_single_pane_t1_cp2 +// r: 2.8 +// +#define qtn_incal_swap_vt_images "Swap images' places" + +// d: It is text shown in a note when "use primary +// d: camera" or "use secondary camera" operations fails. +// l: popup_note_window +// r: 2.6 +// +#define qtn_err_cam_swap "Other camera wasn't usable" + +// d: It is text for menu option. If it is selected, +// d: then new softkeys are now Capture and Cancel. +// l: list_single_pane_t1_cp2 +// r: 3.1 +// +#define qtn_incal_snapshot_option "Snapshot" + +// d: It is text for right softkey in freeze mode. +// l: control_pane_t1/opt7 +// r: 3.1 +// +#define qtn_softk_capture "Capture" + +// d: It is text for switch +// d: to voice query dialog. +// l: popup_note_window +// r: 3.1 +#define qtn_query_create_voice_call "End active call and create voice call to the same contact?" + +// d: It is text for menu option. +// d: It switches video to voice call. +// l: list_single_pane_t1_cp2 +// r: 3.1 +#define qtn_incal_video_to_voice "Switch to voice call" + +// d: It is text for menu option. +// d: It opens dialog for selecting image to be shared with peer. +// l: list_single_pane_t1_cp2 +// r: 3.1 +#define qtn_incal_video_call_share_file "Share file" + +// d: It is text for softkey option. +// d: It stops sending selected image to peer. +// l: control_pane_t1/opt7 +// r: 3.1 +#define qtn_softk_disable_share "Disable share" + +//d: Error note text when user selects image that cannot be opened. +//d: Corrupted or unsupported image selected. +//l: popup_note_window +//r:3.1 +// +#define qtn_tel_info_unable_open_image "Unable to open image" + +//d: Error note text when user selects multiframe image that is corrupted. +//d: Corrupted image selected. +//l: popup_note_window +//r: 5.0 +// +#define qtn_incal_note_decoding_failed "Unable to animate image" + +//d: Error note text when user selects a DRM protected image. +//d: DRM protected media gallery object selected. +//l: popup_note_window +//r:3.1 +// +#define qtn_drm_not_allowed "Unable to select protected objects" + +//d: Text for image initializing wait note +//d: Shown when image to be shared is being initialized. +//l: popup_note_wait_window +//r:3.1 +// +#define qtn_vt_progress_decoding_image "Decoding image" + +//d: Toolbar tooltip for disable video. +//l: popup_preview_text_window_t1 +//r:3.2 +// +#define qtn_vt_tooltip_disable_video "Disable video sending" + +//d: Toolbar tooltip for enable video. +//l: popup_preview_text_window_t1 +//r:3.2 +// +#define qtn_vt_tooltip_enable_video "Enable video sending" + + +//d: Toolbar tooltip for mute microphone. +//l: popup_preview_text_window_t1 +//r:3.2 +// +#define qtn_vt_tooltip_mute_microphone "Mute microphone" + +//d: Toolbar tooltip for unmute microphone. +//l: popup_preview_text_window_t1 +//r:3.2 +// +#define qtn_vt_tooltip_unmute_microphone "Unmute microphone" + +//d: Toolbar tooltip for swap images. +//l: popup_preview_text_window_t1 +//r:3.2 +// +#define qtn_vt_tooltip_swap_images "Change image order" + +//d: Toolbar tooltip for secondary camera. +//l: popup_preview_text_window_t1 +//r:3.2 +// +#define qtn_vt_tooltip_secondary_cam "Use secondary camera" + +//d: Toolbar tooltip for primary camera. +//l: popup_preview_text_window_t1 +//r:3.2 +// +#define qtn_vt_tooltip_primary_cam "Use primary camera" + +//d: Toolbar tooltip for zoom. +//l: popup_preview_text_window_t1 +//r:3.2 +// +#define qtn_vt_tooltip_zoom "Activate zoom mode" + +//d: Toolbar tooltip for share. +//l: popup_preview_text_window_t1 +//r:3.2 +// +#define qtn_vt_tooltip_share "Share file" + +//d: Toolbar tooltip for send snapshot. +//l: popup_preview_text_window_t1 +//r:3.2 +// +#define qtn_vt_tooltip_send_snapshot "Send snapshot" + +// d: It is text for menu option. +// d: It opens submenu with Received video quality / White balance / +// d: Brightness / Contrast / Colour tone +// l: list_single_pane_t1_cp2/opt3 +// r: 5.0 +#define qtn_incal_video_adjust_option "Adjust video" + +// d: It is text for submenu option. +// d: It opens list query dialog with options Normal / Details / Motion. +// l: list_single_popup_submenu_pane_t1 +// r: 5.0 +#define qtn_incal_video_prefer_option "Received video quality" + +// d: It is text for list query option. +// d: It adjusts incoming video frame rate to 10 frames per second. +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_normal_list_option "Normal" + +// d: It is text for list query option. +// d: It adjusts incoming video frame rate to 5 frames per second. +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_details_list_option "Details" + +// d: It is text for list query option. +// d: It adjusts incoming video frame rate to 15 frames per second. +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_motion_list_option "Motion" + +// d: It is text for submenu option. +// d: It opens list query dialog with options Automatic / Sunny / Cloudy / +// d: Incandescent / Fluorescent +// l: list_single_popup_submenu_pane_t1 +// r: 5.0 +#define qtn_incal_video_white_balance_option "White balance" + +// d: It is text for list query option. +// d: It adjusts incoming video frame rate to 15 frames per second. +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_automatic_option "Automatic" + +// d: It is text for list query option. +// d: It adjusts white balance of outgoing video. +// d: It sets white balance to Sunny. +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_sunny_option "Sunny" + +// d: It is text for list query option. +// d: It adjusts white balance of outgoing video. +// d: It sets white balance to Cloudy. +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_cloudy_option "Cloudy" + +// d: It is text for list query option. +// d: It adjusts white balance of outgoing video. +// d: It sets white balance to Incandescent. +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_incandescent_option "Incandescent" + +// d: It is text for list query option. +// d: It adjusts white balance of outgoing video. +// d: It sets white balance to Fluorescent. +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_fluorescent_option "Fluorescent" + +// d: It is text for submenu option. +// d: It shows control for adjusting outgoing video Brightness. +// l: list_single_popup_submenu_pane_t1 +// r: 5.0 +#define qtn_incal_video_brightness_option "Brightness" + +// d: It is text for submenu option. +// d: It shows control for adjusting outgoing video Contrast. +// l: list_single_popup_submenu_pane_t1 +// r: 5.0 +#define qtn_incal_video_contrast_option "Contrast" + +// d: It is text for submenu option. +// d: It opens list query dialog with options Normal / Sepia / +// d: Black and white / Negative +// l: list_single_popup_submenu_pane_t1 +// r: 5.0 +#define qtn_incal_video_colour_tone_option "Colour tone" + +// d: It is text for list query option. +// d: It adjusts colour tone of outgoing video. +// d: It sets colour tone to Normal. +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_ct_normal_option "Normal" + +// d: It is text for list query option. +// d: It adjusts colour tone of outgoing video. +// d: It sets colour tone to Sepia. +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_sepia_option "Sepia" + +// d: It is text for list query option. +// d: It adjusts colour tone of outgoing video. +// d: It sets colour tone to Black and white. +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_b_and_w_option "Black and white" + +// d: It is text for list query option. +// d: It adjusts colour tone of outgoing video. +// d: It sets colour tone to Negative. +// l: list_single_pane_t1_cp2 +// r: 5.0 +#define qtn_incal_negative_option "Negative" + +// d: Toolbar tooltip for changing audio routing to handset. +// l: popup_preview_text_window_t1 +// r: 5.0 +// +#define qtn_vt_tooltip_audio_handset "Audio to handset" + +// d: Toolbar tooltip for changing audio routing to loudspeaker. +// l: popup_preview_text_window_t1 +// r: 5.0 +// +#define qtn_vt_tooltip_audio_loudspeaker "Audio to loudspeaker" + +// d: Toolbar tooltip for changing audio routing to bluetooth handsfree. +// l: popup_preview_text_window_t1 +// r: 5.0 +// +#define qtn_vt_tooltip_audio_bthf "Audio to Bluetooth handsfree" + +// d: It is text in softkey to open dialer (for dtmf sending). +// l: control_pane_t1/opt7 +// r: 5.0 +// +#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" + +// d: It is text in softkey to make emergency call. +// l: control_pane_t1/opt7 +// r: 5.0 +// +#define qtn_incal_softk_emergency_call "Emerg. Call" +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/rom/videotelui.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/rom/videotelui.iby Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2004-2007 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: IBY file + * +*/ + + +#ifndef __VIDEOTELUI_IBY__ +#define __VIDEOTELUI_IBY__ + +REM Video Telephone application + +#ifdef __CS_VIDEO_TELEPHONY + +S60_APP_EXE(videotelui) +S60_APP_AIF_ICONS(videotelui) +S60_APP_BITMAP(videotelui) + +// Enabler for eclipsing ROM binaries +data=ZSYSTEM\install\videotelui_stub.sis system\install\videotelui_stub.sis +data=ZPRIVATE\10003a3f\apps\videotelui_reg.rsc private\10003a3f\import\apps\videotelui_reg.rsc + +#if defined ( RD_VT_RTF ) + +data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\VtStartRecord.wav System\sounds\digital\VtStartRecord.wav +data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\VtStopRecord.wav System\sounds\digital\VtStopRecord.wav + +#endif //RD_VT_RTF +#endif // __CS_VIDEO_TELEPHONY +#endif diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/rom/videoteluiResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/rom/videoteluiResources.iby Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2004-2005 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: IBY file + * +*/ + + +#ifndef __VIDEOTELUI_RESOURCES_IBY__ +#define __VIDEOTELUI_RESOURCES_IBY__ + +#ifdef __CS_VIDEO_TELEPHONY +data=DATAZ_\APP_RESOURCE_DIR\videotelui.rsc APP_RESOURCE_DIR\videotelui.rsc +#endif // __CS_VIDEO_TELEPHONY + +#endif \ No newline at end of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiActivateBtHfDialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiActivateBtHfDialog.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2004-2006 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: Implementation of the CVtUiActivateBtHfDialog class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiActivateBtHfDialog.h" +#include "MVtUiEngineCommandManager.h" +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiActivateBtHfDialog::CVtUiActivateBtHfDialog +// ----------------------------------------------------------------------------- +// +CVtUiActivateBtHfDialog::CVtUiActivateBtHfDialog( + CEikDialog** aSelfPtr, + TInt* aError, + MVtEngCommandHandler& aCommandHandler, + MVtUiEngineCommandManager& aCommandManager ) + : CAknWaitDialog( aSelfPtr ), + iCommandHandler( aCommandHandler ), + iCommandManager( aCommandManager ), + iError( aError ), + iAudioRouting( MVtEngAudio::EActivateBT ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiActivateBtHfDialog::~CVtUiActivateBtHfDialog +// ----------------------------------------------------------------------------- +// +CVtUiActivateBtHfDialog::~CVtUiActivateBtHfDialog() + { + if ( iError ) + { + *iError = KErrCancel; + iError = NULL; + } + + if ( iCommandPerformed ) + { + iCommandHandler.CancelCommand( KVtEngSetAudioRouting ); // ignore error + } + iCommandManager.RemoveObserver( *this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiActivateBtHfDialog::ExecuteDialogLD +// ----------------------------------------------------------------------------- +// +void CVtUiActivateBtHfDialog::ExecuteDialogLD() + { + CleanupStack::PushL( this ); + iCommandManager.AddObserverL( *this ); + SetTone( CAknNoteDialog::ENoTone ); + CleanupStack::Pop( this ); + + ExecuteLD( R_VIDEOTELUI_BTHF_CONNECT_WAIT_NOTE ); + } + +// ----------------------------------------------------------------------------- +// CVtUiActivateBtHfDialog::PostLayoutDynInitL +// ----------------------------------------------------------------------------- +// +void CVtUiActivateBtHfDialog::PostLayoutDynInitL() + { + iCommandHandler.ExecuteL( KVtEngSetAudioRouting, &iAudioRouting ); + iCommandPerformed = ETrue; + + CAknWaitDialog::PostLayoutDynInitL(); + } + +// ----------------------------------------------------------------------------- +// CVtUiActivateBtHfDialog::HandleVTCommandPerformedL +// ----------------------------------------------------------------------------- +// +void CVtUiActivateBtHfDialog::HandleVTCommandPerformedL( + TVtEngCommandId aCommand, + const TInt aError ) + { + if ( aCommand == KVtEngSetAudioRouting ) + { + if ( iError ) + { + *iError = aError; + iError = NULL; + } + + ProcessFinishedL(); + } + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiActiveExec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiActiveExec.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 2004 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: Implementation of the CVtUiActiveExec class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiActiveExec.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiActiveExec::CVtUiActiveExec +// ----------------------------------------------------------------------------- +// +CVtUiActiveExec::CVtUiActiveExec( + const TInt aPriority ) + : CActive( aPriority ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiActiveExec::~CVtUiActiveExec +// ----------------------------------------------------------------------------- +// +CVtUiActiveExec::~CVtUiActiveExec() + { + Cancel(); + } + +// ----------------------------------------------------------------------------- +// CVtUiActiveExec::Start +// ----------------------------------------------------------------------------- +// +void CVtUiActiveExec::Start( + TInt aStartState, + MVtUiActiveExec& aExec ) + { + Cancel(); + + iInitialState = aStartState; + iCurrentState = aStartState; + iNextState = aStartState; + + iActiveExec = &aExec; + + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CVtUiActiveExec::InitialState +// ----------------------------------------------------------------------------- +// +TInt CVtUiActiveExec::InitialState() const + { + return iInitialState; + } + +// ----------------------------------------------------------------------------- +// CVtUiActiveExec::RequestStatus +// ----------------------------------------------------------------------------- +// +TInt CVtUiActiveExec::RequestStatus() const + { + return iStatus.Int(); + } + +// ----------------------------------------------------------------------------- +// CVtUiActiveExec::RunL +// ----------------------------------------------------------------------------- +// +void CVtUiActiveExec::RunL() + { + User::LeaveIfError( iStatus.Int() ); + TBool synch = ETrue; + + // Execute to the next asynchronous operation. + while ( synch ) + { + iCurrentState = iNextState; + if ( iCurrentState ) + { + synch = iActiveExec->ActiveExecExecuteL( + *this, + iCurrentState, + iNextState, + iStatus ); + + if ( !synch ) + { + SetActive(); + } + } + else + { + iActiveExec->ActiveExecDone( *this, iInitialState ); + if ( !IsActive() ) + { + iInitialState = 0; + } + + synch = EFalse; + } + } + } + +// ----------------------------------------------------------------------------- +// CVtUiActiveExec::DoCancel +// ----------------------------------------------------------------------------- +// +void CVtUiActiveExec::DoCancel() + { + if ( iActiveExec ) + { + iActiveExec->ActiveExecCancel( *this, iCurrentState ); + + iCurrentState = 0; + iActiveExec = NULL; + iInitialState = 0; + } + } + +// ----------------------------------------------------------------------------- +// CVtUiActiveExec::RunError +// ----------------------------------------------------------------------------- +// +TInt CVtUiActiveExec::RunError( TInt aError ) + { + if ( iActiveExec->ActiveExecContinue( *this, iCurrentState, aError ) ) + { + iNextState = iCurrentState; + + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + SetActive(); + } + else + { + if ( !IsActive() ) + { + iInitialState = 0; + } + } + + return KErrNone; + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiAllowVideoDialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiAllowVideoDialog.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 2004 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: Implementation of the CVtUiAllowVideoDialog class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiAllowVideoDialog.h" +#include +#include + +// CONSTANTS + +// Timeout for allow video query. +const TInt KVtUiAllowVideoDialogTimeout = 5000000; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiAllowVideoDialog::CVtUiAllowVideoDialog +// ----------------------------------------------------------------------------- +// +CVtUiAllowVideoDialog::CVtUiAllowVideoDialog( + CEikDialog** aSelfPtr, + const TTone& aTone ) + : CAknQueryDialog( aTone ), + iSelfPtr( aSelfPtr ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiAllowVideoDialog::~CVtUiAllowVideoDialog +// ----------------------------------------------------------------------------- +// +CVtUiAllowVideoDialog::~CVtUiAllowVideoDialog() + { + if ( iSelfPtr ) + { + *iSelfPtr = NULL; + iSelfPtr = NULL; + } + + if ( iRequestStatus ) + { + User::RequestComplete( iRequestStatus, KErrNone ); + iRequestStatus = NULL; + } + + delete iQueryTimer; + } + +// ----------------------------------------------------------------------------- +// CVtUiAllowVideoDialog::ExecuteDialogLD +// ----------------------------------------------------------------------------- +// +void CVtUiAllowVideoDialog::ExecuteDialogLD( + TRequestStatus& aStatus ) + { + aStatus = KRequestPending; + + HBufC* prompt = StringLoader::LoadLC( R_VIDEOTELUI_QTN_SEND_VIDEO_IMAGE ); + + PrepareLC( R_VIDEOTELUI_ALLOW_VIDEO_QUERY ); + SetPromptL( *prompt ); + RunLD(); + + CleanupStack::PopAndDestroy( prompt ); + iRequestStatus = &aStatus; + } + +// ----------------------------------------------------------------------------- +// CVtUiAllowVideoDialog::PostLayoutDynInitL +// ----------------------------------------------------------------------------- +// +void CVtUiAllowVideoDialog::PostLayoutDynInitL() + { + CAknQueryDialog::PostLayoutDynInitL(); + + iQueryTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + iQueryTimer->Start( + KVtUiAllowVideoDialogTimeout, + KVtUiAllowVideoDialogTimeout, + TCallBack( DoDismissDialogTimeoutL, this ) ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAllowVideoDialog::OkToExitL +// ----------------------------------------------------------------------------- +// +TBool CVtUiAllowVideoDialog::OkToExitL( TInt aCommand ) + { + const TBool exit = + CAknQueryDialog::OkToExitL( aCommand ); + + if ( exit ) + { + CVtUiAllowVideoDialog::TResult result = + CVtUiAllowVideoDialog::EQueryCanceled; + + switch ( aCommand ) + { + case EAknSoftkeyOk: + case EAknSoftkeyYes: + result = CVtUiAllowVideoDialog::EUserAllowed; + break; + + case EAknSoftkeyNo: + result = CVtUiAllowVideoDialog::EUserDenied; + break; + + default: + break; + } + + if ( iRequestStatus ) + { + User::RequestComplete( iRequestStatus, result ); + iRequestStatus = NULL; + } + } + + return exit; + } + +// ----------------------------------------------------------------------------- +// CVtUiAllowVideoDialog::DoDismissDialogTimeoutL +// ----------------------------------------------------------------------------- +// +TInt CVtUiAllowVideoDialog::DoDismissDialogTimeoutL( TAny* aAny ) + { + CVtUiAllowVideoDialog* self = + static_cast< CVtUiAllowVideoDialog* >( aAny ); + + TRequestStatus* status = self->iRequestStatus; + self->iRequestStatus = NULL; + + delete self; + + User::RequestComplete( + status, + CVtUiAllowVideoDialog::EQueryDismissedTimeout ); + + return KErrNone; + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiApp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiApp.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2004 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: Implementation of the CVtUiApp application class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiApp.h" +#include "CVtUiDoc.h" +#include "videotelui.hrh" + +#include + +// CONSTANTS + +// UID of Video Telephone application. +const TUid KVtUiAppUid = { KVtUiAppUidValue }; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiApp::CVtUiApp +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiApp::CVtUiApp() + { + } + +// ----------------------------------------------------------------------------- +// CVtUiApp::CreateDocumentL +// Creates CVtUiDoc instance. +// ----------------------------------------------------------------------------- +// +CApaDocument* CVtUiApp::CreateDocumentL() + { + return new ( ELeave ) CVtUiDoc( *this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiApp::AppDllUid +// Returns application uid. +// ----------------------------------------------------------------------------- +// +TUid CVtUiApp::AppDllUid() const + { + return KVtUiAppUid; + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// --------------------------------------------------------- +// NewApplication implements +// +// Creates an instance of application. +// +// Returns: an instance of CVtUiApp +// --------------------------------------------------------- +// +LOCAL_C CApaApplication* NewApplication() + { + return new CVtUiApp; + } + +// --------------------------------------------------------- +// E32Main implements +// +// It is called when executable is started. +// +// Returns: error code. +// --------------------------------------------------------- +// +GLDEF_C TInt E32Main() + { + return EikStart::RunApplication( NewApplication ); + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiAppUi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiAppUi.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,7649 @@ +/* +* Copyright (c) 2004 - 2008 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: Implementation of the CVtUiAppUi application UI class. +* +*/ + + + +// INCLUDE FILES +#include "videotelui.hrh" +#include "CVtUiAppUi.h" +#include "CVtUiMainControl.h" +#include "CVtUiContextControl.h" +#include "CVtUiNumberEntryActivationControl.h" +#include "CVtUiNaviPane.h" +#include "VtUiLayout.h" +#include "MVtUiEngineCommandManager.h" +#include "CVtUiExecuteCmdDialog.h" +#include "CVtUiAllowVideoDialog.h" +#include "CVtUiBlankControl.h" +#include "VtUiLayout.h" +#include "VtUiUtility.h" +#include "VtUiPanic.h" +#include "CVtUiActivateBtHfDialog.h" +#include "CVtUiRemoteVideoControl.h" +#include "CVtUiEndCallButtonPane.h" +#include + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "CVtUiBitmapManager.h" + +#include +#include +#include +#include + +#include "cvtuifeaturemanager.h" +#include "cvtuicomponentmanager.h" +#include "cvtuicommandmanager.h" +#include "tvtuistates.h" +#include "cvtuimenus.h" +#include "cvtuisoftkeys.h" +#include "cvtuitoolbarbase.h" +#include "cvtuiwhitebalance.h" +#include "cvtuicolortone.h" +#include "cvtuibrightness.h" +#include "cvtuicontrast.h" +#include +#include +#include +#include "tvtuiwsevent.h" +#include "mvtuinumbersource.h" +#include "tVtuifeaturevariation.h" +#include "cvtuidialer.h" +#include "tvtuiappstates.h" +#include "cvtuivolume.h" +#include "cvtuizoom.h" +#include "cvtuivolumecontrol.h" + +using namespace ContentAccess; + +// CONSTANTS + +// Engine orientation to application orientation map +const CVtUiAppUi::TAppUiOrientation engToAppOrientation[] = { + CVtUiAppUi::EAppUiOrientationLandscape, + CVtUiAppUi::EAppUiOrientationPortrait, + CVtUiAppUi::EAppUiOrientationUnspecified }; + +// Amount of help contexts. +const TInt KVtUiHelpContextAmount = 1; + +// UID of Video Telephone application. +const TUid KVtUiAppUid = { KVtUiAppUidValue }; + +// Granularity of command observer array. +const TInt KVtUiCommandObserverArrayGranularity = 5; + +// Default call index. +const TInt KVtUiDefaultCallId = 1; + +// Control priority for the blank control. Above all other controls. +const TInt KVtUiBlankControlPriority = + ECoeStackPriorityEnvironmentFilter + 100; + +// Exit timeout. +const TInt KVtUiExitTimeout = 10000000; + +// UID of the main telephone application +const TUid KVtUiTelephoneUid = { 0x100058B3 }; + +// Reset value for volume +const TInt KVolumeResetValue = -1; + +// Remote video control normal priority +const TInt KVtUiRemoteVideoControlOrdinalPriNormal = 0; + +// Remote video control high priority +const TInt KVtUiRemoteVideoControlOrdinalPriHigh = 1; + +// Name of the EIKON server window group. +_LIT( KVtUiEikonServer, "EikonServer" ); + +// Name of the AknCapServer window group. +_LIT( KVtUiAknCapServer, "*akncapserver*" ); + +// Name of the AknNotifierServer window group. +_LIT( KVtUiAknNotifierServer, "*aknnfysrv*" ); + +// Volume repeat delay. +const TInt KVtUiVolumeRepeatDelay = KAknStandardKeyboardRepeatRate; + +// Volume repeat long delay. +const TInt KVtUiVolumeRepeatLongDelay = KAknKeyboardRepeatInitialDelay; + +// Start time for toolbar timer +const TTimeIntervalMicroSeconds32 KStartTime( 600000 ); + +// period time for toolbar timer +const TTimeIntervalMicroSeconds32 KPeriodTime( 300000 ); + +// The maximum frequency that user can swap image places. +const TInt64 KVtUiMaxSwapImagesFreq( 1000000 ); + +// Enumerates methods used in event handling. This enumeration MUST +// match with methodArray local array. +enum TVtUiHandleEvents + { + // Refresh states + EVtUiRefreshStates = 1 << 0, + // Handle remote problem. + EVtUiHandleVideoFrameRemoteProblem = 1 << 1, + // Handle local problem. + EVtUiHandleVideoFrameLocalProblem = 1 << 2, + // Refresh navipane. + EVtUiRefreshNaviPane = 1 << 3, + // Refresh softkeys. + EVtUiRefreshSoftkeys = 1 << 4, + // Refresh blind icon status. + EVtUiRefreshBlind = 1 << 5, + // Stop showing waiting image text. + EVtUiStopWaitingImage = 1 << 6, + // Rx resolution changed. + EVtUiChangeRemoteVideoLayout = 1 << 7, + // Show initializing image progress + EVtUiShowImageInitializingProgress = 1 << 8, + // Hide initializing image progress + EVtUiHideImageInitializingProgress = 1 << 9, + // Set camera orientation + EVtUiSetOrientation = 1 << 10, + //Handle media status change + EVtUiMediaStateChanged = 1 << 11, + //Show decoding error note + EVtUiShowDecodingError = 1 << 12, + // Stop the white balance and color tone + EVtUiStopWBOrColortone = 1 << 13, + // refresh Menu + EVtUiRefreshMenu = 1 << 14, + // Stop brightness and contrast slider + EVtUiStopBrightnessOrContrast = 1 << 15, + // refresh zoom popup + EVtUiRefreshZoomPopup = 1 << 16, + // enable end call button + EVtUiEnableEndCallButton = 1 << 17 + }; + +// Enumerates states for CVtUiActiveExec. +enum + { + // Operation finished. Must equal to zero. + EVtUiAppUiNone, + + // Active execution states for iActiveExec: + + // Startup (prepare engine): + EVtUiAppUiStartup = 100, // 100 + // Close dialogs. + EVtUiAppUiStartupCloseDialogs = EVtUiAppUiStartup, // 100 + // Initialise engine. + EVtUiAppUiStartupInitEngine, // 101 + // Prepare viewfinder. + EVtUiAppUiStartupPrepareViewfinder, // 102 + // Prepare remote render. + EVtUiAppUiStartupPrepareRemoteRender, // 103 + // Remove blank. + EVtUiAppUiStartupRemoveBlank, // 104 + + // Shutdown (reset engine): + EVtUiAppUiShutdown = 300, // 300 + // Close dialogs. + EVtUiAppUiShutdownCloseDialogs = EVtUiAppUiShutdown, // 300 + // Hide application. + EVtUiAppUiShutdownHideApplication, // 301 + // Reset engine. + EVtUiAppUiShutdownResetEngine, // 302 + // Remove blank. + EVtUiAppUiShutdownRemoveBlank, // 303 + + // Answered: + EVtUiAppUiAnswered = 500, // 500 + // Show blank dialog. + EVtUiAppUiAnsweredStart = EVtUiAppUiAnswered, // 500 + // Refresh navipane. + EVtUiAppUiAnsweredRefreshNavi, // 501 + // Refresh softkeys. + EVtUiAppUiAnsweredRefreshSoftkeys, // 502 + // Start remote render. + EVtUiAppUiAnsweredStartRemoteRender, // 503 + + // Prepares camera + EVtUiAppUiAnsweredCheckCamera, // 504 + // Choose if it's needed to show query or directly activate camera. + EVtUiAppUiAnsweredChoose, // 505 + // Set still image as source. + EVtUiAppUiAnsweredQuerySetupStill, // 506 + // Set none as source. + EVtUiAppUiAnsweredQuerySetupNone, // 507 + // Start viewfinder. + EVtUiAppUiAnsweredQuerySetupStart, // 508 + // Show "allow video image" query. + EVtUiAppUiAnsweredQueryShow, // 509 + // Check if user allowed video image. + EVtUiAppUiAnsweredQueryDecide, // 510 + // Select camera as source. + EVtUiAppUiAnsweredQuerySelectCamera, // 511 + // Select still image as source. + EVtUiAppUiAnsweredQuerySelectStill, // 512 + // Select none as source. + EVtUiAppUiAnsweredQuerySelectNone, // 513 + // Start viewfinder. + EVtUiAppUiAnsweredQueryStartViewfinder, // 514 + // Finish. + EVtUiAppUiAnsweredQueryFinish, // 515 + // Select camera as source. + EVtUiAppUiAnsweredSelectCamera, // 516 + // Select still image as source. + EVtUiAppUiAnsweredSelectStill, // 517 + // Select none as source. + EVtUiAppUiAnsweredSelectNone, // 518 + // Start viewfinder. + EVtUiAppUiAnsweredStartViewfinder, // 519 + // Finish. + EVtUiAppUiAnsweredFinish, // 520 + + // Prepares camera + EVtUiAppUiAnsweredDoPrepareCamera // 521 + }; + +/** +* Enumerates background layers +*/ +enum TVtUiBackgroundLayers + { + // Idle state background. + EVtUiLayerBackground = 0, + // Wallpaper layout. + EVtUiLayerWallpaper = 1, + // Amount of layers. + EVtUiLayerCount = 2 + }; + +// MODULE DATA STRUCTURES + +/** +* Asynchronous command executor that does not use dialog for waiting the +* execution completion. +* @since Series 60 5.0 +*/ +class CVtEngCmdExec : public CBase, private MVtEngCommandObserver + { + +public: + /** + * Static constructor. + */ + static CVtEngCmdExec* NewL( MVtEngCommandHandler& aCommandHandler, + MVtUiEngineCommandManager& aCommandManager, + CEikButtonGroupContainer& aCBA ); + + /** + * Executes given command asynchronously, waiting the command completion. + */ + void ExecuteCmdLD( const TVtEngCommandId aCommandId ); + + /** + * Destructor. + */ + ~CVtEngCmdExec(); + +private: // from MVtEngCommandObserver + + /** + * @see MVtEngCommandObserver::HandleVTCommandPerformedL + */ + void HandleVTCommandPerformedL( TVtEngCommandId aCommand, + const TInt aError ); + +private: + + /** + * Constructor. + */ + CVtEngCmdExec( MVtEngCommandHandler& aCommandHandler, + MVtUiEngineCommandManager& aCommandManager, + CEikButtonGroupContainer& aCBA ); + +private: + + CActiveSchedulerWait iWait; + + MVtEngCommandHandler& iCommandHandler; + + MVtUiEngineCommandManager& iCommandManager; + + TVtEngCommandId iCommandId; + + CEikButtonGroupContainer& iCBA; + + }; + +// ----------------------------------------------------------------------------- +// CVtEngCmdExec::NewL +// ----------------------------------------------------------------------------- +// +CVtEngCmdExec* CVtEngCmdExec::NewL( MVtEngCommandHandler& aCommandHandler, + MVtUiEngineCommandManager& aCommandManager, CEikButtonGroupContainer& aCBA ) + { + CVtEngCmdExec* self = new ( ELeave ) CVtEngCmdExec( aCommandHandler, + aCommandManager, aCBA ); + return self; + } + +// ----------------------------------------------------------------------------- +// CVtEngCmdExec::ExecuteCmdLD +// ----------------------------------------------------------------------------- +// +void CVtEngCmdExec::ExecuteCmdLD( const TVtEngCommandId aCommandId ) + { + __VTPRINTENTER("CVtEngCmdExec::ExecuteCmdLD") + CleanupStack::PushL( this ); + iCommandId = aCommandId; + iCommandManager.AddObserverL( *this ); + iCommandHandler.ExecuteL( aCommandId, NULL ); + iCBA.SetCommandSetL( R_VIDEOTELUI_SOFTKEYS_EMPTY ); + iCBA.DrawNow(); + iWait.Start(); + CleanupStack::PopAndDestroy(); // this + __VTPRINTEXIT("CVtEngCmdExec::ExecuteCmdLD") + } + +// ----------------------------------------------------------------------------- +// CVtEngCmdExec::~CVtEngCmdExec +// ----------------------------------------------------------------------------- +// +CVtEngCmdExec::~CVtEngCmdExec() + { + __VTPRINTENTER("CVtEngCmdExec::~CVtEngCmdExec") + if ( iWait.IsStarted()) + { + __VTPRINT(DEBUG_GEN, "CVtEngCmdExec::~CVtEngCmdExec AsyncStop") + iWait.AsyncStop(); + } + iCommandManager.RemoveObserver( *this ); + __VTPRINTEXIT("CVtEngCmdExec::~CVtEngCmdExec") + } + +// ----------------------------------------------------------------------------- +// CVtEngCmdExec::HandleVTCommandPerformedL +// ----------------------------------------------------------------------------- +// +void CVtEngCmdExec::HandleVTCommandPerformedL( TVtEngCommandId aCommand, + const TInt aError ) + { + __VTPRINTENTER("CVtEngCmdExec::HandleVTCommandPerformedL") + if ( iCommandId == aCommand ) + { + if ( iWait.IsStarted()) + { + __VTPRINT(DEBUG_GEN, "CVtEngCmdExec::HandleVTCommandPerformedL AsyncStop") + iWait.AsyncStop(); + } + else + { + // request already completed + } + } + else + { + // wrong command ID + } + __VTPRINTEXIT("CVtEngCmdExec::HandleVTCommandPerformedL") + } + +// ----------------------------------------------------------------------------- +// CVtEngCmdExec::CVtEngCmdExec +// ----------------------------------------------------------------------------- +// +CVtEngCmdExec::CVtEngCmdExec( MVtEngCommandHandler& aCommandHandler, + MVtUiEngineCommandManager& aCommandManager, CEikButtonGroupContainer& aCBA ) + : iCommandHandler( aCommandHandler ), + iCommandManager( aCommandManager ), iCBA( aCBA ) + { + } + +/** +* Encapsulates all instances related to user interface. +* @since Series 60 2.6 +*/ +class CVtUiAppUi::CInstance + : public CBase + { + public: // Constructors and destructors + + /** + * Two-phased constructor. + * @param aAppUi reference to application UI. + */ + static CInstance* NewL( CVtUiAppUi& aAppUi ); + + /** + * Destructor. + */ + ~CInstance(); + + /** + * Called when side volume key is pressed. + */ + void VolumeKeyPressedL(); + + /** + * Create remote video control. + */ + void CreateRemoteVideoControl(); + + private: + + /** + * Constructor. + */ + CInstance( CVtUiAppUi& aAppUi ); + + /** + * Symbian OS constructor. + */ + void ConstructL(); + + /** + * Relayout controls. + */ + void LayoutChanged(); + + private: + + // Parent can access members. + friend class CVtUiAppUi; + + // Ref to application UI. + CVtUiAppUi& iAppUi; + + // Owned bitmap manager. + CVtUiBitmapManager* iBitmapManager; + + // ETrue if iMainControl has been added to stack. + TBool iMainControlInStack; + + // Owned main pane control. + CVtUiMainControl* iMainControl; + + // ETrue if iContextControl has been added to stack. + TBool iContextControlInStack; + + // Owned context pane control. + CVtUiContextControl* iContextControl; + + // Owned remote video control. + CVtUiRemoteVideoControl* iRemoteVideoControl; + + //ETrue if iRemoteVideoControl has been added to stack. + TBool iRemoteVideoControlInStack; + + // Owned navi pane controller. + CVtUiNaviPane* iNaviPane; + + // ETrue if number entry has been added to stack. + TBool iNumberEntryInStack; + + // Owned number entry activation control. + CVtUiNumberEntryActivationControl* iNumberEntryActivation; + + // Owned button pane control + CVtUiEndCallButtonPane* iEndCallButtonPane; + + // ETrue if iButtonPane has been added to stack. + TBool iButtonPaneInStack; + + }; + +/** +* Encapsulates event handling. +* @since Series 60 2.6 +*/ +class CVtUiAppUi::CEventObserver + : public CBase, + public MVtUiEngineCommandManager, + public MVtEngEventObserver, + public MVtEngCommandObserver, + public MVtEngFrameObserver, + private MBeating, + private MRemConCoreApiTargetObserver + { + public: // Constructors and destructors + + /** + * Two-phased constructor. + * @param aAppUi application UI. + */ + static CEventObserver* NewL( CVtUiAppUi& aAppUi ); + + /** + * Destructor. + */ + ~CEventObserver(); + + public: // New functions + + /** + * Returns engine model. + * @return model instance. + */ + inline CVtEngModel& Model(); + + /** + * Creates remote control framework session. + */ + void CreateRemConSessionL(); + + /** + * Deletes remote control framework session. + */ + void DeleteRemConSession(); + + /** + * Checks if command is supported by engine. + * @param aCommandId command. + * @return ETrue if supported, EFalse otherwise. + */ + TBool CommandSupported( const TInt aCommandId ) const; + + /** + * Checks if command is supported and synchronous. + * @param aCommandId command. + * @return ETrue if synchronous & supported, EFalse otherwise. + */ + TBool CommandSupportedAndSynchronous( + const TInt aCommandId ) const; + + /** + * Starts heartbeat timer. + */ + void StartBeatL(); + + /** + * Stops heartbeat timer. + */ + void StopBeat(); + + /** + * Stops volume repeat handling timer. + */ + void StopVolumeRepeatTimer(); + + /** + * Sends response to prepare. + * @param aResult result code. + */ + void SendPrepareResponse( const TInt aResult ); + + public: // Functions from base classes + + /** + * @see MVtUiCommandManager::AddObserverL. + */ + virtual void AddObserverL( MVtEngCommandObserver& aObserver ); + + /** + * @see MVtUiCommandManager::RemoveObserver. + */ + virtual void RemoveObserver( MVtEngCommandObserver& aObserver ); + + /** + * @see MVtEngEventObserver::HandleVtEventL. + */ + virtual void HandleVtEventL( TInt aEvent ); + + /** + * @see MVtEngCommandObserver::HandleVTCommandPerformedL. + */ + virtual void HandleVTCommandPerformedL( + TVtEngCommandId aCommand, + const TInt aError ); + + /** + * @see MVtEngFrameObserver::vtHandleFrameL. + */ + virtual void vtHandleFrameL( TFrameType aType, CFbsBitmap* aBitmap ); + + /** + * @see MVtEngFrameObserver::vtSetFrame + */ + virtual void vtSetFrame( TFrameType aType, CFbsBitmap* aBitmap ); + + /** + * @see MBeating::Beat. + */ + virtual void Beat(); + + /** + * @see MBeating::Synchronize. + */ + virtual void Synchronize(); + + + private: + + /** + * Constructor. + * @param aAppUi application UI. + */ + CEventObserver( CVtUiAppUi& aAppUi ); + + /** + * Symbian OS constructor. + */ + void ConstructL(); + + /** + * Executes CVtUiAppUi methods. + * @param aBits sum of subset of TVtUiHandleEvents. + */ + void DoExecuteL( TInt aBits ); + /** + * Handles volume change. + * @param aButtonAct button action. + */ + void HandleVolumeChange( + TRemConCoreApiButtonAction aButtonAct ); + /** + * Handles mute change. + * @param aButtonAct button action. + */ + void HandleRemMuteChange( + TRemConCoreApiButtonAction aButtonAct ); + /** + * @see MRemConCoreApiTargetObserver::MrccatoCommand. + */ + virtual void MrccatoCommand( + TRemConCoreApiOperationId aOperationId, + TRemConCoreApiButtonAction aButtonAct ); + + /** + * Callback function to handle volume repeat. + * @param aAny pointer to an instance of this class. + * @return KErrNone. + */ + static TInt DoHandleVolumeRepeat( TAny* aAny ); + + private: + + // Type definition for CVtUiAppUi member functions. + typedef void (CVtUiAppUi::*TMethodL)(); + + // Ref to application ui. + CVtUiAppUi& iAppUi; + + // Engine model. + CVtEngModel* iModel; + + // ETrue when command events are being sent. + TBool iInCommandPerformed; + + // Owned array of observers. + RPointerArray< MVtEngCommandObserver > iCommandObservers; + + // Owned heart beat timer to update call duration. + CHeartbeat* iBeat; + + + // Owned interface selector instance. + CRemConInterfaceSelector* iRemConInterfaceSelector; + + // Pointer to target instance. Owned by iRemConInterfaceSelector. + CRemConCoreApiTarget* iRemConCoreApiTarget; + + // Owned timer for volume repeat handling. + CPeriodic* iRemConVolumeRepeatTimer; + + // Rencon operation id + TRemConCoreApiOperationId iRCCAOperationId; + + }; + +/** +* Verifies objects fetched using media gallery. Only non DRM protected +* objects are allowed. +* @since Series 60 3.1 +*/ +class CVtUiAppUi::CVtUiAppUiMGVerifier : + public CBase, + public MMGFetchVerifier + { + public: + + /** + * Static constructor, pushes created instance into cleanup stack. + */ + static CVtUiAppUiMGVerifier* NewLC( + CVtUiAppUi& aAppUi, CCoeEnv& aCoeEnv ); + + /** + * Destructor. + */ + ~CVtUiAppUiMGVerifier(); + + public: // from MMGFetchVerifier + + /** + * @see MMGFetchVerifier::VerifySelectionL + */ + TBool VerifySelectionL( const MDesCArray* aSelectedFiles ); + + private: + + /** + * 2nd constructor in two phase construction. + */ + void ConstructL(); + + /** + * Constructor. + */ + CVtUiAppUiMGVerifier( CVtUiAppUi& aAppUi, CCoeEnv& aCoeEnv ); + + private: + + // Reference to Application UI + CVtUiAppUi& iAppUi; + + // Pointer to COE + CCoeEnv* iCoeEnv; + + // Pointer to CManager which manages files and content access agents + CManager* iManager; + }; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CVtUiAppUi +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::CVtUiAppUi() + : iRenderingMode( ERenderingModeDefault ), + iLoudspeakerVolume( KVolumeResetValue ), + iHandsetVolume( KVolumeResetValue ), + iActiveCommands( 1 ), + iLayoutChg( EFalse ), + iDelayedCmd( 0 ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ConstructL() + { + VTLOGINIT + __VTPRINTENTER( "VtUi.ConstructL" ) + + FeatureManager::InitializeLibL(); + BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible ); + + iCba = Cba(); + // Must be done before creating features + iVTVariation.ReadL(); + + iEventObserver = CEventObserver::NewL( *this ); + iUiStates = new ( ELeave ) TVtUiStates( iEventObserver->Model() ); + iUiStates->Update(); + iUiStates->SetViewFindersInitialPlaceContextPane( ETrue ); + + TVtUiAppStateBase::SetInitialStateL( *this, *iUiStates ); + + iCommandManager = CVtUiCommandManager::NewL( *iUiStates, *this ); + + iComponentManager = CVtUiComponentManager::NewL(); + + iFeatureManager = CVtUiFeatureManager::NewL( *this, *iUiStates, + *iCommandManager, *iComponentManager ); + + iInstance = CInstance::NewL( *this ); + + CEikMenuBar* menu = iEikonEnv->AppUiFactory()->MenuBar(); + menu->SetContextMenuTitleResourceId( R_VIDEOTELUI_OK_MENUBAR ); + + + + CEikonEnv& eikEnv = *( iEikonEnv ); + eikEnv.SetSystem( ETrue ); + eikEnv.WsSession().ComputeMode( RWsSession::EPriorityControlDisabled ); + + iThisApplicationWgId = eikEnv.RootWin().Identifier(); + iEikonServerWgId = + eikEnv.WsSession().FindWindowGroupIdentifier( 0, KVtUiEikonServer ); + iAknCapServerWgId = + eikEnv.WsSession().FindWindowGroupIdentifier( 0, KVtUiAknCapServer ); + iAknNfyServerWgId = + eikEnv.WsSession().FindWindowGroupIdentifier( 0, + KVtUiAknNotifierServer ); + + __ASSERT_ALWAYS( + iEikonServerWgId != KErrNotFound, + VtUiPanic::Panic( EVtUiPanicEikonServerNotFound ) ); + (void)eikEnv.RootWin().EnableFocusChangeEvents(); + + + iUplinkWindow = iInstance->iContextControl; + iDownlinkWindow = iInstance->iMainControl; + + + if ( iCba ) + { + CCoeControl* control = iCba->ButtonGroup()->AsControl(); + static_cast< CEikCba* >( control )-> + SetSkinBackgroundId( KAknsIIDQsnBgAreaControlIdle ); + } + + iBlankControl = new ( ELeave ) CVtUiBlankControl; + iBlankControl->ConstructL( ClientRect() ); + AddToStackL( + iBlankControl, + KVtUiBlankControlPriority, + ECoeStackFlagRefusesFocus ); + + iUiStates->SetBlankControlAdded( ETrue ); + + iActiveExec = + new ( ELeave ) CVtUiActiveExec( CActive::EPriorityHigh ); + SetCallIdL( KVtUiDefaultCallId ); + + iExitTimer = CPeriodic::NewL( CActive::EPriorityHigh ); + CheckEngineFunctionality(); + + iAsyncCallback = + new ( ELeave ) CAsyncCallBack ( + TCallBack( &AsyncViewFinderToMainPaneAndShare, this ), + CActive::EPriorityStandard ); + + iLayoutChangeCallback = + new ( ELeave ) CAsyncCallBack( + TCallBack( &DelayedHandleLayoutChanged, this ), + CActive::EPriorityStandard ); + + iCurrentCameraOrientation = MVtEngMedia::EOrientationObeyLayoutSwitch; + + GetCameraOrientations(); + + SetInitialCameraOrientationL(); + + iVolCtrl= new ( ELeave )CVtUiVolumeControl( + Model().CommandHandler(), + Model().Audio(), + *iEventObserver, + *iFeatureManager); + iVolCtrl->ConstructL(); + + iIncallBubble = CAknIncallBubble::NewL(); + + iIsWaitingCallState = EFalse; + + __VTPRINTEXIT( "VtUi.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::~CVtUiAppUi +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::~CVtUiAppUi() + { + __VTPRINTENTER( "VtUi.~" ) + + iActiveCommands.Close(); + + delete iLayoutChangeCallback; + delete iAsyncCallback; + + if ( iUiStates && iUiStates->IsBlankControlAdded() ) + { + RemoveFromStack( iBlankControl ); + } + TInt lightsValue = 0; + if ( RProperty::Get( KPSUidCoreApplicationUIs, + KLightsVTForcedLightsOn, lightsValue ) == KErrNone ) + { + if ( lightsValue == EForcedLightsOn ) + { + __VTPRINT( DEBUG_GEN, "VtUi.~ Good night!" ) + (void) RProperty::Set( + KPSUidCoreApplicationUIs, + KLightsVTForcedLightsOn, + EForcedLightsOff ); + } + } + delete iActiveExec; + delete iInstance; + delete iBlankControl; + // Delete volume control before its dependencies are deleted. + delete iVolCtrl; + delete iEventObserver; + delete iExitTimer; + // Featuremanager must be destructed + // before componentmanager and commandmanager + delete iFeatureManager; + delete iComponentManager; + delete iCommandManager; + delete iUiStates; + + if ( iTbPeriodic ) + { + iTbPeriodic->Cancel(); + } + delete iTbPeriodic; + + if ( iIncallBubble ) + { + TRAP_IGNORE( iIncallBubble->SetIncallBubbleAllowedInUsualL( ETrue ) ) + } + delete iIncallBubble; + + // Close all RComm sessions to prevent memory leaks. + REComSession::FinalClose(); + + FeatureManager::UnInitializeLib(); + __VTPRINTEXIT( "VtUi.~" ) + VTLOGUNINIT + } + +// ----------------------------------------------------------- +// CVtUiAppUi::SwitchLayoutToFlatStatusPaneL +// ----------------------------------------------------------- +// +void CVtUiAppUi::SwitchLayoutToFlatStatusPaneL( TBool aSwitch ) + { + __VTPRINTENTER( "VtUi.SwitchLayoutToFlatStatusPaneL" ) + CEikStatusPane* statusPane = StatusPane(); + + const TInt idleResId( + VtUiLayout::IsLandscapeOrientation() ? + R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL : + R_AVKON_STATUS_PANE_LAYOUT_USUAL ); + + const TBool isStatusPaneFlat( + ( statusPane->CurrentLayoutResId() == + R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT ) || + ( statusPane->CurrentLayoutResId() == + R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ) ); + + if ( aSwitch ) + { + if ( isStatusPaneFlat && VtUiLayout::IsLandscapeOrientation() ) + { + __VTPRINT( DEBUG_GEN, + "VtUi.SwitchLayoutToFlatStatusPaneL LAYOUT USUAL" ); + statusPane->SwitchLayoutL( idleResId ); + } + else if ( !isStatusPaneFlat && !VtUiLayout::IsLandscapeOrientation() ) + { + __VTPRINT( DEBUG_GEN, + "VtUi.SwitchLayoutToFlatStatusPaneL USUAL FLAT" ); + statusPane->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ); + } + } + else + { + if ( isStatusPaneFlat ) + { + __VTPRINT( DEBUG_GEN, + "VtUi.SwitchLayoutToFlatStatusPaneL LAYOUT IDLE" ); + statusPane->SwitchLayoutL( idleResId ); + } + } + // ApplyCurrentSettingsL is called whenever statuspane + // visibility status or pane layout changes. + statusPane->ApplyCurrentSettingsL(); + statusPane->DrawNow(); + // Make sure whole control is fully updated + iInstance->iMainControl->DrawNow(); + __VTPRINTEXIT( "VtUi.SwitchLayoutToFlatStatusPaneL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RefreshL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RefreshL() + { + __VTPRINTENTER( "VtUi.Refresh" ) + RefreshBlind(); + RefreshNaviPaneL(); + __VTPRINTEXIT( "VtUi.Refresh" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RefreshNaviPaneL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RefreshNaviPaneL() + { + // Update only if navi pane exists + if ( iInstance ) + { + __VTPRINT( DEBUG_GEN, "VtUi.RefreshNavi" ) + CVtUiNaviPane* navi = iInstance->iNaviPane; + + // Refresh muted state + MVtEngMedia& media = Model().Media(); + TInt mediaAvail; + VtUiUtility::GetOutgoingMediaState( media, mediaAvail ); + mediaAvail = ~mediaAvail; + navi->SetMuted( mediaAvail & MVtEngMedia::EMediaAudio ); + + // Refresh call duration + MVtEngSessionInfo& session = Model().Session(); + MVtEngSessionInfo::TDuration duration; + TBool enabled; + if ( session.GetDuration( duration, enabled ) != KErrNone ) + { + enabled = EFalse; + } + navi->SetCallDuration( duration, enabled ); + + // Update all changes + navi->CommitL(); + + CheckBeatL( enabled ); + } + } + +void CVtUiAppUi::StopBrightnessOrContrast() + { + + MVtUiFeature* br = iFeatureManager->GetFeatureById( EVtUiFeatureIdBrightness ); + if ( br ) + { + __VTPRINT( DEBUG_GEN, "VtUi.StopBrightness" ) + if ( br->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "VtUi.StopBrightnessOrContrast br->STOP" ) + br->Stop(); + } + } + + MVtUiFeature* cr = iFeatureManager->GetFeatureById( EVtUiFeatureIdContrast ); + if ( cr ) + { + __VTPRINT( DEBUG_GEN, "VtUi.StopContrast" ) + if ( cr->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "VtUi.StopBrightnessOrContrast cr->STOP" ) + cr->Stop(); + } + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RefreshZoomPopupL() +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RefreshZoomPopupL() + { + CVtUiZoom* zm = static_cast< CVtUiZoom* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdZoom ) ); + if( zm && iUiStates->IsZoomModeOn()) + zm->RefreshL(); + } +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RefreshMenuL() +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RefreshMenuL() + { + + CVtUiMenus* menus = static_cast< CVtUiMenus* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdMenu ) ); + if ( menus ) + { + iUiStates->Update(); + __VTPRINT( DEBUG_GEN, "VtUi.RefreshMenuL" ) + menus->RefreshL(); + CAknAppUi::ProcessCommandL( EEikCmdCanceled ); // does not leave + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RefreshSoftkeysL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RefreshSoftkeysL() + { + if ( iUiStates->IsThisApplicationForeground() ) + { + CVtUiSoftkeys* sk = static_cast< CVtUiSoftkeys* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdSoftkey ) ); + if ( sk ) + { + sk->RefreshL(); + } + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RefreshBlind +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RefreshBlind() + { + if ( iInstance && !iUiStates->IsDisableBlindSetting() ) + { + __VTPRINTENTER( "VtUi.RefreshBlind" ) + TInt avail; + MVtEngMedia& media = Model().Media(); + + // Update blind flags.for outgoing media: + VtUiUtility::GetOutgoingMediaState( media, avail ); + avail = ~avail; + TBool noVideo( avail & MVtEngMedia::EMediaVideo ); + const TBool isFrozen( VtUiUtility::GetFreezeState ( media ) ); + MVtEngMedia::TMediaSource source( MVtEngMedia::EMediaNone ); + media.GetSource( source ); + if ( noVideo && !isFrozen && + ( source != MVtEngMedia::EMediaStillImage ) ) + { + iUplinkWindow->SetStreamBitmap( NULL ); + } + + iUplinkWindow->SetBlind( noVideo ); + iUplinkWindow->SetWaiting( EFalse ); + + if ( iUiStates->IsThisApplicationForeground() ) + { + // Update blind flags for incoming media: + VtUiUtility::GetIncomingMediaState( media, avail ); + avail = ~avail; + noVideo = ( avail & MVtEngMedia::EMediaVideo ); + if ( noVideo ) + { + iDownlinkWindow->SetStreamBitmap( NULL ); + } + iDownlinkWindow->SetBlind( noVideo ); + } + iDownlinkWindow->SetWaiting( iUiStates->IsWaitingForFirstFrame() ); + __VTPRINTEXIT( "VtUi.RefreshBlind" ) + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::EnableEndCallButton +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::EnableEndCallButton() + { + EndCallButtonPane().SetEnabled( ETrue ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::OpenNumberEntryL +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::OpenNumberEntryL() + { + __VTPRINTENTER( "VtUi.OpenNumberEntryL" ) + + CEikMenuBar* menuBar = iEikonEnv->AppUiFactory()->MenuBar(); + if ( IsDisplayingDialog() || ( menuBar && menuBar->IsDisplayed() ) ) + { + __VTPRINTEXIT( "VtUi.OpenNumberEntryL" ) + return EFalse; + } + + TInt error( KErrNotFound ); + + MVtUiFeature* numberEntry = + iFeatureManager->GetFeatureById( EVtUiFeatureIdNumberEntry ); + + MVtUiFeature* dialer = + iFeatureManager->GetFeatureById( EVtUiFeatureIdDialer ); + + const TBool dialerActive( dialer && + ( dialer->State() == MVtUiFeature::EActive ) ); + + if ( numberEntry && !dialerActive ) + { + TRAP( error, numberEntry->StartL() ); + } + + const TBool result( !error ); + + if ( result ) + { + __VTPRINT( DEBUG_GEN, "VtUi.NumberEntry.StopZ" ) + RefreshSoftkeysL(); + } + + __VTPRINTEXITR( "VtUi.OpenNumberEntryL %d", result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandlePhoneSendKeyL +// Handles EKeyPhoneSend key events. +// ----------------------------------------------------------------------------- +// +TKeyResponse CVtUiAppUi::HandlePhoneSendKeyL( const TKeyEvent& /*aKeyEvent*/, + TEventCode aType ) + { + __VTPRINTENTER( "VtUi.HandlePhoneSendKeyL" ) + CEikMenuBar* menuBar = iEikonEnv->AppUiFactory()->MenuBar(); + if ( !( IsDisplayingDialog() || ( menuBar && menuBar->IsDisplayed() ) ) ) + { + const TBool isNumberSource( iUiStates->IsNumberEntryOpen() || + iUiStates->IsDialerOpen() ); + if ( ( aType == EEventKey ) && isNumberSource ) + { + ProcessCommandL( EVtUiCmdDialEmergency ); + } + } + __VTPRINTEXIT( "VtUi.HandlePhoneSendKeyL" ) + return EKeyWasConsumed; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::StartDtmfTone +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::StartDtmfTone( const TChar& aTone ) + { + // should be called only through current application state + iDtmfTone = aTone; + __VTPRINT2( DEBUG_GEN, "VtUi.DTMF.Start.%d", iDtmfTone() ) + if ( Execute( KVtEngStartDtmfTone, &iDtmfTone ) != KErrNone ) + { + iDtmfTone = 0; + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::StopDtmfTone +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::StopDtmfTone() + { + // should be called only through current application state + if ( iDtmfTone() ) + { + __VTPRINT( DEBUG_GEN, "VtUi.DTMF.STOP" ) + (void) Execute( KVtEngStopDtmfTone, NULL ); + iDtmfTone = 0; + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleWsEventL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleWsEventL( + const TWsEvent& aEvent, + CCoeControl* aDestination ) + { + __VTPRINTENTER( "VtUi.HandleWsEventL" ) + const TInt type = aEvent.Type(); + __VTPRINT2( DEBUG_GEN, "VtUi.HandleWsEventL type = %d", type ); + + // Zoom-in and Zoom-out keys need specific handling because keyup and + // keydown events cannot be checked from iCode field of TKeyEvent + if ( PreHandleKeyEventL( aEvent ) ) + { + __VTPRINTEXIT( "VtUi.HandleWsEventL (PreHandleKeyEventL)" ) + return; + } + + // Zoom mode is dismissed if some interrupting event happens prior timeout. + // Zoom mode can be interrupted with a keypress i.e. any keypress, except + // keys that are reserved for adjusting zoom dismiss zoom mode. Also any + // system event e.g. note or waiting call dismiss zoom mode. + if ( iUiStates->IsZoomModeOn() ) + { + if ( ProcessWsEventIfZoomModeIsActiveL( aEvent ) ) + { + __VTPRINTEXIT( "VtUi.HandleWsEventL (IsZoomModeOn)" ) + return; + } + } + // Zoom mode can be also activated with up and down arrow keys. + switch ( type ) + { + case EEventKey: + case EEventKeyUp: + case EEventKeyDown: + { + const TKeyEvent* keyEvent = aEvent.Key(); + const TBool isHwZoomKey( + keyEvent->iCode == EKeyZoomIn || + keyEvent->iCode == EKeyZoomOut ); + const TBool isZoomKey( + keyEvent->iScanCode == EStdKeyUpArrow || + keyEvent->iScanCode == EStdKeyDownArrow || + isHwZoomKey ); + + // Zoom mode can be also activated with up and down arrow keys. + if ( isZoomKey ) + { + const TBool isZoomAllowed( + !iEikonEnv->AppUiFactory()->MenuBar()->IsDisplayed() && + !iUiStates->MediaState().IsSharing() && + !iUiStates->MediaState().IsFrozen() && + !iUiStates->IsSelectingShare() && + VtUiUtility::IsZoomAllowed( Model().Media() ) && + !( iUiStates->IsNumberEntryOpen() && ShowNumberEntry() ) && + //there must not be the command which may switch provider to None + !IsActiveCommand( EVtUiCmdDisableVideo )&& + !IsActiveCommand( EVtUiCmdDisableBoth )&& + !IsActiveCommand( EVtUiCmdUsePrimaryCamera )&& + !IsActiveCommand( EVtUiCmdUseSecondaryCamera) ); + + if ( isZoomAllowed ) + { + // If menu is open, toolbar is available, video is frozen, + // sharing is on or user is selecting a file to be shared + // do not set zoom mode on. If HW zoom key was pressed, + // then zoom mode is activated even if toolbar is present. + if ( isHwZoomKey || !iUiStates->IsToolbarAvailable() ) + { + SetZoomModeL( ETrue ); + } + } + } + } + break; + default: + break; + } + + TBool partialForeGroundlost( EFalse ); + switch ( type ) + { + // Enter new rendering mode + case EVtUiWsEventBeginRenderingMode: + { + const TVtUiWsEvent< TRenderingMode >& event( + static_cast< const TVtUiWsEvent< TRenderingMode >& > + ( aEvent ) ); + MVtUiDialer* dialer = static_cast< CVtUiDialer* > ( + iFeatureManager->GetFeatureById( EVtUiFeatureIdDialer ) ); + __ASSERT_ALWAYS( dialer, + VtUiPanic::Panic( EVtUiPanicRendererNotFound ) ); + iInstance->iContextControl->MakeVisible( EFalse ); + SetRenderingModeL( *event.Data(), &dialer->VideoWindow() ); + } + break; + + // End rendering mode -> revert to previous + case EVtUiWsEventEndRenderingMode: + { + SetRenderingModeL( ERenderingModeDefault, iStoredDownlinkWindow ); + iInstance->iContextControl->MakeVisible( ETrue ); + iStoredDownlinkWindow = NULL; + } + break; + + // New number source have been activated + case EVtUiWsEventNumberSourceActivate: + { + const TVtUiWsEvent< MVtUiNumberSource >& event( + static_cast< const TVtUiWsEvent< MVtUiNumberSource >& > + ( aEvent ) ); + iNumberSource = event.Data(); + } + break; + + case EVtUiWsEventNumberSourceDeactivate: + { + const TVtUiWsEvent< MVtUiNumberSource >& event( + static_cast< const TVtUiWsEvent< MVtUiNumberSource >& > + ( aEvent ) ); + if ( iNumberSource == event.Data() ) + { + iNumberSource = NULL; + } + } + break; + + + // VT goes background e.g. selected application from fastswap + case KAknFullOrPartialForegroundLost: + { + // If capture mode is on stop it + if ( iUiStates->IsCaptureModeOn() ) + { + CmdCancelCaptureL(); + } + SetIncallBubbleAllowedInUsualL( ETrue ); + const TInt windowGroupId = + iCoeEnv->WsSession().GetFocusWindowGroup(); + + // In S60 5.0 we get PartialFocusLost also for some notes and + // overally items that are somehow overlapping screen instead of + // FocusLost. In those cases we should not put app to background. + if( ( windowGroupId != iThisApplicationWgId ) && + ( windowGroupId != iEikonServerWgId ) && + ( windowGroupId != iAknCapServerWgId ) && + ( windowGroupId != iAknNfyServerWgId ) ) + { + partialForeGroundlost = ETrue; + } + + // Fall through to EEventFocusLost event + } + case EEventFocusLost: + { + // If focus window group is not this application nor window server, + // then this application can not be in focus. + const TInt windowGroupId = GetFocusWindowGroupId(); + + if ( ( windowGroupId != iThisApplicationWgId ) && + ( windowGroupId != iEikonServerWgId ) && + ( windowGroupId != iAknCapServerWgId ) && + ( windowGroupId != iAknNfyServerWgId ) || partialForeGroundlost ) + { + iCoeEnv->RootWin().DisableFocusChangeEvents(); + + TBool old = iUiStates->IsThisApplicationForeground(); + if ( old ) + { + TRAP_IGNORE( HandleForegroundChangedL( EFalse ) ); + } + } + } + break; + + case EEventFocusGained: + case KAknFullOrPartialForegroundGained: + { + SetIncallBubbleAllowedInUsualL( EFalse ); + // Now this application is focused. + (void)iCoeEnv->RootWin().EnableFocusChangeEvents(); + TBool old = iUiStates->IsThisApplicationForeground(); + + if ( !old ) + { + (void) HandleLayoutChanged(); + TRAP_IGNORE( HandleForegroundChangedL( ETrue ) ); + } + } + break; + + case EEventKey: + case EEventKeyUp: + case EEventKeyDown: + { + // Key events with EModifierSpecial are received via FEP. + const TKeyEvent* keyEvent = aEvent.Key(); + if ( keyEvent->iModifiers & EModifierSpecial ) + { + TChar dtmfTone; + if ( VtUiUtility::IsDTMFEvent( *keyEvent, dtmfTone ) ) + { + if ( type == EEventKey ) + { + StartDtmfTone( dtmfTone ); + } + else if ( type == EEventKeyUp ) + { + StopDtmfTone(); + } + } + } + } + break; + + default: + break; + } + // Offer event to component manager + iComponentManager->HandleWsEventL( aEvent, aDestination ); + + // All events are sent to base class. + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + __VTPRINTEXIT( "VtUi.HandleWsEventL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::GetFocusWindowGroupId +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::GetFocusWindowGroupId() + { + __VTPRINTENTER( "VtUi.GetFocusWindowGroupId" ) + RWsSession& ws = iCoeEnv->WsSession(); + RArray* allWgIds = + new (ELeave) RArray( 4 ); + + CleanupDeletePushL( allWgIds ); + CleanupClosePushL( *allWgIds ); + + User::LeaveIfError( ws.WindowGroupList( 0, allWgIds) ); + + const TInt chainCount = allWgIds->Count(); + + RApaLsSession appArcSession; + User::LeaveIfError( appArcSession.Connect() ); + + appArcSession.GetAllApps(); + + CApaWindowGroupName* windowName; + TInt firstAppWgId = KErrNone; + for ( TInt index=0; index < chainCount; index++ ) + { + RWsSession::TWindowGroupChainInfo& info = (*allWgIds)[index]; + if ( info.iParentId <= 0 ) + { + TInt wgId=info.iId; + windowName = CApaWindowGroupName::NewLC(ws, wgId); + TUid applicationUid = windowName->AppUid(); + + // application screen (0 = main screen, 1 = cover ui ) + // the possible error value is omitted + TInt appScreen = -1; + TInt errId = appArcSession.GetDefaultScreenNumber( appScreen, applicationUid ); + if ( errId != KErrNone ) + { + CleanupStack::PopAndDestroy( windowName ); //windowName + continue; + } + if ( firstAppWgId == KErrNone && ( appScreen == 0 || appScreen == -1 ) ) + { + firstAppWgId = wgId; // firstAppWgId should be the top windows group id. + } + + CleanupStack::PopAndDestroy(); //windowName + } + } + CleanupStack::PopAndDestroy( 2 ); // allWgIds, *allWgIds + + __VTPRINTEXIT( "VtUi.GetFocusWindowGroupId" ) + return firstAppWgId; + } + + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::PreHandleKeyEventL +// +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::PreHandleKeyEventL( const TWsEvent& aEvent ) + { + __VTPRINTENTER( "VtUi.PreHandleKeyEventL" ) + TBool consumed( EFalse ); + switch( aEvent.Type() ) + { + + case EEventKey: + { + // when both these are set, then it's our simulated key press + const TInt + modifiers( EModifierKeypad | EModifierSpecial ); + + const TKeyEvent* ptrKeyEventC = + aEvent.Key(); + + const TBool isHwZoomKey( + ptrKeyEventC->iCode == EKeyZoomIn || + ptrKeyEventC->iCode == EKeyZoomOut ); + + if ( isHwZoomKey && + ( ptrKeyEventC->iModifiers & modifiers ) != modifiers ) + { + __VTPRINT3( DEBUG_GEN, "VtUi.PreHandleKeyEventL keyc=%d scanc=%d", + ptrKeyEventC->iCode, ptrKeyEventC->iScanCode ) + consumed = ETrue; + + // Send EEventKeyDown only when iRepeats is 0 + if ( !ptrKeyEventC->iRepeats ) + { + TKeyEvent keyDownEvent( *ptrKeyEventC ); + keyDownEvent.iRepeats = 0; + iCoeEnv->SimulateKeyEventL( keyDownEvent, EEventKeyDown ); + } + + // Send EEventKey always + TKeyEvent keyEvent( *ptrKeyEventC ); + keyEvent.iModifiers |= modifiers; + iCoeEnv->SimulateKeyEventL( keyEvent, EEventKey ); + + // Que EEventKeyUp + TKeyEvent keyUpEvent( *ptrKeyEventC ); + keyUpEvent.iRepeats = 0; + StoreKeyEventL( keyUpEvent ); + } + else if ( ( ptrKeyEventC->iModifiers & modifiers ) == modifiers ) + { + __VTPRINT( DEBUG_GEN, + "VtUi.PreHandleKeyEventL own event spotted, removing mods" ) + // event is generated by us, remove modifiers + TKeyEvent* ptrKeyEvent = const_cast< TKeyEvent* >( ptrKeyEventC ); + ptrKeyEvent->iModifiers &= ~modifiers; + } + } + break; + + case EEventKeyUp: + if ( iIsStoredKeyEvent ) + { + if ( iStoredKeyEvent.iScanCode == aEvent.Key()->iScanCode ) + { + consumed = ETrue; + SimulateStoredKeyEventL( EEventKeyUp ); + } + } + break; + + default: + break; + + } + + __VTPRINTEXITR( "VtUi.PreHandleKeyEventL %d", consumed ) + return consumed; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::SimulateStoredKeyEventL +// +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SimulateStoredKeyEventL( const TEventCode aEventCode ) + { + __VTPRINTENTER( "VtUi.SimulateStoredKeyEventL" ) + if ( iIsStoredKeyEvent ) + { + // Reset flag first because SimulateKeyEventL() is synchronous + iIsStoredKeyEvent = EFalse; + iCoeEnv->SimulateKeyEventL( iStoredKeyEvent, aEventCode ); + } + __VTPRINTEXITR( "VtUi.SimulateStoredKeyEventL %d", iIsStoredKeyEvent ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::StoreKeyEventL +// +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::StoreKeyEventL( const TKeyEvent& aKeyEvent ) + { + __VTPRINTENTER( "VtUi.StoreKeyEventL" ) + if ( iIsStoredKeyEvent && ( iStoredKeyEvent.iCode != aKeyEvent.iCode ) ) + { + SimulateStoredKeyEventL( EEventKeyUp ); + } + + if ( !iIsStoredKeyEvent ) + { + iIsStoredKeyEvent = ETrue; + iStoredKeyEvent = aKeyEvent; + } + __VTPRINTEXITR( "VtUi.StoreKeyEventL %d", iIsStoredKeyEvent ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DoTryToStartTb +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::DoTryToStartTbL( TAny* aAny ) + { + CVtUiAppUi* self = static_cast< CVtUiAppUi* >( aAny ); + self->TryToStartTbL(); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::UpdateVBSettingL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::UpdateVBSettingL() + { + // If white balance or color tone setting + // feauture exists update setting + CVtUiWhiteBalance* wb = static_cast< CVtUiWhiteBalance* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdWhiteBalance ) ); + + CVtUiColorTone* ct = static_cast< CVtUiColorTone* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdColourTone ) ); + + // If brightness or contrast slider + // feauture exists update them + CVtUiBrightness* br = static_cast< CVtUiBrightness* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdBrightness ) ); + + CVtUiContrast* contr = static_cast< CVtUiContrast* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdContrast ) ); + + + + if ( wb && wb->State() == MVtUiFeature::EActive ) + { + if ( iUiStates->IsWhiteBalanceSettingAvailable() ) + { + __VTPRINT( DEBUG_GEN,"VtUi.UpdateVBSettingL WB update" ) + wb->UpdateSettingL(); + } + } + + if ( ct && ct->State() == MVtUiFeature::EActive ) + { + if ( iUiStates->IsColorToneSettingAvailable() ) + { + __VTPRINT( DEBUG_GEN,"VtUi.UpdateVBSettingL CT update" ) + ct->UpdateSettingL(); + } + } + + if ( br && br->State() == MVtUiFeature::EActive ) + { + if ( iUiStates->IsBrightnessSettingAvailable() ) + { + __VTPRINT( DEBUG_GEN,"VtUi.UpdateVBSettingL br update" ) + br->UpdateSlider(); + } + } + + if ( contr && contr->State() == MVtUiFeature::EActive ) + { + if ( iUiStates->IsContrastSettingAvailable() ) + { + __VTPRINT( DEBUG_GEN,"VtUi.UpdateVBSettingL contract update" ) + contr->UpdateSlider(); + } + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::TryToStartTb +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::TryToStartTbL() + { + __VTPRINTENTER( "VtUi.TryToStartTbL" ) + CVtUiToolbarBase* tb = static_cast< CVtUiToolbarBase* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdToolbar ) ); + if ( tb ) + { + // If menu, dialog or dialer is displayed do not start the toolbar, + // but let the timer run another round + CEikMenuBar* menuBar = iEikonEnv->AppUiFactory()->MenuBar(); + if ( !( menuBar && menuBar->IsDisplayed() ) && + !IsDisplayingDialog() && + !( + iUiStates->IsDialerActivating() || + iUiStates->IsDialerOpen() || + iUiStates->IsWhiteBalanceModeOn() || + iUiStates->IsColorToneModeOn() || + iUiStates->IsBrightnessModeOn() || + iUiStates->IsContrastModeOn() || + iUiStates->IsZoomModeOn() || + iUiStates->IsVolumeModeOn() || + iUiStates->IsCaptureModeOn() ) + ) + { + if ( iTbPeriodic ) + { + iTbPeriodic->Cancel(); + } + tb->StartL(); + } + } + __VTPRINTEXIT( "VtUi.TryToStartTbL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ReTryToStartTbL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RetryToStartTbL() + { + // only with fixed toolbar + if ( AknLayoutUtils::PenEnabled() ) + { + if ( iUiStates->IsFixedToolbarVisible()) + { + // When option menu is opened fixed toolbar should + // be set hidden + iUiStates->SetIsFixedToolbarVisible( EFalse ); + // Stop toolbar + MVtUiFeature* tb = + iFeatureManager->GetFeatureById( EVtUiFeatureIdToolbar ); + if ( tb ) + { + // timer could be active + if ( iTbPeriodic ) + { + iTbPeriodic->Cancel(); + } + tb->Stop(); + } + if ( !iTbPeriodic ) + { + iTbPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + } + // Toolbar doesn't come visible until options menu is closed. + iTbPeriodic->Start( KStartTime, KPeriodTime, TCallBack( DoTryToStartTbL, this ) ); + } + } + else + { + StopSliders(); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::SetRenderingModeL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SetRenderingModeL( const TRenderingMode aMode, + MVtUiVideoWindow* aNewDownlink ) + { + __VTPRINTENTER( "VtUi.SetRenderingModeL" ) + __VTPRINT2( DEBUG_GEN, "VtUi.SetRenderingModeL=%d", aMode ); + iRenderingMode = aMode; + + TInt pos = + iInstance->iRemoteVideoControl->DrawableWindow()->OrdinalPosition(); + + if ( aNewDownlink ) + { + if ( iDownlinkWindow != aNewDownlink ) + { + iStoredDownlinkWindow = iDownlinkWindow; + iDownlinkWindow = aNewDownlink; + iStoredDownlinkWindow->SetRemoteVideoControl(NULL); + iDownlinkWindow->SetRemoteVideoControl(iInstance->iRemoteVideoControl); + iDownlinkWindow->LayoutRemoteVideo(); + } + } + RefreshBlind(); + UpdateRenderingParametersL(); + + // Raise the menu priority, otherwise the remote video control may + // overlay the menu pane + CEikMenuBar* menuBar = iEikonEnv->AppUiFactory()->MenuBar(); + if ( menuBar && menuBar->IsDisplayed() ) + { + TInt mpPos = menuBar->MenuPane()->DrawableWindow()->OrdinalPosition(); + menuBar->MenuPane()->DrawableWindow()->SetOrdinalPosition( mpPos, + KVtUiRemoteVideoControlOrdinalPriHigh ); // Pri = 1 + } + + if ( aMode == ERenderingModeDialer ) + { + // Remote video control has the highest priority in dialer + iInstance->iRemoteVideoControl->DrawableWindow()->SetOrdinalPosition( + pos, KVtUiRemoteVideoControlOrdinalPriHigh ); + } + else + { + // Set remote video control priority back to normal + iInstance->iRemoteVideoControl->DrawableWindow()->SetOrdinalPosition( + pos, KVtUiRemoteVideoControlOrdinalPriNormal ); + } + + __VTPRINTEXIT( "VtUi.SetRenderingModeL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::UpdateRenderingParametersL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::UpdateRenderingParametersL() + { + __VTPRINTENTER( "VtUi.UpdateRenderingParametersL" ) + + MVtEngMedia& media = Model().Media(); + const TBool viewFinderStarted = + media.RenderingStarted( MVtEngMedia::EMediaOutgoing ); + const TBool remoteRenderStarted = + media.RenderingStarted( MVtEngMedia::EMediaIncoming ); + + // Clear bitmaps + iInstance->iContextControl->SetStreamBitmap( NULL ); + iInstance->iMainControl->SetStreamBitmap( NULL ); + + // Stop viewfinder & remote render. + if( viewFinderStarted ) + { + ExecuteCmdL( KVtEngStopViewFinder ); + } + ExecuteCmdL( KVtEngStopRenderRemote ); + + // Re-layout the remote video + iDownlinkWindow->LayoutRemoteVideo(); + + const TBool uplinkWindowEqualsContextControl = + ( iUplinkWindow == iInstance->iContextControl ); + + // Prepare viewfinder. + TVtEngRenderingOptions configViewfinder( + uplinkWindowEqualsContextControl ? + DetermineContextControlOptions() : + DetermineMainControlOptions( EFalse ) ); + ExecuteCmdL( KVtEngPrepareViewFinder, configViewfinder ); + + // Prepare remote render. + TRAPD ( err, { + TVtEngRenderingOptionsNGA configRemoteRenderNGA( + DetermineRemoteVideoControlOptionsNGA() ); + ExecuteCmdL( + KVtEngPrepareRemoteRenderNGA, + configRemoteRenderNGA ); + } ); + if ( err != KErrNone ) + { + if ( viewFinderStarted ) + { + // Start viewfinder. + ExecuteCmdL( KVtEngStartViewFinder ); + } + User::Leave ( err ); + } + + // Start remote render. + TRAP_IGNORE( ExecuteCmdL( KVtEngStartRenderRemote ) ); + + if ( viewFinderStarted ) + { + // Start viewfinder. + ExecuteCmdL( KVtEngStartViewFinder ); + } + + // Redraw remote video last frame to make sure that in layout change + // situation we still have something on screen. + iDownlinkWindow->Redraw(); + __VTPRINTEXIT( "VtUi.UpdateRenderingParametersL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::MediaStateChangedL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::MediaStateChangedL() + { + CEikMenuBar* menuBar = iEikonEnv->AppUiFactory()->MenuBar(); + // close menu if it is shown + if ( menuBar && menuBar->IsDisplayed() ) + { + TKeyEvent keyEvent; + keyEvent.iCode = EKeyEscape; + menuBar->OfferKeyEventL( keyEvent, EEventKey ); + } + // Refresh toolbar + CVtUiToolbarBase* tb = static_cast< CVtUiToolbarBase* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdToolbar ) ); + if ( tb ) + { + tb->RefreshL(); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ProcessCommandL +// Processes commands. +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ProcessCommandL( + TInt aCommand ) + { + __VTPRINTENTER( "VtUi.ProcessCommandL" ) + + // delay mute cmd received during layout change + if ( aCommand == EAknSoftkeyOptions ) + { + if ( iLayoutChg ) + { + iDelayedCmd = EAknSoftkeyOptions; + __VTPRINTEXIT( "VtUi.ProcessCommandL mute delayed due to LayoutChange" ) + return; + } + } + + MVtEngCommandHandler& command = Model().CommandHandler(); + command.ExecuteL( KVtEngRequestLastRemoteFrame, NULL ); + + RetryToStartTbL(); + + iInstance->iMainControl->SetSize( iInstance->iMainControl->Size() ); + iInstance->iMainControl->DrawNow(); + + // Handle OK options menu. + const TInt menuResource = + iUiStates->IsLaunchOkOptionsMenu() ? + R_VIDEOTELUI_OK_MENUBAR : + R_VIDEOTELUI_MENUBAR; + + iUiStates->SetLaunchOkOptionsMenu( EFalse ); + + CEikMenuBar* menu = iEikonEnv->AppUiFactory()->MenuBar(); + if ( menu ) + { + menu->SetMenuTitleResourceId( menuResource ); + //Here we again set back the type of menu to "Options" when pressed LSK + menu->SetMenuType( CEikMenuBar::EMenuOptions ); + } + CAknAppUi::ProcessCommandL( aCommand ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::IsActiveCommand +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::IsActiveCommand( TInt aCommand ) const + { + return ( iActiveCommands.FindInOrder( aCommand ) != KErrNotFound ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::State +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase& CVtUiAppUi::State() + { + return *iState; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::BitmapManager +// ----------------------------------------------------------------------------- +// +CVtUiBitmapManager& CVtUiAppUi::BitmapManager() + { + return *iInstance->iBitmapManager; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::TActiveCommand::TActiveCommand +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::TActiveCommand::TActiveCommand( RArray< TInt >& aActiveCommands, + TInt aCommandId ) + : iActiveCommands( aActiveCommands ), iCommandId( aCommandId ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::TActiveCommand::~TActiveCommand +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::TActiveCommand::~TActiveCommand() + { + Close(); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::TActiveCommand::OpenL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::TActiveCommand::OpenL() + { + iActiveCommands.InsertInOrderL( iCommandId ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::TActiveCommand::Close +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::TActiveCommand::Close() + { + TInt index( iActiveCommands.FindInOrder( iCommandId ) ); + if ( index != KErrNotFound ) + { + iActiveCommands.Remove( index ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleCommandL +// Handles commands. +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleCommandL( + TInt aCommand ) + { + __VTPRINTENTER( "VtUi.HandleCommand" ) + __VTPRINT2( DEBUG_GEN, "VtUi.HandleCommand.Cmd=%d", aCommand ); + // Check if same command is already being performed. + if ( IsActiveCommand( aCommand ) || ( iState && + iState->HandleCommandL( aCommand ) == + TVtUiAppStateBase::EEventHandled ) ) + { + __VTPRINTEXIT( "VtUi.HandleCommand 0" ) + return; + } + + // Check if command is allowed to be performed. + if ( !IsCommandAllowedL( aCommand ) ) + { + ShowNotAllowedNoteL(); + __VTPRINTEXITR( "VtUi.HandleCommand %d", KErrAccessDenied ) + return; + } + + // delay mute cmd received during layout change (EGWG-7QQ3GZ) + if ( (aCommand == EVtUiCmdDisableAudio) || (aCommand == EVtUiCmdUsePrimaryCamera) + ||(aCommand == EVtUiCmdUseSecondaryCamera) + ||(aCommand == EVtUiCmdDisableVideo) ) + { + if ( iLayoutChg ) + { + iDelayedCmd = aCommand; + __VTPRINTEXIT( "VtUi.HandleCommand mute delayed due to LayoutChange" ) + return; + } + } + + TActiveCommand activeCommand( iActiveCommands, aCommand ); + // Close() will be called by the destructor, when instance goes out of + // scope + activeCommand.OpenL(); + + TBool refresh = EFalse; + CleanupPushRefreshL(); + + // Execute command + switch ( aCommand ) + { + case EAknCmdHelp: + CmdHelpL(); + break; + + case EVtUiCmdOkOptions: + iUiStates->SetLaunchOkOptionsMenu( ETrue ); + ProcessCommandL( EAknSoftkeyOptions ); + break; + + case EVtUiCmdEnableMain: + case EVtUiCmdDisableMain: + // Submenu is opened automatically. + break; + + case EVtUiCmdEnableVideo: + { + MVtEngMedia::TShareObjectState shareObjectState; + VtUiUtility::GetObjectSharingState( Model().Media(), + shareObjectState ); + if( shareObjectState != MVtEngMedia::ESharingImage ) + { + refresh = ETrue; + EnableCommandActivatingAndCleanupPushL(); + CmdEnableVideoL(); + CleanupStack::PopAndDestroy(); + } + else + { + CmdStopShareImageL( refresh ); + EnableCommandActivatingAndCleanupPushL(); + CmdEnableVideoL(); + CleanupStack::PopAndDestroy(); + } + } + break; + + case EVtUiCmdEnableAudio: + refresh = ETrue; + CmdEnableAudioL(); + break; + + case EVtUiCmdEnableBoth: + EnableCommandActivatingAndCleanupPushL(); + CmdEnableAudioL(); + MVtEngMedia::TShareObjectState shareObjectState; + VtUiUtility::GetObjectSharingState( Model().Media(), + shareObjectState ); + if( shareObjectState != MVtEngMedia::ESharingImage ) + { + refresh = ETrue; + CmdEnableVideoL(); + } + else + { + CmdStopShareImageL( refresh ); + CmdEnableVideoL(); + } + // EnableCommandActivatingAndCleanupPushL + CleanupStack::PopAndDestroy(); + break; + + case EVtUiCmdDisableVideo: + refresh = ETrue; + EnableCommandActivatingAndCleanupPushL(); + CmdDisableVideoL(); + CleanupStack::PopAndDestroy(); + break; + + case EVtUiCmdDisableAudio: + refresh = ETrue; + EnableCommandActivatingAndCleanupPushL(); + CmdDisableAudioL(); + CleanupStack::PopAndDestroy(); + break; + + case EVtUiCmdDisableBoth: + refresh = ETrue; + EnableCommandActivatingAndCleanupPushL(); + CmdDisableVideoL(); + CmdDisableAudioL(); + CleanupStack::PopAndDestroy(); + break; + + case EVtUiCmdActivateBT: + refresh = ETrue; + EnableCommandActivatingAndCleanupPushL(); + CmdActivateBtL(); + CleanupStack::PopAndDestroy(); + break; + + case EVtUiCmdDeactivateBT: + refresh = ETrue; + EnableCommandActivatingAndCleanupPushL(); + CmdDeactivateBtL(); + CleanupStack::PopAndDestroy(); + break; + + case EVtUiCmdActivateLoudspeaker: + case EVtUiCmdSwitchFromBTToIHF: + refresh = ETrue; + EnableCommandActivatingAndCleanupPushL(); + CmdActivateLoudspeakerL(); + CleanupStack::PopAndDestroy(); + break; + + case EVtUiCmdDeactivateLoudspeaker: + refresh = ETrue; + EnableCommandActivatingAndCleanupPushL(); + CmdDeactivateLoudspeakerL(); + CleanupStack::PopAndDestroy(); + break; + + case EVtUiCmdUsePrimaryCamera: + refresh = ETrue; + CmdUseCameraL( ETrue ); + break; + + case EVtUiCmdUseSecondaryCamera: + refresh = ETrue; + CmdUseCameraL( EFalse ); + break; + + case EVtUiCmdSwapImagesPlaces: + { + refresh = ETrue; + CleanupPushEnableBlindL(); + iUiStates->SetDisableBlindSetting( ETrue ); + CmdSwapImagesPlacesL(); + + MVtEngMedia& media = Model().Media(); + if ( VtUiUtility::GetFreezeState( media ) ) + { + TBool isViewFinderInContextPane = IsViewFinderInContextPane(); + iUiStates->SetViewFindersInitialPlaceContextPane( isViewFinderInContextPane ); + } + + CleanupStack::PopAndDestroy(); // CleanupPushEnableBlindL + } + break; + + case EVtUiCmdZoom: + refresh = ETrue; + // Toolbar uses this same command to set zoom on and off + // therefore this works as a toggle button + SetZoomModeL( !iUiStates->IsZoomModeOn() ); + + break; + + case EAknSoftkeyBack: + { + refresh = ETrue; + MVtUiFeature* numberEntry = + iFeatureManager->GetFeatureById( EVtUiFeatureIdNumberEntry ); + if ( numberEntry ) + { + numberEntry->Stop(); + } + } + break; + + case EVtUiCmdSnapshot: + EnableCommandActivatingAndCleanupPushL(); + CmdSnapshotL(); + // EnableCommandActivatingAndCleanupPushL + CleanupStack::PopAndDestroy(); + break; + + case EVtUiCmdCapture: + CmdCaptureL(); + break; + + case EVtUiCmdCancelCapture: + CmdCancelCaptureL(); + break; + + case EVtUiCmdGoToIdle: + CmdGoToIdleL(); + break; + + // Dial emergency call + case EVtUiCmdDialerEmergencyCall: + __VTPRINT( DEBUG_GEN, "VtUiHandleCommand.CmdEmergencyCall" ); + CmdSimulateKeyEvent( EStdKeyYes ); + break; + // Object sharing related + + case EVtUiCmdShareObjectImage: + CmdInitializeShareImageL( refresh ); + break; + + case EVtUiCmdStopSharingObjectImage: + EnableCommandActivatingAndCleanupPushL(); + CmdStopShareImageL( refresh ); + // EnableCommandActivatingAndCleanupPushL + CleanupStack::PopAndDestroy(); + break; + + case EVtUiCmdAdjustVideoVideoQuality: + case EVtUiCmdAdjustVideoWhiteBalance: + case EVtUiCmdAdjustVideoBrightness: + case EVtUiCmdAdjustVideoContrast: + case EVtUiCmdAdjustVideoColourTone: + __VTPRINT( DEBUG_GEN, "VtUiHandleCommand.CmdAdjustVideoL" ); + CmdAdjustVideoL( aCommand ); + break; + + case EAknSoftkeyExit: + case EAknCmdExit: + case EEikCmdExit: + // handled by state + break; + + default: + iCommandManager->HandleCommandL( aCommand ); + break; + } + + if ( refresh ) + { + CleanupStack::PopAndDestroy(); // CleanupPushRefreshL + } + else + { + CleanupStack::Pop(); // CleanupPushRefreshL + } + __VTPRINTEXITR( "VtUi.HandleCommand %d", KErrNone ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DynInitMenuPaneL +// Initialises menu pane dynamically. +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::DynInitMenuPaneL( + TInt, + CEikMenuPane* aMenuPane ) + { + __VTPRINTENTER( "VtUi.DynInitMenuPaneL" ) + + CVtUiMenus* menus = static_cast< CVtUiMenus* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdMenu ) ); + if ( menus ) + { + iUiStates->Update(); + menus->SetMenuPane( aMenuPane ); + menus->RefreshL(); + } + __VTPRINTEXIT( "VtUi.DynInitMenuPaneL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleKeyEventL +// Handles key events. +// ----------------------------------------------------------------------------- +// +TKeyResponse CVtUiAppUi::HandleKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + __VTPRINTENTER( "VtUi.HandleKeyEventL" ) + + TKeyResponse resp( EKeyWasNotConsumed ); + + if ( !iUiStates->IsNumberEntryOpen() || + ( iUiStates->IsNumberEntryOpen() && !ShowNumberEntry() ) ) + { + __VTPRINT( DEBUG_GEN, "VtUi.ToZoom" ) + + const TBool isHwZoomKey( aKeyEvent.iCode == EKeyZoomIn || + aKeyEvent.iCode == EKeyZoomOut ); + + // if outgoing video is frozen disable zoom + MVtEngMedia& media = Model().Media(); + if ( VtUiUtility::GetFreezeState ( media ) ) + { + if ( aKeyEvent.iScanCode == EStdKeyUpArrow || + aKeyEvent.iScanCode == EStdKeyDownArrow || + isHwZoomKey ) + { + __VTPRINTEXITR( "VtUi.HandleKeyEventL %d", EKeyWasConsumed ) + return EKeyWasConsumed; + } + } + + // Handle volume up & down + + } + + // If key event it not yet consumed, offer it to component manager + if ( resp == EKeyWasNotConsumed ) + { + resp = iComponentManager->OfferKeyEventL( aKeyEvent, aType ); + } + + __VTPRINTEXITR( "VtUi.HandleKeyEventL %d", resp ) + return resp; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleResourceChangeL +// Handles change of a resource. +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleResourceChangeL( + TInt aType ) + { + __VTPRINTENTER( "VtUi.HandleResourceChangeL" ) + const TBool layoutChange = + aType == KEikDynamicLayoutVariantSwitch || + aType == KAknsMessageSkinChange; + if ( iInstance && layoutChange ) + { + iInstance->iBitmapManager->InvalidateBitmaps(); + } + + CAknAppUi::HandleResourceChangeL( aType ); + + if ( iInstance ) + { + if ( layoutChange ) + { + if ( CurrentFixedToolbar() ) + { + CurrentFixedToolbar()->HandleResourceChange( aType ); + } + CVtUiToolbarBase* tb = static_cast< CVtUiToolbarBase* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdToolbar ) ); + if( tb ) + { + tb->HandleLayoutChangeL(); + } + // Relayout controls + iBlankControl->SetRect( ClientRect() ); + iInstance->LayoutChanged(); + } + if ( iInstance->iNaviPane ) + { + iInstance->iNaviPane->HandleResourceChange( aType ); + } + } + iComponentManager->HandleResourceChangeL( aType ); + + // Handle layout change only when type == DLVS + if ( iInstance && aType == KEikDynamicLayoutVariantSwitch ) + { + (void) DelayedHandleLayoutChanged( this ); + } + __VTPRINTEXIT( "VtUi.HandleResourceChangeL"); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleForegroundEventL +// Handles foreground status change. +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleForegroundEventL( TBool aForeground ) + { + CAknAppUi::HandleForegroundEventL( aForeground ); + + if ( !aForeground ) + { + StopDtmfTone(); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::GetEikonEnv +// ----------------------------------------------------------------------------- +// +CEikonEnv* CVtUiAppUi::GetEikonEnv() + { + return iEikonEnv; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::GetCba +// ----------------------------------------------------------------------------- +// +CEikButtonGroupContainer* CVtUiAppUi::GetCba() + { + return iCba; + } + +// +// ----------------------------------------------------------------------------- +// CVtUiAppUi::SetZoomModeL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SetZoomModeL( const TBool aEnableZoomMode, + const TBool aIsPermanent ) + { + __VTPRINTENTER( "VtUi.SetZoomModeL" ) + __VTPRINT2( DEBUG_GEN, "VtUi.SetZoomMo=%d", aEnableZoomMode ); + // If capture mode is on zoom mode cannot be changed + if ( iUiStates->IsCaptureModeOn() ) + { + __VTPRINTEXIT( "VtUi.SetZoomModeL.CaptureOn" ) + return; + } + CVtUiZoom* zoom = static_cast< CVtUiZoom* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdZoom ) ); + if ( zoom ) + { + if ( aEnableZoomMode ) + { + if( aIsPermanent ) + { + zoom->SetPermanenVisibility( aEnableZoomMode ); + } + zoom->StartL(); + } + else + { + if( aIsPermanent ) + { + zoom->SetPermanenVisibility( aEnableZoomMode ); + } + zoom->Stop(); + } + } + iUiStates->SetZoomModeOn( aEnableZoomMode ); + CVtUiToolbarBase* tb = static_cast< CVtUiToolbarBase* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdToolbar ) ); + if ( tb ) + { + tb->RefreshL(); + } + + __VTPRINTEXIT( "VtUi.SetZoomModeL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HelpContextL +// Returns help context array. +// ----------------------------------------------------------------------------- +// +CArrayFix* CVtUiAppUi::HelpContextL() const + { + CArrayFix* array = + new ( ELeave ) CArrayFixFlat( KVtUiHelpContextAmount ); + CleanupStack::PushL( array ); + + array->AppendL( + TCoeHelpContext( + KVtUiTelephoneUid, + KINCAL_HLP_VIDEO_CALL ) ); + + CleanupStack::Pop( array ); + return array; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecExecuteL +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::ActiveExecExecuteL( + CVtUiActiveExec& /*aActiveExec*/, + const TInt aState, + TInt& aNextState, + TRequestStatus& aRequest ) + { + return ActiveExecInitExecuteL( + aState, + aNextState, + aRequest ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecContinue +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::ActiveExecContinue( + CVtUiActiveExec& /*aActiveExec*/, + TInt& aState, + const TInt aError ) + { + return ActiveExecInitContinue( aState, aError ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecCancel +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ActiveExecCancel( + CVtUiActiveExec& /*aActiveExec*/, + TInt aState ) + { + ActiveExecInitCancel( aState ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecDone +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ActiveExecDone( + CVtUiActiveExec& /*aActiveExec*/, + const TInt aInitialState ) + { + ActiveExecInitDone( aInitialState ); + } + +// state object service handlers + + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ShutdownL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ShutdownL() + { + __VTPRINTENTER( "VtUi.ShutdownL" ) + + CVtUiWhiteBalance* wb = static_cast< CVtUiWhiteBalance* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdWhiteBalance ) ); + CVtUiColorTone* ct = static_cast< CVtUiColorTone* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdColourTone ) ); + + if ( wb && wb->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "CVtUiWhiteBalance::DoDeactivateL" ); + wb->Stop(); + } + if ( ct && ct->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "CVtUiColorTone::DoDeactivateL" ); + ct->Stop( ); + } + + // close volume slider + CVtUiVolume* volume = static_cast< CVtUiVolume* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdVolume ) ); + if ( volume ) + { + volume->Stop(); + } + // if capture mode is on stop the zoom + if ( iUiStates->IsCaptureModeOn() ) + { + CVtUiZoom* zoom = static_cast< CVtUiZoom* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdZoom ) ); + if ( zoom ) + { + zoom->Stop(); + } + } + + iActiveExec->Start( EVtUiAppUiShutdown, *this ); + __VTPRINTEXIT( "VtUi.ShutdownL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::StartupPhase1L +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::StartupPhase1L() + { + __VTPRINTENTER( "VtUi.StartupPhase1L" ) + iActiveExec->Start( EVtUiAppUiStartup, *this ); + __VTPRINTEXIT( "VtUi.StartupPhase1L" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::StartupPhase2L +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::StartupPhase2L() + { + __VTPRINTENTER( "VtUi.StartupPhase2L" ) + iActiveExec->Start( EVtUiAppUiAnswered, *this ); + __VTPRINTEXIT( "VtUi.StartupPhase2L" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ChangeState +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ChangeState( TVtUiAppStateBase* aState ) + { + __VTPRINTENTER( "VtUi.ChangeState" ) + iState = aState; + __VTPRINTEXIT( "VtUi.ChangeState" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::IsCommandAllowedL +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::IsCommandAllowedL( const TInt aCommand ) + { + return iCommandManager->IsCommandAllowedL( aCommand ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RefreshDisabledFlagsL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RefreshDisabledFlagsL() + { + // Refresh iDisabledFlags according to the current state. + TInt avail; + MVtEngMedia& media = Model().Media(); + VtUiUtility::GetOutgoingMediaState( media, avail ); + avail = ~avail; + + iDisabledFlags = 0; + if ( avail & MVtEngMedia::EMediaAudio ) + { + iDisabledFlags |= EDisabledAudio; + } + if ( avail & MVtEngMedia::EMediaVideo ) + { + iDisabledFlags |= EDisabledVideo; + } + + // If there are not cameras, then video options should be disabled. + if ( !VtUiUtility::HasCameras( media ) ) + { + iDisabledFlags |= EVideoOptionsDisabled; + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RefreshCameraOptionAvailability +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RefreshCameraOptionAvailability( + TBool& aUsePrimaryCameraNotAllowed, + TBool& aUseSecondaryCameraNotAllowed ) + { + aUsePrimaryCameraNotAllowed = ETrue; + aUseSecondaryCameraNotAllowed = ETrue; + + // Check sources caps and current camera to see which + // items should be included to the menu. + + TInt sourcesCaps = 0; + MVtEngMedia& media = Model().Media(); + (void) media.GetSourcesCaps( sourcesCaps ); + + MVtEngMedia::TCameraId cameraId; + const TBool hasCameraId = + ( media.GetCurrentCameraId( cameraId ) == KErrNone ); + + if ( hasCameraId ) + { + // Camera is in use. Now selected camera is not included + // to the menu. + switch ( cameraId ) + { + case MVtEngMedia::EPrimaryCamera: + sourcesCaps &= + ~MVtEngMedia::ESourceCapsPrimaryCamera; + break; + + case MVtEngMedia::ESecondaryCamera: + sourcesCaps &= + ~MVtEngMedia::ESourceCapsSecondaryCamera; + break; + + default: + sourcesCaps = 0; + break; + } + } + else + { + // If camera is not in use, then the "enable video" option + // will automatically use one of the existing cameras. + // However, if there are two cameras, then we need + // to include secondary to the menu. + + const TInt bothCameras = + ( MVtEngMedia::ESourceCapsPrimaryCamera | + MVtEngMedia::ESourceCapsSecondaryCamera ); + sourcesCaps &= ~bothCameras; + if ( sourcesCaps == bothCameras ) + { + sourcesCaps &= + ~MVtEngMedia::ESourceCapsPrimaryCamera; + } + else + { + sourcesCaps = 0; + } + } + + sourcesCaps = ~sourcesCaps; + aUsePrimaryCameraNotAllowed = + ( sourcesCaps & MVtEngMedia::ESourceCapsPrimaryCamera ); + aUseSecondaryCameraNotAllowed = + ( sourcesCaps & MVtEngMedia::ESourceCapsSecondaryCamera ); + } + +// ----------------------------------------------------------------------------- +// VtUiAppUi::CmdCaptureL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdCaptureL() + { + //firstly need to know if underlying provider supports KVtEngFreeze + MVtEngCommandHandler& command = Model().CommandHandler(); + const TInt caps = command.GetCommandCaps( KVtEngFreeze ); + if ( (caps & MVtEngCommandHandler::EAttribEnabled) == 0) + { + return; + } + // end capture mode, image captured + iUiStates->SetCaptureModeOn( EFalse ); + // end zoom mode + SetZoomModeL( EFalse, ETrue ); + // freeze outgoing video + ExecuteCmdL( KVtEngFreeze ); + RefreshBlind(); + } + +// ----------------------------------------------------------------------------- +// VtUiAppUi::CmdSnapshotL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdSnapshotL() + { + __VTPRINTENTER( "VtUi.CmdSnapshotL" ) + + // zoom mode must be set on before capture mode is set on + SetZoomModeL( ETrue, ETrue ); + + // set capture mode on + iUiStates->SetCaptureModeOn( ETrue ); + + // if outgoing video is already frozen + MVtEngMedia& media = Model().Media(); + const TBool isFrozen( VtUiUtility::GetFreezeState( media ) ); + if ( isFrozen ) + { + ExecuteCmdL( KVtEngUnfreeze ); + } + if ( iUiStates->IsCaptureModeOn() ) + { + if ( !IsViewFinderInMainPane() ) + { + SwitchViewFinderToMainPaneL( !isFrozen ); + } + else if ( !isFrozen ) + { + iUiStates->SetViewFindersInitialPlaceContextPane( EFalse ); + } + } + + RefreshStatesL(); + RefreshBlind(); + __VTPRINTEXIT( "VtUi.CmdSnapshotL" ) + } + +// ----------------------------------------------------------------------------- +// VtUiAppUi::CmdCancelCaptureL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdCancelCaptureL() + { + __VTPRINTENTER( "VtUi.CmdCancelCaptureL" ) + // end capture mode, image capture canceled + iUiStates->SetCaptureModeOn( EFalse ); + SetZoomModeL( EFalse, ETrue ); + RefreshStatesL(); + RestoreViewFinderL(); + RefreshBlind(); + __VTPRINTEXIT( "VtUi.CmdCancelCaptureL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdEnableVideoL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdEnableVideoL() + { + // if outgoing video is frozen + MVtEngMedia& media = Model().Media(); + if ( VtUiUtility::GetFreezeState( media ) ) + { + ExecuteCmdL( KVtEngUnfreeze ); + // swap images if needed + RestoreViewFinderL(); + } + else + { + ExecuteCmdL( KVtEngStopViewFinder ); + iUplinkWindow->SetStreamBitmap( NULL ); + MVtEngMedia::TMediaSource source = MVtEngMedia::EMediaCamera; + ExecuteCmdL( KVtEngSetSource, source ); + MVtEngMedia::TCameraId id; + if ( Model().Media().GetCurrentCameraId( id ) == KErrInUse ) + { + ShowCameraInUseNoteL(); + } + ExecuteCmdL( KVtEngStartViewFinder ); + } + // update VB settings + UpdateVBSettingL(); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdEnableAudioL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdEnableAudioL() + { + ExecuteCmdL( KVtEngUnmuteOutgoingAudio ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdDisableVideoL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdDisableVideoL() + { + iDisableVideoOngoing = ETrue; + if( iUiStates->IsZoomModeOn() ) + { + // if zoom feature is active, stop that + MVtUiFeature* zm = iFeatureManager->GetFeatureById( EVtUiFeatureIdZoom ); + if ( zm ) + { + if ( zm->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "VtUi.CmdDisableVideoL zm->STOP" ) + zm->Stop(); + } + } + } + + ExecuteCmdL( KVtEngStopViewFinder ); + + iUplinkWindow->SetStreamBitmap( NULL ); + + TInt err = KErrNotFound; + if ( VtUiUtility::HasStillImage( Model().Media() ) ) + { + __VTPRINT( DEBUG_GEN, "VtUi.:CmdDisableVideoL.HasStill" ) + MVtEngMedia::TMediaSource source = MVtEngMedia::EMediaStillImage; + TRAP( err, ExecuteCmdL( KVtEngSetSource, source ) ); + } + if ( ( err != KErrNone ) ) + { + __VTPRINT( DEBUG_GEN, "VtUi.:CmdDisableVideoL.MediaNone" ) + MVtEngMedia::TMediaSource source = MVtEngMedia::EMediaNone; + ExecuteCmdL( KVtEngSetSource, source ); + } + + ExecuteCmdL( KVtEngStartViewFinder ); + iDisableVideoOngoing = EFalse; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdDisableAudioL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdDisableAudioL() + { + ExecuteCmdL( KVtEngMuteOutgoingAudio ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdActivateBtL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdActivateBtL() + { + TInt error = KErrNone; + CVtUiActivateBtHfDialog* dialog = + new ( ELeave ) CVtUiActivateBtHfDialog( + NULL, + &error, + Model().CommandHandler(), + *iEventObserver ); + dialog->ExecuteDialogLD(); + + if ( error != KErrCancel ) + { + switch ( error ) + { + case KErrNone: + break; + + case KErrNoMemory: + case KErrNotSupported: + // Clear failure - to be handled in active scheduler. + User::Leave( error ); + break; + + default: + // Failed - still show local information note in error situation. + { + HBufC* prompt = + StringLoader::LoadLC( + R_VIDEOTELUI_QTN_BT_DEVICE_NOT_AVAIL ); + CAknInformationNote* note = + new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + CleanupStack::PopAndDestroy( prompt ); + } + break; + } + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdDeactivateBtL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdDeactivateBtL() + { + // Command to Video tel engine + MVtEngAudio::TVtEngRoutingSetting audioSetting = + MVtEngAudio::EDeactivateBT; + + ExecuteCmdL( KVtEngSetAudioRouting, audioSetting ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdActivateLoudspeakerL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdActivateLoudspeakerL() + { + MVtEngAudio::TVtEngRoutingSetting audioSetting = + MVtEngAudio::EActivateHandsfree; + ExecuteCmdL( KVtEngSetAudioRouting, audioSetting ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdDeactivateLoudspeakerL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdDeactivateLoudspeakerL() + { + MVtEngAudio::TVtEngRoutingSetting audioSetting = + MVtEngAudio::EDeactivateHansfree; + ExecuteCmdL( KVtEngSetAudioRouting, audioSetting ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdSwapImagesPlacesL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdSwapImagesPlacesL() + { + __VTPRINTENTER( "VtUi.Swap" ) + + MVtEngMedia& media = Model().Media(); + const TBool viewFinderStarted = + media.RenderingStarted( MVtEngMedia::EMediaOutgoing ); + const TBool remoteRenderStarted = + media.RenderingStarted( MVtEngMedia::EMediaIncoming ); + + if ( viewFinderStarted ) + { + // Stop viewfinder. + __VTPRINT( DEBUG_GEN, "VtUi.Swap.VF.down" ) + ExecuteCmdL( KVtEngStopViewFinder ); + } + // Stop remote render. + __VTPRINT( DEBUG_GEN, "VtUi.Swap.RR.down" ) + ExecuteCmdL( KVtEngStopRenderRemote ); + + // Clear windows. + iUplinkWindow->Reset(); + iDownlinkWindow->Reset(); + + const TBool uplinkWindowEqualsContextControl = + ( iUplinkWindow == iInstance->iContextControl ); + + // Prepare viewfinder. + __VTPRINT( DEBUG_GEN, "VtUi.Swap.VF.upd" ) + TVtEngRenderingOptions configViewfinder( + uplinkWindowEqualsContextControl ? + DetermineMainControlOptions( EFalse ) : + DetermineContextControlOptions() ); + ExecuteCmdL( KVtEngPrepareViewFinder, configViewfinder ); + + // Swap windows. + if ( ERenderingModeDialer == iRenderingMode ) + { + MVtUiVideoWindow* tmpWindow = iUplinkWindow; + iUplinkWindow = iStoredDownlinkWindow; + iStoredDownlinkWindow = tmpWindow; + } + else + { + MVtUiVideoWindow* tmpWindow = iUplinkWindow; + iUplinkWindow = iDownlinkWindow; + iDownlinkWindow = tmpWindow; + } + iUplinkWindow->SetRemoteVideoControl(NULL); + iDownlinkWindow->SetRemoteVideoControl(iInstance->iRemoteVideoControl); + iDownlinkWindow->LayoutRemoteVideo(); + + // Prepare remote render. + __VTPRINT( DEBUG_GEN, "VtUi.Swap.RR.upd" ) + TRAPD ( err, { + TVtEngRenderingOptionsNGA configRemoteRenderNGA( + DetermineRemoteVideoControlOptionsNGA() ); + ExecuteCmdL( + KVtEngPrepareRemoteRenderNGA, + configRemoteRenderNGA ); + } ); + + if ( err != KErrNone ) + { + if ( viewFinderStarted ) + { + // Start viewfinder. + ExecuteCmdL( KVtEngStartViewFinder ); + } + User::Leave ( err ); + } + // Start remote render. + __VTPRINT( DEBUG_GEN, "VtUi.Swap.RR.up" ) + if ( remoteRenderStarted ) + { + ExecuteCmdL( KVtEngStartRenderRemote ); + } + + __VTPRINT( DEBUG_GEN, "VtUi.Swap.VF.up" ) + if ( viewFinderStarted ) + { + // Start viewfinder. + ExecuteCmdL( KVtEngStartViewFinder ); + } + + iDownlinkWindow->Redraw(); + + // Refresh blind & waiting will be handled in HandleCommandL. + __VTPRINTEXIT( "VtUi.Swap" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdUseCameraL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdUseCameraL( const TBool aPrimaryCamera ) + { + EnableCommandActivatingAndCleanupPushL(); + MVtEngMedia& media = Model().Media(); + + MVtEngMedia::TMediaSource selectedSource = + ( aPrimaryCamera ) ? + MVtEngMedia::EMediaCameraPri : MVtEngMedia::EMediaCameraSec; + + TInt available = 0; + VtUiUtility::GetOutgoingMediaState( media, available ); + if ( available & MVtEngMedia::EMediaVideo ) + { + ExecuteCmdL( KVtEngStopViewFinder ); + + iUplinkWindow->SetStreamBitmap( NULL ); + TRAPD( err, ExecuteCmdL( KVtEngSetSource, selectedSource ) ); + + if ( err == KErrNone ) + { + ExecuteCmdL( KVtEngStartViewFinder ); + } + else + { + ShowOtherCameraNotUsableNoteL(); + } + } + else + { + MVtEngMedia::TPrepareCameraParams params; + params.iMediaSource = selectedSource; + params.iInitialize = EFalse; + TRAPD( err, ExecuteCmdL( KVtEngPrepareCamera, params ) ); + if ( err != KErrNone ) + { + ShowOtherCameraNotUsableNoteL(); + } + } + CleanupStack::PopAndDestroy(); // EnableCommandActivatingAndCleanupPushL + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdHelpL +// Launches help application. +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdHelpL() + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), + AppHelpContextL() ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::PrepareExitL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::PrepareExitL() + { + __VTPRINTENTER( "VtUi.PrepareExitL" ) + // Cancel progress dialog + HideProgressDialogL(); + // Cancel menu. + CAknAppUi::ProcessCommandL( EEikCmdCanceled ); // does not leave + + if ( !iExitTimer->IsActive() ) + { + __VTPRINT( DEBUG_GEN, "VtUi.Exit.Timer.Go" ) + iExitTimer->Start( + KVtUiExitTimeout, + KVtUiExitTimeout, + TCallBack( DoHandleExitTimeout, this ) ); + } + + // Asynchronous shutdown - execute command. + iBlankControl->SetActive( ETrue ); + __VTPRINTEXIT( "VtUi.PrepareExitL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdUpdateZoomL +// This method is called to update zoom step to the Video Telephone engine +// side from the HandleKeyEventL method. +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdUpdateZoomL() + { + __VTPRINTENTER( "VtUi.UpdZm" ) + + __VTPRINTEXIT( "VtUi.UpdZm" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::SetZoomFactorL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SetZoomFactorL( TInt aZoomStep ) + { + __VTPRINTENTER( "VtUi.SetZoomFactorL" ) + MVtEngMedia& media = Model().Media(); + if ( VtUiUtility::IsZoomAllowed( media ) ) + { + ExecuteCmdL( KVtEngSetZoomStep, aZoomStep ); + } + __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 +// This method is called to update volume to the Video Telephone engine +// side +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdUpdateVolumeL( MVtEngAudio::TVtEngOutputVolume aVolume ) + { + __VTPRINTENTER( "VtUi.CmdUpdateVolumeL" ) + iVolCtrl->AdjustVolumeL( aVolume ); + __VTPRINTEXIT( "VtUi.CmdUpdateVolumeL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdGoToIdleL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdGoToIdleL() + { + __VTPRINTENTER( "VtUi.CmdGoToIdleL" ) + TInt idleUid = 0; + if ( RProperty::Get( + KPSUidAiInformation, + KActiveIdleUid, + idleUid ) == KErrNone ) + { + __VTPRINT2( DEBUG_GEN, "Idle UID: %d", idleUid ) + TApaTaskList taskList( iEikonEnv->WsSession() ); + TApaTask task = taskList.FindApp( TUid::Uid( idleUid ) ); + if ( task.Exists() ) + { + __VTPRINT( DEBUG_GEN, "Idle task found") + RProperty::Set( KPSUidUikon, KUikVideoCallTopApp, KVtUiAppUid.iUid ); + task.BringToForeground(); + } + } + __VTPRINTEXIT( "VtUi.CmdGoToIdleL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdInitializeShareImageL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdInitializeShareImageL( TBool& aNeedRefresh ) + { + __VTPRINTENTER( "VtUi.CmdInitializeShareImageL" ) + EnableCommandActivatingAndCleanupPushL(); + + MVtUiFeature* tb = + iFeatureManager->GetFeatureById( EVtUiFeatureIdToolbar ); + if ( tb ) + { + // timer could be active + if ( iTbPeriodic ) + { + iTbPeriodic->Cancel(); + } + tb->Stop(); + } + CDesCArray* selectedFiles = new ( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( selectedFiles ); + CVtUiAppUi::CVtUiAppUiMGVerifier* verifier = + CVtUiAppUi::CVtUiAppUiMGVerifier::NewLC( *this, *iCoeEnv ); + + // number erntry is not availabe while media gallery is open + iInstance->iNumberEntryActivation->SetActive( EFalse ); + iUiStates->SetSelectingShare( ETrue ); + + iInstance->iRemoteVideoControl->MakeVisible(EFalse); + TBool result( EFalse ); + TRAPD( err, result = + MGFetch::RunL( *selectedFiles, EImageFile, EFalse, verifier ) ); + + iInstance->iRemoteVideoControl->MakeVisible(ETrue); + // leave occured + if ( err != KErrNone ) + { + if ( iUiStates->ExecState() == TVtUiStates::EExecStateRunning ) + { + ShowUnableToOpenNoteL(); + } + else + { + __VTPRINTEXIT( "VtUi.CmdInitializeShareImageL 1" ) + Exit(); + } + } + + if ( result && ( selectedFiles->Count() > 0 ) ) + { + MVtEngMedia::TShareObjectState shareObjectState; + VtUiUtility::GetObjectSharingState( Model().Media(), shareObjectState ); + iUiStates->SetViewFinderToMainPane( + shareObjectState == MVtEngMedia::ENotSharing ); + MVtEngMedia::TShareObjectImageParameters + parameters( selectedFiles->operator[]( 0 ) ); + ExecuteCmdL( KVtEngInitializeShareImage, parameters ); + aNeedRefresh = ETrue; + } + else // selection canceled start toolbar timer + { + if ( !iTbPeriodic ) + { + iTbPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + } + iTbPeriodic->Cancel(); + iTbPeriodic->Start( KStartTime, KPeriodTime, TCallBack( DoTryToStartTbL, this ) ); + } + CleanupStack::PopAndDestroy( 2 ); // selectedFiles, verifier + // number entry is availabe again + iInstance->iNumberEntryActivation->SetActive( ETrue ); + iUiStates->SetSelectingShare( EFalse ); + CleanupStack::PopAndDestroy(); // EnableCommandActivatingAndCleanupPushL(); + + __VTPRINTEXIT( "VtUi.CmdInitializeShareImageL 0" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdShareImageL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdShareImageL() + { + ExecuteCmdL( KVtEngStartShareImage ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdStopShareImageL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CmdStopShareImageL( TBool& aNeedRefresh ) + { + ExecuteCmdL( KVtEngStopShareImage ); + RestoreViewFinderL(); + aNeedRefresh = ETrue; + // update VB settings + UpdateVBSettingL(); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleWaitingStateChange +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleWaitingStateChange( TBool aIsWaiting ) + { + // Dialer must be closed in case of waiting call + MVtUiFeature* dialer = + iFeatureManager->GetFeatureById( EVtUiFeatureIdDialer ); + if ( dialer ) + { + dialer->Stop(); + } + iUiStates->SetWaitingCall( aIsWaiting ); + if (aIsWaiting == EFalse && + iIsWaitingCallState != EFalse && + !iUiStates->IsThisApplicationForeground() ) + { + iIsWaitingCallState = EFalse; + ChangeApplicationFocus( ETrue ); + TRAP_IGNORE ( SetHiddenL( EFalse ) ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecInitExecuteL +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::ActiveExecInitExecuteL( + const TInt aState, + TInt& aNextState, + TRequestStatus& aRequest ) + { + __VTPRINTENTER( "VtUi.InitExec" ) + __VTPRINT2( DEBUG_GEN, "VtUi.InitExec.st=%d", aState ) + + TBool synch = EFalse; + + switch ( aState ) + { + // Startup chain: + case EVtUiAppUiStartupCloseDialogs: + // Close all dialogs. + iBlankControl->SetActive( EFalse ); + AknDialogShutter::ShutDialogsL( *iEikonEnv ); + iBlankControl->SetActive( ETrue ); + + synch = ETrue; + aNextState = EVtUiAppUiStartupInitEngine; + break; + + case EVtUiAppUiStartupInitEngine: + iUplinkWindow = iInstance->iContextControl; + iDownlinkWindow = iInstance->iMainControl; + ActiveExecInitExecuteCommandL( KVtEngInitializeEngine, aRequest ); + aNextState = EVtUiAppUiStartupPrepareViewfinder; + break; + + case EVtUiAppUiStartupPrepareViewfinder: + ActiveExecInitPrepareViewFinderL( aRequest ); + iUplinkWindow->SetStreamBitmap( NULL ); + aNextState = EVtUiAppUiStartupPrepareRemoteRender; + break; + + case EVtUiAppUiStartupPrepareRemoteRender: + + iInstance->CreateRemoteVideoControl(); + ActiveExecInitPrepareRemoteRenderL( aRequest ); + iDownlinkWindow->SetStreamBitmap( NULL ); + aNextState = EVtUiAppUiStartupRemoveBlank; + break; + + case EVtUiAppUiStartupRemoveBlank: + // Finally remove blank control. + iBlankControl->SetActive( EFalse ); + aNextState = EVtUiAppUiNone; + synch = ETrue; + break; + + // Shutdown chain: + case EVtUiAppUiShutdownCloseDialogs: + { + // Close all dialogs. + iBlankControl->SetActive( EFalse ); + AknDialogShutter::ShutDialogsL( *iEikonEnv ); + iBlankControl->SetActive( ETrue ); + + MVtUiFeature* numberEntry = iFeatureManager->GetFeatureById( + EVtUiFeatureIdNumberEntry ); + // Number entry may be active if its deactivation timer is still + // pending. Stop performs some cleanup which is needed before AppUi + // cleanup. + if ( numberEntry ) + { + numberEntry->Stop(); + } + + synch = ETrue; + aNextState = EVtUiAppUiShutdownHideApplication; + } + break; + + case EVtUiAppUiShutdownHideApplication: + if ( iUiStates->IsThisApplicationForeground() ) + { + BringTelephoneToForeground(); + } + else + { + ChangeApplicationFocus( EFalse ); + } + iDownlinkWindow->SetStreamBitmap( NULL ); + iUplinkWindow->SetStreamBitmap( NULL ); + SetHiddenL( ETrue ); + iEventObserver->DeleteRemConSession(); + + synch = ETrue; + aNextState = EVtUiAppUiShutdownResetEngine; + break; + + case EVtUiAppUiShutdownResetEngine: + { + aRequest = KRequestPending; + + MVtEngCommandHandler& command = Model().CommandHandler(); + // There should not be any commands ongoing because + // we have canceled all dialogs (and this should + // be the only command without dialog). + command.CancelCommand( command.PendingCommand() ); // ignore error + command.ExecuteL( KVtEngResetEngine, NULL ); + iShutdownRequest = &aRequest; + + aNextState = EVtUiAppUiShutdownRemoveBlank; + } + break; + + case EVtUiAppUiShutdownRemoveBlank: + // Finally remove blank control. + iBlankControl->SetActive( EFalse ); + + synch = ETrue; + aNextState = EVtUiAppUiNone; + break; + + // Answered chain: + case EVtUiAppUiAnsweredStart: + { + CVtUiBlankDialog* dialog = + new ( ELeave ) CVtUiBlankDialog( &iExecBlankDialog ); + dialog->ExecuteDialogNoWaitLD(); + iExecBlankDialog = dialog; + + synch = ETrue; + if ( iUiStates->IsLayoutChangeNeeded() ) + { + (void) HandleLayoutChanged(); + } + aNextState = EVtUiAppUiAnsweredRefreshNavi; + } + break; + + case EVtUiAppUiAnsweredRefreshNavi: + RefreshNaviPaneL(); + iEventObserver->CreateRemConSessionL(); + + synch = ETrue; + aNextState = EVtUiAppUiAnsweredRefreshSoftkeys; + break; + + case EVtUiAppUiAnsweredRefreshSoftkeys: + RefreshSoftkeysL(); + + synch = ETrue; + aNextState = EVtUiAppUiAnsweredStartRemoteRender; + break; + + case EVtUiAppUiAnsweredStartRemoteRender: + { + // Set waiting text to main control and start remote rendering. + // Video Telephone application should get KVtEngRemoteVideoStarted + // event when the first frame is received. + iDownlinkWindow->SetWaiting( ETrue ); + iUiStates->SetWaitingForFirstFrame( ETrue ); + //Must check if orientation changed between prepare remote render and start remote render + //If changed, update render parameter firstly + if ( iIsLandScapeOrientation != VtUiLayout::IsLandscapeOrientation() ) + { + __VTPRINT( DEBUG_GEN, "layout has been changed before start RemoteRender" ) + UpdateRenderingParametersL(); + } + + ActiveExecInitExecuteCommandL( KVtEngStartRenderRemote, + aRequest ); + + aNextState = EVtUiAppUiAnsweredCheckCamera; + } + break; + + case EVtUiAppUiAnsweredCheckCamera: + { + MVtEngMedia& media = Model().Media(); + if ( VtUiUtility::HasCameras( media ) ) + { + aNextState = EVtUiAppUiAnsweredChoose; + synch = ETrue; + } + else + { + if ( VtUiUtility::HasStillImage( media ) ) + { + aNextState = EVtUiAppUiAnsweredSelectStill; + } + else + { + aNextState = EVtUiAppUiAnsweredSelectNone; + } + + synch = ETrue; + } + } + break; + + case EVtUiAppUiAnsweredChoose: + { + // If camera is in use, then show note, + // select still image, stop. + // + // If call is mobile terminated, then show query. + // If user answers 'yes' to the query, + // then activate camera. + // If user answers 'no' to the query, + // then choose still image. + // + // If call is mobile originated, then select camera. + // + // If selecting a camera fails, then select still image. + // If selecting still image fails, then select none. + // + CVtEngModel& model = Model(); + MVtEngSessionInfo& session = model.Session(); + MVtEngMedia& media = model.Media(); + + MVtEngMedia::TCameraId id; + TInt cameraErr = model.Media().GetCurrentCameraId( id ); + if ( cameraErr == KErrInUse ) + { + // Camera is in use. + iUiStates->SetExecShowCameraInUse( ETrue ); + + if ( VtUiUtility::HasStillImage( media ) ) + { + aNextState = EVtUiAppUiAnsweredSelectStill; + } + else + { + aNextState = EVtUiAppUiAnsweredSelectNone; + } + } + else + { + // Check the direction of the call. + iUiStates->SetExecShowCameraInUse( EFalse ); + MVtEngSessionInfo::TDirection direction; + if ( session.GetDirection( direction ) != KErrNone ) + { + direction = MVtEngSessionInfo::EDirectionMT; + } + + if ( direction == MVtEngSessionInfo::EDirectionMT ) + { + // Start steps towards the "Allow video" query. + if ( VtUiUtility::HasStillImage( media ) ) + { + aNextState = EVtUiAppUiAnsweredQuerySetupStill; + } + else + { + aNextState = EVtUiAppUiAnsweredQuerySetupNone; + } + } + else + { + aNextState = EVtUiAppUiAnsweredDoPrepareCamera; + } + } + synch = ETrue; + } + break; + + case EVtUiAppUiAnsweredQuerySetupStill: + ActiveExecInitSetSourceL( MVtEngMedia::EMediaStillImage, aRequest ); + aNextState = EVtUiAppUiAnsweredQuerySetupStart; + break; + + case EVtUiAppUiAnsweredQuerySetupNone: + ActiveExecInitSetSourceL( MVtEngMedia::EMediaNone, aRequest ); + aNextState = EVtUiAppUiAnsweredQuerySetupStart; + break; + + case EVtUiAppUiAnsweredQuerySetupStart: + ActiveExecInitExecuteCommandL( KVtEngStartViewFinder, aRequest ); + aNextState = EVtUiAppUiAnsweredQueryShow; + break; + + case EVtUiAppUiAnsweredQueryShow: + { + RefreshL(); + TInt state = EPSCTsyCallStateUninitialized; + TInt err = RProperty::Get( + KPSUidCtsyCallInformation, + KCTsyCallState, + state ); + __VTPRINT3( DEBUG_GEN, "VtUi.InitExec WaitingCall State=%d, err=%d", + state, err ) + if ( EPSCTsyCallStateRinging != state ) + { + ChangeApplicationFocus( ETrue ); + SetHiddenL( EFalse ); + } + else + { + iIsWaitingCallState = ETrue; + } + + // User selectable call answer mute. + // In GS one can set call ansewer status + // eighter to query user, allways show, allways mute. + // GS values are checked from CR key ( KSettingsVTVideoSending ) + // (default value is 0 = allways query). + TVtUiGsMuteVariation camute; + __VTPRINT2( DEBUG_GEN, "VtUi.InitExe GS CR key KSettingsVTVideoSending querystate=%d", camute.GsMuteState() ) + if ( camute.GsMuteState() == KAllwaysQuery && !iUiStates->IsDeviceLockOn() && EPSCTsyCallStateRinging != state) + { + CVtUiAllowVideoDialog* dialog = + new ( ELeave ) CVtUiAllowVideoDialog( + &iExecDialog, + CAknQueryDialog::ENoTone ); + dialog->ExecuteDialogLD( aRequest ); + iExecDialog = dialog; + aNextState = EVtUiAppUiAnsweredQueryDecide; + } + else if ( camute.GsMuteState() == KAllwaysAllow ) + { + aNextState = EVtUiAppUiAnsweredDoPrepareCamera; + synch = ETrue; + } + else + { + aNextState = EVtUiAppUiNone; + synch = ETrue; + } + + } + break; + + case EVtUiAppUiAnsweredQueryDecide: + { + delete iExecDialog; + iExecDialog = NULL; + + if ( iActiveExec->RequestStatus() == + CVtUiAllowVideoDialog::EUserAllowed ) + { + aNextState = EVtUiAppUiAnsweredDoPrepareCamera; + } + else + { + aNextState = EVtUiAppUiNone; + } + + synch = ETrue; + } + break; + + case EVtUiAppUiAnsweredDoPrepareCamera: + { + MVtEngMedia& media = Model().Media(); + MVtEngMedia::TMediaSource source = MVtEngMedia::EMediaCamera; + ActiveExecInitPrepareCameraL( source, aRequest ); + aNextState = EVtUiAppUiAnsweredSelectCamera; + } + break; + + case EVtUiAppUiAnsweredQuerySelectCamera: + case EVtUiAppUiAnsweredSelectCamera: + ActiveExecInitSetSourceL( MVtEngMedia::EMediaCamera, aRequest ); + if ( aState == EVtUiAppUiAnsweredSelectCamera ) + { + aNextState = EVtUiAppUiAnsweredStartViewfinder; + } + else + { + aNextState = EVtUiAppUiAnsweredQueryStartViewfinder; + } + break; + + case EVtUiAppUiAnsweredQuerySelectStill: + case EVtUiAppUiAnsweredSelectStill: + ActiveExecInitSetSourceL( MVtEngMedia::EMediaStillImage, aRequest ); + + if ( aState == EVtUiAppUiAnsweredSelectStill ) + { + aNextState = EVtUiAppUiAnsweredStartViewfinder; + } + else + { + aNextState = EVtUiAppUiAnsweredQueryStartViewfinder; + } + break; + + case EVtUiAppUiAnsweredQuerySelectNone: + case EVtUiAppUiAnsweredSelectNone: + ActiveExecInitSetSourceL( MVtEngMedia::EMediaNone, aRequest ); + + if ( aState == EVtUiAppUiAnsweredSelectNone ) + { + aNextState = EVtUiAppUiAnsweredStartViewfinder; + } + else + { + aNextState = EVtUiAppUiAnsweredQueryStartViewfinder; + } + break; + + case EVtUiAppUiAnsweredQueryStartViewfinder: + case EVtUiAppUiAnsweredStartViewfinder: + ActiveExecInitExecuteCommandL( KVtEngStartViewFinder, aRequest ); + + if ( aState == EVtUiAppUiAnsweredStartViewfinder ) + { + aNextState = EVtUiAppUiAnsweredFinish; + } + else + { + aNextState = EVtUiAppUiAnsweredQueryFinish; + } + break; + + case EVtUiAppUiAnsweredQueryFinish: + case EVtUiAppUiAnsweredFinish: + RefreshL(); + if ( iUiStates->IsExecShowCameraInUse() ) + { + ShowCameraInUseNoteL(); + } + + if ( aState != EVtUiAppUiAnsweredQueryFinish ) + { + ChangeApplicationFocus( ETrue ); + } + SetHiddenL( EFalse ); + + synch = ETrue; + aNextState = EVtUiAppUiNone; + break; + + default: + User::Leave( KErrNotSupported ); + break; + } + + __VTPRINT2( DEBUG_GEN, "VtUi.InitExec.sync=%d", synch ) + __VTPRINT2( DEBUG_GEN, "VtUi.InitExec.next=%d", aNextState ) + __VTPRINTEXITR( "VtUi.InitExec %d", synch ) + return synch; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecInitContinue +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::ActiveExecInitContinue( + TInt& aState, + const TInt aError ) + { + __VTPRINTENTER( "VtUi.InitExecCont" ) + __VTPRINT2( DEBUG_GEN, "VtUi.InitExecCont.st=%d", aState ) + //__VTPRINT2( DEBUG_GEN, "VtUi.InitExecCont.err=%d", aError ) + + const TInt state = aState; + switch ( state ) + { + case EVtUiAppUiStartupCloseDialogs: + case EVtUiAppUiStartupInitEngine: + case EVtUiAppUiStartupPrepareViewfinder: + case EVtUiAppUiStartupPrepareRemoteRender: + case EVtUiAppUiStartupRemoveBlank: + // Prepare failed. + break; + + case EVtUiAppUiShutdownCloseDialogs: + if( KErrNotReady == aError ) + { + aState = EVtUiAppUiShutdownHideApplication; + break; + } + case EVtUiAppUiShutdownResetEngine: + case EVtUiAppUiShutdownRemoveBlank: + // shutdown failed + break; + + case EVtUiAppUiShutdownHideApplication: + aState = EVtUiAppUiShutdownResetEngine; + break; + + + case EVtUiAppUiAnsweredStart: + aState = EVtUiAppUiAnsweredRefreshNavi; + break; + + case EVtUiAppUiAnsweredRefreshNavi: + aState = EVtUiAppUiAnsweredRefreshSoftkeys; + break; + + case EVtUiAppUiAnsweredRefreshSoftkeys: + aState = EVtUiAppUiAnsweredStartRemoteRender; + break; + + case EVtUiAppUiAnsweredStartRemoteRender: + case EVtUiAppUiAnsweredStartViewfinder: + case EVtUiAppUiAnsweredSelectNone: + case EVtUiAppUiAnsweredFinish: + case EVtUiAppUiAnsweredQueryStartViewfinder: + case EVtUiAppUiAnsweredQuerySelectNone: + case EVtUiAppUiAnsweredQueryFinish: + // Answered failed. + break; + + case EVtUiAppUiAnsweredCheckCamera: + aState = EVtUiAppUiAnsweredChoose; + break; + + case EVtUiAppUiAnsweredChoose: + aState = EVtUiAppUiAnsweredQuerySetupStill; + break; + + case EVtUiAppUiAnsweredQuerySetupStill: + aState = EVtUiAppUiAnsweredQuerySetupNone; + break; + + case EVtUiAppUiAnsweredQuerySetupStart: + case EVtUiAppUiAnsweredQuerySetupNone: + aState = EVtUiAppUiAnsweredQueryShow; + break; + + case EVtUiAppUiAnsweredQueryShow: + case EVtUiAppUiAnsweredQueryDecide: + case EVtUiAppUiAnsweredSelectCamera: + aState = EVtUiAppUiAnsweredSelectStill; + break; + + case EVtUiAppUiAnsweredQuerySelectCamera: + aState = EVtUiAppUiAnsweredQuerySelectStill; + break; + + case EVtUiAppUiAnsweredQuerySelectStill: + aState = EVtUiAppUiAnsweredQuerySelectNone; + break; + + case EVtUiAppUiAnsweredSelectStill: + aState = EVtUiAppUiAnsweredSelectNone; + break; + + default: + break; + } + + const TBool cont = ( aState != state ); + __VTPRINT2( DEBUG_GEN, "VtUi.InitExecCont.cont=%d", cont ) + + if ( !cont ) + { + delete iExecBlankDialog; + iExecBlankDialog = NULL; + // Operation failed. + if ( iState ) + { + TRAP_IGNORE( iState->AppUiStartupFailedL() ); + } + } + __VTPRINTEXITR( "VtUi.InitExecCont %d", cont ) + return cont; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecInitCancel +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ActiveExecInitCancel( + const TInt /*aState*/ ) + { + __VTPRINTENTER( "VtUi.InitExecCancel" ) + + iBlankControl->SetActive( EFalse ); + delete iExecDialog; + delete iExecBlankDialog; + + if ( iShutdownRequest ) + { + User::RequestComplete( iShutdownRequest, KErrCancel ); + iShutdownRequest = NULL; + } + __VTPRINTEXIT( "VtUi.InitExecCancel" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecInitDone +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ActiveExecInitDone( + const TInt aInitialState ) + { + __VTPRINTENTER( "VtUi.ExecInitDone" ) + __VTPRINT2( DEBUG_GEN, "VtUi.InitExecDone.ini=%d", aInitialState ) + delete iExecBlankDialog; + iExecBlankDialog = NULL; + // Operation succeeded + + // Now we have finished. + if ( iState ) + { + if ( aInitialState == EVtUiAppUiAnswered ) + { + TRAP_IGNORE( iState->AppUiStartupPhase2DoneL() ); + TRAP_IGNORE( AppUiInitDoneDoPostInitL() ); + } + else if ( aInitialState == EVtUiAppUiShutdown ) + { + TRAP_IGNORE( iState->ShutdownDoneL() ); + } + else // EVtUiAppUiStartup + { + TRAP_IGNORE( iState->AppUiStartupPhase1DoneL() ); + } + } + __VTPRINTEXIT( "VtUi.ExecInitDone" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecInitExecuteCommandL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ActiveExecInitExecuteCommandL( + const TVtEngCommandId aCommand, + TRequestStatus& aRequest ) + { + iExecDialog = + ExecuteCmdAsyncL( + &iExecDialog, + aCommand, + aRequest ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecInitExecuteCommandL +// ----------------------------------------------------------------------------- +// +template < class T > +void CVtUiAppUi::ActiveExecInitExecuteCommandL( + const TVtEngCommandId aCommand, + T& aParam, + TRequestStatus& aRequest ) + { + iExecDialog = + ExecuteCmdAsyncL( + &iExecDialog, + aCommand, + aParam, + aRequest ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecInitPrepareCameraL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ActiveExecInitPrepareCameraL( + const MVtEngMedia::TMediaSource aSource, + TRequestStatus& aRequest ) + { + MVtEngMedia::TPrepareCameraParams params; + params.iMediaSource = aSource; + params.iInitialize = ETrue; + iExecDialog = + ExecuteCmdAsyncL( + &iExecDialog, + KVtEngPrepareCamera, + params, + aRequest ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecInitSetSourceL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ActiveExecInitSetSourceL( + const MVtEngMedia::TMediaSource aSource, + TRequestStatus& aRequest ) + { + MVtEngMedia::TMediaSource source = + aSource; + iExecDialog = + ExecuteCmdAsyncL( + &iExecDialog, + KVtEngSetSource, + source, + aRequest ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecInitPrepareViewFinderL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ActiveExecInitPrepareViewFinderL( + TRequestStatus& aRequest ) + { + // Configure view finder to context pane. + if ( iEventObserver->CommandSupported( KVtEngPrepareViewFinder ) ) + { + TVtEngRenderingOptions configViewfinder( + DetermineContextControlOptions() ); + + iExecDialog = + ExecuteCmdAsyncL( + &iExecDialog, + KVtEngPrepareViewFinder, + configViewfinder, + aRequest ); + } + else + { + // Viewfinder does not support DSA - panic. + VtUiPanic::Panic( EVtUiPanicPrepareViewFinderNotSupported ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecInitPrepareRemoteRenderL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ActiveExecInitPrepareRemoteRenderL( + TRequestStatus& aRequest ) + { + if ( iEventObserver->CommandSupported( KVtEngPrepareRemoteRenderNGA ) ) + { + // Cropping is performed when we draw the picture. + TVtEngRenderingOptionsNGA configRemoteRenderNGA( + DetermineRemoteVideoControlOptionsNGA() ); + + iExecDialog = + ExecuteCmdAsyncL( + &iExecDialog, + KVtEngPrepareRemoteRenderNGA, + configRemoteRenderNGA, + aRequest ); + } + else + { + // Neither supported - panic. + VtUiPanic::Panic( EVtUiPanicPrepareRemoteRenderNotSupported ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecCmdExecuteCommandL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ActiveExecCmdExecuteCommandL( + const TVtEngCommandId aCommand, + TRequestStatus& aRequest ) + { + iCmdExecDialog = + ExecuteCmdAsyncL( + &iCmdExecDialog, + aCommand, + aRequest ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecCmdSetSourceL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ActiveExecCmdSetSourceL( + const MVtEngMedia::TMediaSource aSource, + TRequestStatus& aRequest ) + { + MVtEngMedia::TMediaSource source = aSource; + iCmdExecDialog = + ExecuteCmdAsyncL( + &iCmdExecDialog, + KVtEngSetSource, + source, + aRequest ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ActiveExecCmdPrepareCameraL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ActiveExecCmdPrepareCameraL( + const MVtEngMedia::TMediaSource aSource, + TRequestStatus& aRequest ) + { + MVtEngMedia::TPrepareCameraParams params; + params.iMediaSource = aSource; + params.iInitialize = ETrue; + iCmdExecDialog = + ExecuteCmdAsyncL( + &iCmdExecDialog, + KVtEngPrepareCamera, + params, + aRequest ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DetermineMainControlOptions +// ----------------------------------------------------------------------------- +// +TVtEngRenderingOptions + CVtUiAppUi::DetermineMainControlOptions( TBool aRemoteVideo ) + { + // Determine main pane options. + TRect screen; + TAknWindowLineLayout stream; + TAknLayoutRect rect; + + screen = iInstance->iMainControl->Rect(); + VtUiLayout::GetSecondWindowStreamWholeLayout( + stream, aRemoteVideo && iUiStates->IsUseSQCif() ); + + rect.LayoutRect( screen, stream ); + screen = rect.Rect(); + + return TVtEngRenderingOptions( *iEventObserver, screen.Size() ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DetermineContextControlOptions +// ----------------------------------------------------------------------------- +// +TVtEngRenderingOptions CVtUiAppUi::DetermineContextControlOptions() + { + // Determine context pane options. + TRect screen; + TRect clip; + TAknWindowLineLayout stream; + TAknLayoutRect rect; + + VtUiLayout::GetApplicationParentRect( screen ); + VtUiLayout::GetFirstWindowBackgroundLayout( stream ); + rect.LayoutRect( screen, stream ); + TRect background = rect.Rect(); + + VtUiLayout::GetFirstWindowStreamLayout( stream ); + rect.LayoutRect( screen, stream ); + + // No cropping is performed, thus clip == screen. + clip = rect.Rect(); + clip.iTl -= background.iTl; + clip.iBr -= background.iTl; + + screen = clip; + + return + TVtEngRenderingOptions( + *iEventObserver, + screen.Size() ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DetermineDialerControlOptions +// ----------------------------------------------------------------------------- +// +TVtEngRenderingOptions CVtUiAppUi::DetermineDialerControlOptions() + { + MVtUiDialer* dialer = static_cast< CVtUiDialer* > ( + iFeatureManager->GetFeatureById( EVtUiFeatureIdDialer ) ); + + __ASSERT_ALWAYS( dialer, VtUiPanic::Panic( EVtUiPanicRendererNotFound ) ); + + return + TVtEngRenderingOptions( + *iEventObserver, + dialer->VideoControl().Size() ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DetermineMainControlOptions +// ----------------------------------------------------------------------------- +// +TVtEngRenderingOptionsDSA + CVtUiAppUi::DetermineMainControlOptionsDSA( TBool aRemoteVideo ) + { + // Determine main pane options. + TRect screen; + TRect clip; + TAknWindowLineLayout stream; + TAknLayoutRect rect; + const TBool usesSQCif( aRemoteVideo && iUiStates->IsUseSQCif() ); + screen = iInstance->iMainControl->Rect(); + VtUiLayout::GetSecondWindowStreamLayout( stream, + iUiStates->IsToolbarAvailable(), usesSQCif ); + rect.LayoutRect( screen, stream ); + clip = rect.Rect(); + + VtUiLayout::GetSecondWindowStreamWholeLayout( stream, + iUiStates->IsToolbarAvailable(), usesSQCif ); + rect.LayoutRect( screen, stream ); + screen = rect.Rect(); + + return + TVtEngRenderingOptionsDSA( + *iEventObserver, + iEikonEnv->WsSession(), + *( iEikonEnv->ScreenDevice() ), + *( iInstance->iMainControl->DrawableWindow() ), + clip, + screen ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DetermineContextControlOptionsDSA +// ----------------------------------------------------------------------------- +// +TVtEngRenderingOptionsDSA CVtUiAppUi::DetermineContextControlOptionsDSA() + { + // Determine context pane options. + TRect screen; + TRect clip; + TAknWindowLineLayout stream; + TAknLayoutRect rect; + + VtUiLayout::GetApplicationParentRect( screen ); + VtUiLayout::GetFirstWindowBackgroundLayout( stream ); + rect.LayoutRect( screen, stream ); + TRect background = rect.Rect(); + + VtUiLayout::GetFirstWindowStreamLayout( stream ); + rect.LayoutRect( screen, stream ); + + // No cropping is performed, thus clip == screen. + clip = rect.Rect(); + clip.iTl -= background.iTl; + clip.iBr -= background.iTl; + + screen = clip; + + return + TVtEngRenderingOptionsDSA( + *iEventObserver, + iEikonEnv->WsSession(), + *( iEikonEnv->ScreenDevice() ), + *( iInstance->iContextControl->DrawableWindow() ), + screen, + clip ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DetermineDialerControlOptionsDSA +// ----------------------------------------------------------------------------- +// +TVtEngRenderingOptionsDSA CVtUiAppUi::DetermineDialerControlOptionsDSA() + { + MVtUiDialer* dialer = static_cast< CVtUiDialer* > ( + iFeatureManager->GetFeatureById( EVtUiFeatureIdDialer ) ); + + __ASSERT_ALWAYS( dialer, VtUiPanic::Panic( EVtUiPanicRendererNotFound ) ); + + CCoeControl& videoWindow( dialer->VideoControl() ); + + return + TVtEngRenderingOptionsDSA( + *iEventObserver, + iEikonEnv->WsSession(), + *( iEikonEnv->ScreenDevice() ), + *( videoWindow.DrawableWindow() ), + videoWindow.Rect(), + videoWindow.Rect() ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DetermineMainControlOptionsDP +// ----------------------------------------------------------------------------- +// +TVtEngRenderingOptionsDP + CVtUiAppUi::DetermineMainControlOptionsDP( TBool aRemoteVideo ) + { + // Determine main pane options. + const TRect screen( iInstance->iMainControl->Rect() ); + TAknWindowLineLayout stream; + const TBool usesSQCif( aRemoteVideo && iUiStates->IsUseSQCif() ); + + // Even if the name is whole layout, this layout is (due to problem + // in layouts) video stream layout + TAknLayoutRect whole; + VtUiLayout::GetSecondWindowStreamWholeLayout( stream, + iUiStates->IsToolbarAvailable(), usesSQCif ); + whole.LayoutRect( screen, stream ); + + // Even if the name is actual layout, this layout is (due to problem + // in layouts) whole == clipping layout + TAknLayoutRect actual; + VtUiLayout::GetSecondWindowStreamLayout( stream, + iUiStates->IsToolbarAvailable(), usesSQCif ); + actual.LayoutRect( screen, stream ); + + return + TVtEngRenderingOptionsDP( + *iEventObserver, + iEikonEnv->WsSession(), + *( iEikonEnv->ScreenDevice() ), + *( iInstance->iMainControl->DrawableWindow() ), + actual.Rect(), + whole.Rect(), + iInstance->iMainControl->PositionRelativeToScreen() ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DetermineContextControlOptionsDP +// ----------------------------------------------------------------------------- +// +TVtEngRenderingOptionsDP CVtUiAppUi::DetermineContextControlOptionsDP() + { + // Determine context pane options. + TAknWindowLineLayout stream; + TAknLayoutRect rect; + + TRect screen; + VtUiLayout::GetApplicationParentRect( screen ); + VtUiLayout::GetFirstWindowBackgroundLayout( stream ); + rect.LayoutRect( screen, stream ); + const TRect background( rect.Rect() ); + + VtUiLayout::GetFirstWindowStreamLayout( stream ); + rect.LayoutRect( screen, stream ); + + // No cropping is performed, thus clip == screen. + TRect clip( rect.Rect() ); + clip.iTl -= background.iTl; + clip.iBr -= background.iTl; + + return + TVtEngRenderingOptionsDP( + *iEventObserver, + iEikonEnv->WsSession(), + *( iEikonEnv->ScreenDevice() ), + *( iInstance->iContextControl->DrawableWindow() ), + clip, + clip, + iInstance->iContextControl->PositionRelativeToScreen() ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DetermineDialerControlOptionsDP +// ----------------------------------------------------------------------------- +// +TVtEngRenderingOptionsDP CVtUiAppUi::DetermineDialerControlOptionsDP() + { + MVtUiDialer* dialer = static_cast< CVtUiDialer* > ( + iFeatureManager->GetFeatureById( EVtUiFeatureIdDialer ) ); + + __ASSERT_ALWAYS( dialer, VtUiPanic::Panic( EVtUiPanicRendererNotFound ) ); + + CCoeControl& videoWindow( dialer->VideoControl() ); + + TPoint offs( videoWindow.DrawableWindow()->AbsPosition() ); + TRect rect( videoWindow.Rect() ); + return + TVtEngRenderingOptionsDP( + *iEventObserver, + iEikonEnv->WsSession(), + *( iEikonEnv->ScreenDevice() ), + *( videoWindow.DrawableWindow() ), + rect, + rect, + offs ); + } +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DetermineRemoteVideoControlOptionsNGA +// ----------------------------------------------------------------------------- +// +TVtEngRenderingOptionsNGA + CVtUiAppUi::DetermineRemoteVideoControlOptionsNGA() + { + return TVtEngRenderingOptionsNGA( *iEventObserver, + iInstance->iRemoteVideoControl ->GetRWindow() , iEikonEnv->WsSession()); + } +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ExecuteCmdL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ExecuteCmdL( const TVtEngCommandId aCommand ) + { + DoExecuteCmdL( aCommand, NULL ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ExecuteCmdL +// ----------------------------------------------------------------------------- +// +template< class T > +void CVtUiAppUi::ExecuteCmdL( + const TVtEngCommandId aCommand, + T& aParam ) + { + TPtrC8 params( reinterpret_cast< TUint8* >( &aParam ), sizeof( T ) ); + DoExecuteCmdL( aCommand, ¶ms ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DoExecuteCmdL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::DoExecuteCmdL( + const TVtEngCommandId aCommand, + TDesC8* aParams ) + { + __VTPRINT2( DEBUG_GEN, "VtUi.DoExec.cmd=%d", aCommand ) + MVtEngCommandHandler& command = Model().CommandHandler(); + const TInt caps = command.GetCommandCaps( aCommand ); + + if ( ( aCommand == KVtEngSetSource || + aCommand == KVtEngHandleLayoutChange ) && ( caps & MVtEngCommandHandler::EAttribEnabled ) ) + { + EndCallButtonPane().SetEnabled( EFalse ); + } + + if ( caps >= KErrNone ) + { + const TBool asynchronous = + ( caps & MVtEngCommandHandler::EAttribAsync ); + + if ( asynchronous ) + { + if ( aCommand == KVtEngHandleLayoutChange ) + { + CVtEngCmdExec* cmdExec = CVtEngCmdExec::NewL( + Model().CommandHandler(), *iEventObserver, *GetCba() ); + cmdExec->ExecuteCmdLD( aCommand ); + } + else + { + CVtUiExecuteCmdDialog* dlg = + new ( ELeave ) CVtUiExecuteCmdDialog( + NULL, + Model().CommandHandler(), + *iEventObserver ); + dlg->ExecuteCmdLD( aCommand, aParams, NULL ); + + // Here we tell current state to handle shutdown request + if ( aCommand == KVtEngSetSource && iState + && TVtUiAppStateBase::ShutdownRequested() ) + { + iState->HandleVTCommandPerformedL( aCommand, KErrNone ); + } + } + } + else + { + command.ExecuteL( aCommand, aParams ); + RefreshStatesL(); + } + } + else + { + // Failed. + User::Leave( caps ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleShutdownReady +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleShutdownReady() + { + __VTPRINTENTER( "VtUi.HandleShutdownReady" ) + + if(iAsyncCallback->IsActive()) + { + iAsyncCallback->Cancel(); + } + + iAsyncCallback->Set( + TCallBack( &DoExit, this ) ); + iAsyncCallback->CallBack(); + __VTPRINTEXIT( "VtUi.HandleShutdownReady" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ContextControl +// ----------------------------------------------------------------------------- +// +CVtUiContextControl& CVtUiAppUi::ContextControl() + { + __VTPRINTENTER( "VtUi.ContextControl" ) + __VTPRINTEXIT( "VtUi.ContextControl" ) + return *iInstance->iContextControl; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::MainControl +// ----------------------------------------------------------------------------- +// +CVtUiMainControl& CVtUiAppUi::MainControl() + { + __VTPRINTENTER( "VtUi.MainControl" ) + __VTPRINTEXIT( "VtUi.MainControl" ) + return *iInstance->iMainControl; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RemoteVideoControl +// ----------------------------------------------------------------------------- +// +CVtUiRemoteVideoControl& CVtUiAppUi::RemoteVideoControl() + { + __VTPRINTENTER( "VtUi.RemoteVideoControl" ) + __VTPRINTEXIT( "VtUi.RemoteVideoControl" ) + return *iInstance->iRemoteVideoControl; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::EndCallButtonPane +// ----------------------------------------------------------------------------- +// +CVtUiEndCallButtonPane& CVtUiAppUi::EndCallButtonPane() + { + __VTPRINTENTER( "VtUi.EndCallButtonPane" ) + __VTPRINTEXIT( "VtUi.EndCallButtonPane" ) + return *iInstance->iEndCallButtonPane; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DoExit +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::DoExit( TAny* aAppUi ) + { + __VTPRINTENTER( "VtUi.DoExit" ) + CVtUiAppUi* self = static_cast< CVtUiAppUi* >( aAppUi ); + self->iAsyncCallback->Cancel(); + // Before exiting ensure there are no pending actions. + self->ActiveExecInitCancel( 0 ); + self->Exit(); + __VTPRINTEXIT( "VtUi.DoExit" ) + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ExecuteCmdAsyncL +// ----------------------------------------------------------------------------- +// +CEikDialog* CVtUiAppUi::ExecuteCmdAsyncL( + CEikDialog** aDialogPtr, + const TVtEngCommandId aCommand, + TRequestStatus& aStatus ) + { + return DoExecuteCmdAsyncL( aDialogPtr, aCommand, NULL, aStatus ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ExecuteCmdAsyncL +// ----------------------------------------------------------------------------- +// +template< class T > +CEikDialog* CVtUiAppUi::ExecuteCmdAsyncL( + CEikDialog** aDialogPtr, + const TVtEngCommandId aCommand, + T& aParam, + TRequestStatus& aStatus ) + { + TPtrC8 params( reinterpret_cast< TUint8* >( &aParam ), sizeof( T ) ); + return DoExecuteCmdAsyncL( aDialogPtr, aCommand, ¶ms, aStatus ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DoExecuteCmdAsyncL +// ----------------------------------------------------------------------------- +// +CEikDialog* CVtUiAppUi::DoExecuteCmdAsyncL( + CEikDialog** aDialogPtr, + const TVtEngCommandId aCommand, + TDesC8* aParams, + TRequestStatus& aStatus ) + { + __VTPRINT2( DEBUG_GEN, "VtUi.DoExecAsync.cmd=%d", aCommand ) + MVtEngCommandHandler& command = Model().CommandHandler(); + const TInt caps = command.GetCommandCaps( aCommand ); + + if ( caps >= KErrNone ) + { + const TBool asynchronous = + ( caps & MVtEngCommandHandler::EAttribAsync ); + + if ( asynchronous ) + { + CVtUiExecuteCmdDialog* dlg = + new ( ELeave ) CVtUiExecuteCmdDialog( + aDialogPtr, + Model().CommandHandler(), + *iEventObserver ); + dlg->ExecuteCmdLD( aCommand, aParams, &aStatus ); + return dlg; + } + else + { + command.ExecuteL( aCommand, aParams ); + RefreshStatesL(); + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); + } + } + else + { + // Failed. + User::Leave( caps ); + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::Execute +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::Execute( const TVtEngCommandId aCommand, TDesC8* aParam ) + { + MVtEngCommandHandler& command = Model().CommandHandler(); + TRAPD( err, command.ExecuteL( aCommand, aParam ) ); +#ifdef VTDEBUG + if ( err != KErrNone ) + { + __VTPRINT3( DEBUG_GEN, "VtUi.Execute.Nok.cmd=%d,err=%d", aCommand, err ) + } +#endif // VTDEBUG + return err; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleForegroundChangedL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleForegroundChangedL( + TBool aIsForeground ) + { + __VTPRINTENTER( "VtUi.HandleForegroundChangedL" ) + __VTPRINT2( DEBUG_GEN, "VtUi.foreground=%d", (TInt) aIsForeground ) + + // Let the Engine know that Application's foregorund + // has changed. Then Engine can do some initalize/uninitalize + // before rendering due to the foreground state. + iState->PreHandleForegroundChangedL( aIsForeground ); + + // The availability of number entry depends on application is + // foreground or not + iInstance->iNumberEntryActivation->SetActive( aIsForeground ); + + // These operations must be done before + // sending KVtEngSetUIForeground command to engine i.e. calling + // iState->HandleForegroundChangedL( aIsForeground ) + if ( !aIsForeground ) + { + // if capture mode is on stop it + if ( iUiStates->IsCaptureModeOn() ) + { + CmdCancelCaptureL(); + } + // if brightness or contrast feature is active stop those + MVtUiFeature* br = iFeatureManager->GetFeatureById( EVtUiFeatureIdBrightness ); + if ( br ) + { + __VTPRINT( DEBUG_GEN, "VtUi.HandleForegroundChangedL br" ) + if ( br->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "VtUi.HandleForegroundChangedL br->STOP" ) + br->Stop(); + } + } + + MVtUiFeature* cr = iFeatureManager->GetFeatureById( EVtUiFeatureIdContrast ); + if ( cr ) + { + __VTPRINT( DEBUG_GEN, "VtUi.HandleForegroundChangedL cr" ) + if ( cr->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "VtUi.HandleForegroundChangedL cr->STOP" ) + cr->Stop(); + } + } + } + + TBool foregroundAndReady = EFalse; + if ( iState ) + { + foregroundAndReady = iState->HandleForegroundChangedL( aIsForeground ); + iUiStates->SetThisApplicationForeground( aIsForeground ); + } + if ( foregroundAndReady ) + { + // Refresh navi pane. This will start call duration updating + // if necessary. + RefreshNaviPaneL(); + } + else if ( !aIsForeground ) + { + iEventObserver->StopBeat(); + } + SetIncallBubbleAllowedInUsualL( !foregroundAndReady ); + __VTPRINTEXIT( "VtUi.HandleForegroundChangedL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RefreshL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RefreshL( const TInt aRefreshFlags ) + { + if ( aRefreshFlags & EUiStates ) + { + RefreshNaviPaneL(); + } + if ( aRefreshFlags & EBlind ) + { + RefreshBlind(); + } + if ( aRefreshFlags & ENaviPane ) + { + RefreshNaviPaneL(); + } + if ( aRefreshFlags & ESoftkeys ) + { + RefreshSoftkeysL(); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleEngineResetL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleEngineResetL() + { + __VTPRINTENTER( "VtUi.HandleEngineResetL" ) + if ( iShutdownRequest ) + { + __VTPRINT( DEBUG_GEN, " VtUi.HandleEngineResetL shutdown" ) + User::RequestComplete( iShutdownRequest, KErrNone ); + iShutdownRequest = NULL; + } + __VTPRINTEXIT( "VtUi.HandleEngineResetL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::StopWaitingImage +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::StopWaitingImage() + { + if ( iInstance ) + { + iDownlinkWindow->SetWaiting( EFalse ); + iUiStates->SetWaitingForFirstFrame( EFalse ); + RemoteVideoControl().MakeVisible(ETrue); + iDownlinkWindow->LayoutRemoteVideo(); + } + } + +void CVtUiAppUi::StopWhiteBalanceOrColortone() + { + if( iEventObserver ) + { + MVtEngMedia::TCameraId currentCamId; + //CVtEngMediaHandler& mediaHandler = iEventObserver->Model().Media(); + ///mediaHandler.GetCurrentCameraId( currentCamId ); + iEventObserver->Model().Media().GetCurrentCameraId( currentCamId ); + __VTPRINT2( DEBUG_GEN, " CVtUiAppUi::StopWhiteBalance currentCamId is %d", currentCamId); + + CVtUiWhiteBalance* wb = static_cast< CVtUiWhiteBalance* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdWhiteBalance ) ); + CVtUiColorTone* ct = static_cast< CVtUiColorTone* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdColourTone ) ); + + // only when the current camera switch to the Primary to stop the wb + if( currentCamId == MVtEngMedia::EPrimaryCamera ) + { + + if( wb && ( wb->State() == MVtUiFeature::EActive ) ) + { + + wb->Stop(); + } + + if( ct && ( ct->State() == MVtUiFeature::EActive ) ) + { + ct->Stop(); + } + + return; + } + if( currentCamId == MVtEngMedia::ESecondaryCamera ) + { + if( wb && wb->IsPendingCmd() ) + wb->HandlePendingCmdL(); + if( ct && ct->IsPendingCmd() ) + ct->HandlePendingCmdL(); + } + } + } +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleLayoutChanged +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::HandleLayoutChanged() + { + iLayoutChangeCallback->CallBack(); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DelayedHandleLayoutChanged +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::DelayedHandleLayoutChanged( TAny* aPtr ) + { + CVtUiAppUi* self = reinterpret_cast< CVtUiAppUi* > ( aPtr ); + self->iUiStates->SetDisableBlindSetting( ETrue ); + TRAPD( err, self->HandleLayoutChangedL() ); + self->iUiStates->SetDisableBlindSetting( EFalse ); + self->RefreshBlind(); + return err; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleLayoutChangedL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleLayoutChangedL() + { + __VTPRINTENTER( "VtUi.LayoutChg" ) + if ( iState ) + { + iState->HandleLayoutChangedL(); + } + __VTPRINTEXIT( "VtUi.LayoutChg" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DoHandleLayoutChangedL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::DoHandleLayoutChangedL() + { + __VTPRINTENTER( "VtUi.DoLayoutChg" ) + TInt error; + if( iUiStates->IsSelectingShare() ) + { + iInstance->iRemoteVideoControl->MakeVisible( ETrue ); + } + // Fully update rendering parameters + UpdateRenderingParametersL(); + // Notify engine about layout change + iLayoutChg = ETrue; + if( iDisableVideoOngoing || iShareImageOngoing ) + { + error = KErrNotReady; + } + else + { + TRAP( error, ExecuteCmdL( KVtEngHandleLayoutChange ) ); + } + iLayoutChg = EFalse; + + // Not ready error is allowed to happen (e.g. when sharing) + if ( error && ( error != KErrNotReady ) ) + { + User::Leave( error ); + } + else + { + __VTPRINT( DEBUG_GEN, + "VtUi.DoLayoutChg KVtEngHandleLayoutChange == KErrNotReady (ok)" ) + TVtEngCommandId pendingCommand = Model().CommandHandler().PendingCommand(); + TVtEngCommandId invalidCommand = Model().CommandHandler().InvalidCommand(); + + __VTPRINT2( DEBUG_GEN, "VtUi.DoLayoutChg pendingCommand=%d", + pendingCommand ) + + __VTPRINT2( DEBUG_GEN, "VtUi.DoLayoutChg invalidCommand=%d", + invalidCommand ) + + if ( pendingCommand == KVtEngMuteOutgoingAudio || + pendingCommand == KVtEngUnmuteOutgoingAudio || + pendingCommand == KVtEngSetAudioRouting || + pendingCommand == KVtEngSetAudioVolume || + pendingCommand == KVtEngSetSource || + pendingCommand == KVtEngPrepareCamera || + pendingCommand == KVtEngUnfreeze || + pendingCommand == KVtEngStopShareImage || + invalidCommand == KVtEngHandleLayoutChange ) + { + iPendingCmd = pendingCommand; + iUiStates->SetLayoutChangeNeeded( ETrue ); + } + if( iDisableVideoOngoing && pendingCommand == KVtEngCommandNone ) + { + iPendingCmd = KVtEngSetSource; + iUiStates->SetLayoutChangeNeeded( ETrue ); + } + if( iShareImageOngoing && pendingCommand == KVtEngCommandNone ) + { + iPendingCmd = KVtEngStartShareImage; + iUiStates->SetLayoutChangeNeeded( ETrue ); + } + } + // Notify component manager + iComponentManager->HandleLayoutChangeL(); + MVtUiFeature* dialer = + iFeatureManager->GetFeatureById( EVtUiFeatureIdDialer ); + const TBool dialerActive( dialer && + ( dialer->State() == MVtUiFeature::EActive ) ); + SwitchLayoutToFlatStatusPaneL( dialerActive ); + + // Update the cam's whiteBalance and colorTone cause layoutchange will renew the camera,so + // restore the last user setting + UpdateVBSettingL(); + + if( iUiStates->IsSelectingShare() ) + { + iInstance->iRemoteVideoControl->MakeVisible(EFalse); + } + if ( iDelayedCmd != 0 ) + { + __VTPRINT2( DEBUG_GEN, "VtUi.DoLayoutChg reexecute the delayed cmd=%d", iDelayedCmd); + if( iDelayedCmd == EAknSoftkeyOptions ) + { + ProcessCommandL( iDelayedCmd ); + } + else + { + HandleCommandL( iDelayedCmd ); + } + iDelayedCmd = 0; + } + __VTPRINTEXIT( "VtUi.DoLayoutChg" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleVideoFrameL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleVideoFrameL( + const TBool aLocal, + CFbsBitmap* aBitmap ) + { + if ( aLocal ) + { + iUplinkWindow->SetStreamBitmap( aBitmap ); + + if ( aBitmap ) + { + // If white balance or color tone setting feauture is + // active update feature's setting page's background. + CVtUiWhiteBalance* wb = static_cast< CVtUiWhiteBalance* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdWhiteBalance ) ); + + CVtUiColorTone* ct = static_cast< CVtUiColorTone* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdColourTone ) ); + + if ( wb ) + { + __VTPRINT( DEBUG_GEN,"VtUi.HandleVideoFrameL WB" ) + if ( wb->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN,"VtUi.HandleVideoFrameL WB update" ) + wb->UpdateBackground( aBitmap ); + } + } + if ( ct ) + { + __VTPRINT( DEBUG_GEN,"VtUi.HandleVideoFrameL CT" ) + if (ct->State() == MVtUiFeature::EActive) + { + __VTPRINT( DEBUG_GEN,"VtUi.HandleVideoFrameL CT update" ) + ct->UpdateBackground( aBitmap ); + } + } + } + } + else + { + iDownlinkWindow->SetStreamBitmap( aBitmap ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::SetVideoFrame +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SetVideoFrame( + const TBool aLocal, + CFbsBitmap* aBitmap ) + { + if ( aLocal ) + { + } + else + { + iDownlinkWindow->SetStreamBitmapReserve( aBitmap ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleVideoFrameRemoteProblemL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleVideoFrameRemoteProblemL() + { + __VTPRINTENTER( "VtUi.HandleRemote" ) + HandleVideoFrameL( EFalse, NULL ); + __VTPRINTEXIT( "VtUi.HandleRemote" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleVideoFrameLocalProblemL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleVideoFrameLocalProblemL() + { + __VTPRINTENTER( "VtUi.HandleLocal" ) + // Camera might have changed - better to stop zoom. + HandleVideoFrameL( ETrue, NULL ); + __VTPRINTEXIT( "VtUi.HandleLocal" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RemoteVideoIsSQCif +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RemoteVideoIsSQCif( TBool aIsSQCif ) + { + iUiStates->SetUseSQCif( aIsSQCif ); + if ( iDownlinkWindow == iInstance->iMainControl ) + { + ControlUsesSQCif( aIsSQCif ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ControlUsesSQCif +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ControlUsesSQCif( TBool aIsSQCif ) + { + iInstance->iMainControl->SupportSQCif( aIsSQCif ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ChangeRemoteVideoLayoutL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ChangeRemoteVideoLayoutL() + { + HandleLayoutChanged(); + if ( iDownlinkWindow == iInstance->iMainControl ) + { + iDownlinkWindow->SetBlind( EFalse ); + StopWaitingImage(); + iInstance->iMainControl->DrawNow(); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ShowImageInitializeProgressL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ShowImageInitializeProgressL() + { + __VTPRINTENTER( "VtUi.ShowImageInitializeProgressL" ) + ShowProgressDialogL( R_PROGRESS_DECODING_IMAGE_WAIT_NOTE, this ); + __VTPRINTEXIT( "VtUi.ShowImageInitializeProgressL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HideImageInitializeProgressL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HideImageInitializeProgressL() + { + __VTPRINTENTER( "VtUi.HideImageInitializeProgressL" ) + // if volume slider is visible hide it + CVtUiVolume* volume = static_cast< CVtUiVolume* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdVolume ) ); + if ( volume ) + { + volume->Stop(); + } + HideProgressDialogL(); + __VTPRINTEXIT( "VtUi.HideImageInitializeProgressL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CheckBeatL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CheckBeatL( const TBool aCallDurationEnabled ) + { + // Update call duration periodically if necessary. + const MVtEngSessionInfo::TSessionState state = Model().Session().State( EFalse ); + const TBool timerEnable = + ( aCallDurationEnabled ) && + ( ( state == MVtEngSessionInfo::EConnected ) || + ( state == MVtEngSessionInfo::ENegotiating ) || + ( state == MVtEngSessionInfo::EOpen ) ); + + if ( timerEnable && iUiStates->IsThisApplicationForeground() ) + { + iEventObserver->StartBeatL(); + } + else + { + iEventObserver->StopBeat(); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleBeat +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleBeat() + { + TRAP_IGNORE( RefreshNaviPaneL(); ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ShowCameraInUseNoteL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ShowCameraInUseNoteL() const + { + // The note must not be blocking. + + CAknNoteDialog* dlg = new ( ELeave ) CAknNoteDialog( NULL ); + + dlg->PrepareLC( R_VIDEOTELUI_INFORMATION_NOTE ); + dlg->ButtonGroupContainer().SetCommandSetL( R_AVKON_SOFTKEYS_OK_EMPTY ); + + HBufC* buf = StringLoader::LoadLC( R_VIDEOTELUI_QTN_INCAL_CLOSE_CAMCORDER ); + dlg->SetTextL( *buf ); + CleanupStack::PopAndDestroy( buf ); + + dlg->SetTone( CAknNoteDialog::EConfirmationTone ); + dlg->SetTimeout( CAknNoteDialog::EUndefinedTimeout ); + dlg->RunLD(); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ShowNotAllowedNoteL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ShowNotAllowedNoteL() const + { + HBufC* prompt = + StringLoader::LoadLC( + R_VIDEOTELUI_TEXT_NOT_ALLOWED ); + + CAknInformationNote* note = + new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + CleanupStack::PopAndDestroy( prompt ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ShowCallNotAllowedNoteL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ShowCallNotAllowedNoteL() const + { + HBufC* prompt = + StringLoader::LoadLC( + R_VIDEOTELUI_TEXT_CALL_NOT_ALLOWED ); + + CAknInformationNote* note = + new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + CleanupStack::PopAndDestroy( prompt ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ShowOtherCameraNotUsableNoteL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ShowOtherCameraNotUsableNoteL() const + { + HBufC* prompt = + StringLoader::LoadLC( + R_VIDEOTELUI_QTN_ERR_CAM_SWAP ); + + CAknInformationNote* note = + new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + CleanupStack::PopAndDestroy( prompt ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ShowUnableToOpenNoteL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ShowUnableToOpenNoteL() const + { + HBufC* prompt = + StringLoader::LoadLC( + R_VIDEOTELUI_QTN_ERR_UNABLE_TO_OPEN_IMAGE ); + CAknInformationNote* note = + new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + CleanupStack::PopAndDestroy( prompt ); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ShowImageDecodingErrorNoteL() + { + HBufC* prompt = + StringLoader::LoadLC( + R_VIDEOTELUI_QTN_INCAL_NOTE_DECODING_FAILED ); + CAknInformationNote* note = + new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + CleanupStack::PopAndDestroy( prompt ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ShowDRMNotAllowedNoteL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ShowDRMNotAllowedNoteL() const + { + HBufC* prompt = + StringLoader::LoadLC( + R_VIDEOTELUI_QTN_ERR_DRM_NOT_ALLOWED ); + CAknInformationNote* note = + new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + CleanupStack::PopAndDestroy( prompt ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::SetSoftkeysL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SetSoftkeysL( const TInt aSoftkeyResourceId ) + { + if ( iCurrentSoftkeys != aSoftkeyResourceId ) + { + if ( iCba ) + { + iCba->SetCommandSetL( aSoftkeyResourceId ); + iCba->DrawNow(); + } + iCurrentSoftkeys = aSoftkeyResourceId; + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::SetHiddenL +// Makes application visible / invisible in fast swap window. +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SetHiddenL( + const TBool aHidden ) + { + CEikonEnv* eikonEnv = iEikonEnv; + CApaWindowGroupName* windowGroupName = + CApaWindowGroupName::NewLC( + eikonEnv->WsSession(), + iThisApplicationWgId ); + windowGroupName->SetHidden( aHidden ); + User::LeaveIfError( + windowGroupName->SetWindowGroupName( + eikonEnv->RootWin() ) ); + CleanupStack::PopAndDestroy( windowGroupName ); + + // Update application UID. + TUid applicationUid = KVtUiAppUid; + if ( aHidden ) + { + applicationUid.iUid = KVtUiTelephoneUid.iUid; + } + __VTPRINT2( DEBUG_GEN, "VtUi.SetHiddenL applicationUid.iUid=%x", + applicationUid.iUid ) + // Set application that is "default top application" + TInt originalTopAppUid = 0; + TInt err = RProperty::Get( + KPSUidUikon, + KUikVideoCallTopApp, + originalTopAppUid ); + __VTPRINT3( DEBUG_GEN, "VtUi.SetHiddenL orig. topApp=%x, err=%d", + originalTopAppUid, err ) + if ( originalTopAppUid != applicationUid.iUid && + iUiStates->IsDetailsReceived() ) + { + __VTPRINT( DEBUG_GEN, "VtUi.SetHiddenL Do write KUikVideoCallTopApp" ) + // Update key only if differs from original value and call + // has been answered + RProperty::Set( + KPSUidUikon, + KUikVideoCallTopApp, + applicationUid.iUid ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::SetCallIdL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SetCallIdL( const TInt aCallId ) + { + HBufC* titlePane = + StringLoader::LoadLC( R_VIDEOTELUI_QTN_CALL_NUMBER_VIDEO, aCallId ); + TPtr ptr = titlePane->Des(); + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr ); + TitlePaneL()->SetText( titlePane ); + CleanupStack::Pop( titlePane ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::SetCallNameL +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::SetCallNameL( const TDesC& aName ) + { + HBufC* nameBuf = aName.Alloc(); + if ( nameBuf ) + { + TPtr ptr = nameBuf->Des(); + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr ); + TitlePaneL()->SetText( nameBuf ); + } + + return ( nameBuf != NULL ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::BringTelephoneForeground +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::BringTelephoneToForeground() + { + __VTPRINTENTER( "VtUi.BringTelephoneToForeground" ) + // If Telephone application is running, then + // bring it to the foreground. + const TInt windowGroupId = TelephoneApplicationWgId(); + if ( windowGroupId ) + { + CEikonEnv* eikonEnv = iEikonEnv; + TApaTask task( eikonEnv->WsSession() ); + task.SetWgId( windowGroupId ); + task.BringToForeground(); + } + + // In any case, send this application to the background. + ChangeApplicationFocus( EFalse ); + __VTPRINTEXIT( "VtUi.BringTelephoneToForeground" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ChangeApplicationFocus +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ChangeApplicationFocus( const TBool aForeground ) + { + __VTPRINTENTER( "VtUi.ChangeApplicationFocus" ) + CEikonEnv* eikonEnv = iEikonEnv; + TApaTask task( eikonEnv->WsSession() ); + task.SetWgId( iThisApplicationWgId ); + if ( !aForeground ) + { + task.SendToBackground(); + } + else if ( !iUiStates->IsDeviceLockOn() ) + { + task.BringToForeground(); + } + __VTPRINTEXIT( "VtUi.ChangeApplicationFocus" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::TelephoneApplicationWgId +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::TelephoneApplicationWgId() + { + TInt resultWgId = 0; + + TApaTaskList taskList( iEikonEnv->WsSession() ); + TInt appUid = 0; + + // Try first Telephone application. + if ( RProperty::Get( + KPSUidTelInformation, + KTelPhoneUid, + appUid ) == KErrNone ) + { + TApaTask task = taskList.FindApp( TUid::Uid( appUid ) ); + if ( task.Exists() ) + { + resultWgId = task.WgId(); + } + } + + // Then Idle application. + if ( !resultWgId && + ( RProperty::Get( + KPSUidAiInformation, + KActiveIdleUid, + appUid ) == KErrNone ) ) + { + TApaTask task = taskList.FindApp( TUid::Uid( appUid ) ); + if ( task.Exists() ) + { + resultWgId = task.WgId(); + } + } + + return resultWgId; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ShowNumberEntry +// ----------------------------------------------------------------------------- +// +inline TBool CVtUiAppUi::ShowNumberEntry() const + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::IsActiveIdleEnabledL +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::IsActiveIdleEnabledL() const + { + TVtUiActiveIdleVariation activeIdleVariation; + return activeIdleVariation.IsActiveIdleEnabled(); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CheckEngineFunctionality +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CheckEngineFunctionality() + { + const TBool prepareViewFinder = + iEventObserver->CommandSupportedAndSynchronous( + KVtEngPrepareViewFinder ); + const TBool prepareRemoteRender = + iEventObserver->CommandSupportedAndSynchronous( + KVtEngPrepareRemoteRender ); + const TBool prepareRemoteRenderDSA = + iEventObserver->CommandSupportedAndSynchronous( + KVtEngPrepareRemoteRenderDSA ); + const TBool prepareRemoteRenderDP = + iEventObserver->CommandSupportedAndSynchronous( + KVtEngPrepareRemoteRenderDP ); + const TBool stopViewFinder = + iEventObserver->CommandSupportedAndSynchronous( + KVtEngStopViewFinder ); + const TBool startViewFinder = + iEventObserver->CommandSupportedAndSynchronous( + KVtEngStartViewFinder ); + const TBool stopRemoteRender = + iEventObserver->CommandSupportedAndSynchronous( + KVtEngStopRenderRemote ); + const TBool startRemoteRender = + iEventObserver->CommandSupportedAndSynchronous( + KVtEngStartRenderRemote ); + const TBool setUIForeground = + iEventObserver->CommandSupportedAndSynchronous( + KVtEngSetUIForeground ); + + TVtUiDPVariation dpvariation; + TBool dpSupported( dpvariation.IsDPSupported() ); + + if ( !prepareViewFinder || + ( !prepareRemoteRender && !prepareRemoteRenderDSA && !dpSupported ) || + ( !prepareRemoteRender && !prepareRemoteRenderDP && dpSupported ) || + !stopViewFinder || + !startViewFinder || + !stopRemoteRender || + !startRemoteRender || + !setUIForeground ) + { + // Not supported - should never occur. + __VTPRINT( DEBUG_GEN, "VtUi.EngineFunc.ASSERT" ) + VtUiPanic::Panic( EVtUiPanicEngineFunctionalityAssert ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::Model +// ----------------------------------------------------------------------------- +// +CVtEngModel& CVtUiAppUi::Model() + { + return iEventObserver->Model(); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::VideoTelephonyVariation +// ----------------------------------------------------------------------------- +// +const TVtUiVideoTelephonyVariation& CVtUiAppUi::VideoTelephonyVariation() const + { + return iVTVariation; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::NumberSource +// ----------------------------------------------------------------------------- +// +MVtUiNumberSource* CVtUiAppUi::NumberSource() const + { + return iNumberSource; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::NaviPaneL +// ----------------------------------------------------------------------------- +// +inline CAknNavigationControlContainer* CVtUiAppUi::NaviPaneL() + { + return + static_cast< CAknNavigationControlContainer* > + ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::TitlePaneL +// ----------------------------------------------------------------------------- +// +inline CAknTitlePane* CVtUiAppUi::TitlePaneL() + { + return + static_cast< CAknTitlePane* > + ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CleanupPushRefreshL +// ----------------------------------------------------------------------------- +// +inline void CVtUiAppUi::CleanupPushRefreshL() + { + CleanupStack::PushL( + TCleanupItem( DoRefresh, this ) ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CleanupPushEnableBlindL +// ----------------------------------------------------------------------------- +// +inline void CVtUiAppUi::CleanupPushEnableBlindL() + { + CleanupStack::PushL( + TCleanupItem( DoEnableBlindSetting, this ) ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::EnableCommandActivatingAndCleanupPushL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::EnableCommandActivatingAndCleanupPushL() + { + __VTPRINTENTER( "VtUi.EnableCommandActivatingAndCleanupPushL" ) + // add anyway to cleanup stack to avoid caring about stack balance + CleanupStack::PushL( + TCleanupItem( DoDisableCommandActivating, this ) ); + // but in case of consecutive calls on this don't refresh (avoid flicker) + const TBool alreadyActivating( iUiStates->IsCommandActivating() ); + // increases ref.count if alread set as activating + iUiStates->SetIsCommandActivating( ETrue ); + if ( !alreadyActivating ) + { + // refresh only when ref.count incremented from zero. + iCommandManager->RefreshL(); + } + __VTPRINTEXIT( "VtUi.EnableCommandActivatingAndCleanupPushL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DoDisableCommandActivating +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::DoDisableCommandActivating( TAny* aAny ) + { + CVtUiAppUi* self = + reinterpret_cast< CVtUiAppUi* >( aAny ); + TRAP_IGNORE( self->HandleCommandDeactivationL() ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HandleCommandDeactivationL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HandleCommandDeactivationL() + { + __VTPRINTENTER( "VtUi.HandleCommandDeactivationL" ) + iUiStates->SetIsCommandActivating( EFalse ); + if ( !iUiStates->IsCommandActivating() ) + { + RefreshStatesL(); + } + iDisableVideoOngoing = EFalse; + __VTPRINTEXIT( "VtUi.HandleCommandDeactivationL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DoEnableBlindSetting +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::DoEnableBlindSetting( TAny* aAny ) + { + CVtUiAppUi* self = + reinterpret_cast< CVtUiAppUi* >( aAny ); + self->iUiStates->SetDisableBlindSetting( EFalse ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DoRefresh +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::DoRefresh( TAny* aAny ) + { + CVtUiAppUi* self = + reinterpret_cast< CVtUiAppUi* >( aAny ); + TRAP_IGNORE( self->RefreshL() ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DoHandleExitTimeout +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::DoHandleExitTimeout( TAny* /*aAny*/ ) + { + __VTPRINT( DEBUG_GEN, "VtUi.Exit.Timer.EXPIRED!" ) + VtUiPanic::Panic( EVtUiPanicApplicationShutdownTimeout ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// VtUiAppUi::IsViewFinderInMainPane +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::IsViewFinderInMainPane() const + { + return !( IsViewFinderInContextPane() ); + } + +// ----------------------------------------------------------------------------- +// VtUiAppUi::IsViewFinderInContextPane +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::IsViewFinderInContextPane() const + { + return ( iUplinkWindow == iInstance->iContextControl ); + } + +// ----------------------------------------------------------------------------- +// VtUiAppUi::SwitchViewFinderToMainPaneL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SwitchViewFinderToMainPaneL( TBool aUpdateState ) + { + __VTPRINTENTER( "VtUi.SwitchViewFinderToMainPaneL" ) + //change local video in to main pane + if( IsViewFinderInContextPane() ) + { + //flag indicates the initial position of uplink window before freeze + if ( aUpdateState ) + { + iUiStates->SetViewFindersInitialPlaceContextPane( ETrue ); + } + HandleCommandL( EVtUiCmdSwapImagesPlaces ); + } + else + { + if ( aUpdateState ) + { + iUiStates->SetViewFindersInitialPlaceContextPane( EFalse ); + } + } + __VTPRINTEXIT( "VtUi.SwitchViewFinderToMainPaneL" ) + } + +// ----------------------------------------------------------------------------- +// VtUiAppUi::SwitchViewFinderToContextPaneL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SwitchViewFinderToContextPaneL( TBool aUpdateState ) + { + __VTPRINTENTER( "VtUi.SwitchViewFinderToContextPaneL" ) + //change local video in to context pane + if( !IsViewFinderInContextPane() ) + { + //flag indicates the initial position of uplink window before freeze + if ( aUpdateState ) + { + iUiStates->SetViewFindersInitialPlaceContextPane( EFalse ); + } + HandleCommandL( EVtUiCmdSwapImagesPlaces ); + } + else + { + if ( aUpdateState ) + { + iUiStates->SetViewFindersInitialPlaceContextPane( ETrue ); + } + } + __VTPRINTEXIT( "VtUi.SwitchViewFinderToContextPaneL" ) + } + +// ----------------------------------------------------------------------------- +// VtUiAppUi::RestoreViewFinderL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RestoreViewFinderL() + { + __VTPRINTENTER( "VtUi.RestoreViewFinderL" ) + if( IsViewFinderInContextPane() ) + { + if( !iUiStates->IsViewFindersInitialPlaceContextPane() ) + { + SwitchViewFinderToMainPaneL( EFalse ); + } + } + else + { + if( iUiStates->IsViewFindersInitialPlaceContextPane() ) + { + SwitchViewFinderToContextPaneL( EFalse ); + } + } + __VTPRINTEXIT( "VtUi.RestoreViewFinderL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::DialogDismissedL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::DialogDismissedL( TInt ) + { + __VTPRINTENTER( "VtUi.DialogDismissedL" ) + MVtUiFeature* tb = + iFeatureManager->GetFeatureById( EVtUiFeatureIdToolbar ); + if ( tb ) + { + if ( !iTbPeriodic ) + { + iTbPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + } + iTbPeriodic->Cancel(); + // try to strat toolbar feature immediately + iTbPeriodic->Start( 0, KPeriodTime, TCallBack( DoTryToStartTbL, this ) ); + } + __VTPRINTEXIT( "VtUi.DialogDismissedL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::UpdateContextPaneIconL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::UpdateContextPaneIconL() + { + CEikStatusPane* statusPane = StatusPane(); + + if ( statusPane ) + { + if ( statusPane->PaneCapabilities( + TUid::Uid( EEikStatusPaneUidContext ) ).IsPresent() ) + { + CAknContextPane* contextPane = NULL; + TRAPD ( err, contextPane = static_cast ( + statusPane->ControlL( TUid::Uid( EEikStatusPaneUidContext ) ) ) ); + if ( err != KErrNone || ! contextPane ) + { + return; + } + + // Set a new context pane icon + CFbsBitmap* newBitmap = new(ELeave) CFbsBitmap; + CleanupStack::PushL( newBitmap ); + User::LeaveIfError( newBitmap->Create( TSize( 1, 1 ), EGray2 ) ); + + CFbsBitmap* newMask = new(ELeave) CFbsBitmap; + CleanupStack::PushL( newMask ); + User::LeaveIfError( newMask->Create( TSize( 1, 1 ), EGray2 ) ); + + // create an off-screen device and context + CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL( newMask ); + CleanupStack::PushL( bitmapDevice ); + CFbsBitGc* maskGc = NULL; + User::LeaveIfError( bitmapDevice->CreateContext( maskGc ) ); + User::LeaveIfNull( maskGc ); + CleanupStack::PushL( maskGc ); + maskGc->SetPenStyle( CGraphicsContext::ENullPen ); + maskGc->SetBrushColor( TRgb::Gray2( 1 ) ); // transparency + maskGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + maskGc->Clear(); + CleanupStack::PopAndDestroy( 2 ); // maskGc, bitmapDevice + + // newBitmap, new Mask ownership transfer + contextPane->SetPicture( newBitmap, newMask ); + CleanupStack::Pop( 2 ); // newBitmap, newMask + } + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::SetIncallBubbleAllowedInUsualL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SetIncallBubbleAllowedInUsualL( TBool aAllowed ) + { + __VTPRINT2( DEBUG_GEN, "Ui.SetIncallBubbleAllowedInUsualL: %d", aAllowed ) + + // If call is being disconnected, we do not want to show in-call bubble + // anymore but dismiss it. + if( iUiStates->ExecState() == TVtUiStates::EExecStateResetting || + iUiStates->ExecState() == TVtUiStates:: EExecStateFinalized ) + { + __VTPRINT2( DEBUG_GEN, "Ui.SetIncallBubbleAllowedInUsualL forced to false: %d", aAllowed ) + aAllowed = EFalse; + } + + if ( iIncallBubble ) + { + iIncallBubble->SetIncallBubbleAllowedInUsualL( aAllowed ); + } + __VTPRINT( DEBUG_GEN, "Ui.SetIncallBubbleAllowedInUsualL>" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ShowProgressDialogL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::ShowProgressDialogL( TInt aResourceId, + MProgressDialogCallback* aCallback ) + { + __VTPRINTENTER( "VtUi.ShowProgressDialogL" ) + if( iProgressDlg ) + { + User::Leave( KErrNotReady ); + } + iProgressDlg = new ( ELeave ) CAknProgressDialog( + reinterpret_cast< CEikDialog** >( &iProgressDlg ), ETrue ); + iProgressDlg->SetCallback( aCallback ); + iProgressDlg->ExecuteLD( aResourceId ); + __VTPRINTEXIT( "VtUi.ShowProgressDialogL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::HideProgressDialogL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::HideProgressDialogL() + { + __VTPRINTENTER( "VtUi.HideProgressDialogL" ) + if( iProgressDlg ) + { + iProgressDlg->ProcessFinishedL(); + } + __VTPRINTEXIT( "VtUi.HideProgressDialogL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::AsyncViewFinderToMainPaneAndShare +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::AsyncViewFinderToMainPaneAndShare( TAny* aPtr ) + { + __VTPRINTENTER( "VtUi.AsyncViewFinderToMainPaneAndShare" ) + CVtUiAppUi* self = reinterpret_cast< CVtUiAppUi* >( aPtr ); + + TRAPD( result, { self->SwitchViewFinderToMainPaneL(); + self->CmdShareImageL();} ); + __VTPRINTEXITR( "VtUi.AsyncViewFinderToMainPaneAndShare %d", result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::AsyncShare +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::AsyncShare( TAny* aPtr ) + { + __VTPRINTENTER( "VtUi.AsyncShare" ) + CVtUiAppUi* self = reinterpret_cast< CVtUiAppUi* >( aPtr ); + TRAPD( result, self->CmdShareImageL() ); + __VTPRINTEXITR( "VtUi.AsyncShare %d", result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::AsyncShowErrorAndRestartShare +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::AsyncShowErrorAndRestartShare( TAny* aPtr ) + { + __VTPRINTENTER( "VtUi.AsyncShowErrorAndRestartShare" ) + CVtUiAppUi* self = reinterpret_cast< CVtUiAppUi* >( aPtr ); + TRAPD( result, { self->ShowUnableToOpenNoteL(); + self->HandleCommandL( EVtUiCmdShareObjectImage ); } ); + __VTPRINTEXITR( "VtUi.AsyncShowErrorAndRestartShare %d", result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::GetCameraOrientations +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::GetCameraOrientations() + { + __VTPRINTENTER( "VtUi.GetCameraOrientations" ) + MVtEngMedia& media = Model().Media(); + media.GetCameraOrientations( iPrimaryCameraOrientation, + iSecondaryCameraOrientation ); + __VTPRINTEXIT( "VtUi.GetCameraOrientations" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::SetInitialCameraOrientationL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SetInitialCameraOrientationL() + { + __VTPRINTENTER( "VtUi.SetInitialCameraOrientationL" ) + MVtEngMedia::TCameraId cameraId; + MVtEngMedia& media( Model().Media() ); + media.GetCurrentCameraId( cameraId ); + MVtEngMedia::TCameraOrientation targetOrientation( + cameraId == MVtEngMedia::EPrimaryCamera ? + iPrimaryCameraOrientation : + ( cameraId == MVtEngMedia::ESecondaryCamera ? + iSecondaryCameraOrientation : + iCurrentCameraOrientation ) ); + if ( iCurrentCameraOrientation != targetOrientation ) + { + __VTPRINT3( DEBUG_GEN, + "VtUi.SetInitialCameraOrientationL Old=%d New=%d", + iCurrentCameraOrientation, + targetOrientation ) + SetOrientationL( engToAppOrientation[ targetOrientation ] ); + iCurrentCameraOrientation = targetOrientation; + } + __VTPRINTEXIT( "VtUi.SetInitialCameraOrientationL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::SetCameraOrientationL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::SetCameraOrientationL() + { + __VTPRINTENTER( "VtUi.SetCameraOrientationL" ) + MVtEngMedia::TCameraOrientation newOrientation = iCurrentCameraOrientation; + MVtEngMedia::TCameraId cameraId; + MVtEngMedia& media = Model().Media(); + if ( media.GetCurrentCameraId( cameraId ) == KErrNone ) + { + switch ( cameraId ) + { + case MVtEngMedia::EPrimaryCamera: + __VTPRINT( DEBUG_GEN, "VtUi.SetCameraOrient.Primary") + if( iCurrentCameraOrientation != iPrimaryCameraOrientation ) + { + newOrientation = iPrimaryCameraOrientation; + } + break; + + case MVtEngMedia::ESecondaryCamera: + __VTPRINT( DEBUG_GEN, "VtUi.SetCameraOrient.Secondary") + if ( iCurrentCameraOrientation != iSecondaryCameraOrientation ) + { + newOrientation = iSecondaryCameraOrientation; + } + break; + + default: + break; + } + } + + __VTPRINT2( DEBUG_GEN, "VtUi.SetCameraOrient.Cur=%d", + iCurrentCameraOrientation ) + __VTPRINT2( DEBUG_GEN, "VtUi.SetCameraOrient.New=%d", + newOrientation ) + + if ( iCurrentCameraOrientation != newOrientation ) + { + // map camera orientation to appui layout orientation + TAppUiOrientation newAppUiOrientation; + if ( newOrientation == MVtEngMedia::EOrientationLandscape ) + { + __VTPRINT( DEBUG_GEN, "VtUi.SetCameraOrient=LS") + newAppUiOrientation = EAppUiOrientationLandscape; + } + else if ( newOrientation == MVtEngMedia::EOrientationPortrait ) + { + __VTPRINT( DEBUG_GEN, "VtUi.SetCameraOrient=PR") + newAppUiOrientation = EAppUiOrientationPortrait; + } + else + { + __VTPRINT( DEBUG_GEN, "VtUi.SetCameraOrient=OL") + newAppUiOrientation = EAppUiOrientationUnspecified; + } + SetOrientationL( newAppUiOrientation ); + } + __VTPRINTEXIT( "VtUi.SetCameraOrientationL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RefreshStatesL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RefreshStatesL() + { + __VTPRINTENTER( "VtUi.RefreshStatesL" ) + // If transaction (set of commands) is pending refresh in delayed until + // all of them are processed. + if ( !iUiStates->IsCommandActivating() ) + { + iUiStates->Update(); + if ( iUiStates->IsThisApplicationForeground() ) + { + iCommandManager->RefreshL(); + } + } + __VTPRINTEXIT( "VtUi.RefreshStatesL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CmdAdjustVideoL +// ----------------------------------------------------------------------------- +// + void CVtUiAppUi::CmdAdjustVideoL( TInt aCommand ) + { + __VTPRINTENTER( "VtUi.CmdAdjustVideoL" ) + TInt featureId( -1 ); + switch ( aCommand ) + { + case EVtUiCmdAdjustVideoVideoQuality: + featureId = EVtUiFeatureIdVideoQuality; + break; + case EVtUiCmdAdjustVideoWhiteBalance: + featureId = EVtUiFeatureIdWhiteBalance; + break; + case EVtUiCmdAdjustVideoBrightness: + featureId = EVtUiFeatureIdBrightness; + break; + case EVtUiCmdAdjustVideoContrast: + featureId = EVtUiFeatureIdContrast; + break; + case EVtUiCmdAdjustVideoColourTone: + featureId = EVtUiFeatureIdColourTone; + break; + default: + break; + } + MVtUiFeature* vb = iFeatureManager->GetFeatureById( featureId ); + if ( vb ) + { + __VTPRINT( DEBUG_GEN, "VtUi.CmdAdjustVideoL.StartL" ); + vb->StartL(); + } + __VTPRINTEXIT( "VtUi.CmdAdjustVideoL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::AppUiInitDoneDoPostInitL +// ----------------------------------------------------------------------------- +// + void CVtUiAppUi::AppUiInitDoneDoPostInitL() + { + MVtUiFeature* tb = iFeatureManager->GetFeatureById( EVtUiFeatureIdToolbar ); + if ( tb ) + { + if ( !iTbPeriodic ) + { + iTbPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + } + iTbPeriodic->Cancel(); + // try to strat toolbar feature immediately + iTbPeriodic->Start( 0, KPeriodTime, TCallBack( DoTryToStartTbL, this ) ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::ProcessWsEventIfZoomModeIsActiveL +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::ProcessWsEventIfZoomModeIsActiveL( const TWsEvent& aEvent ) + { + __VTPRINTENTER( "VtUi.ProWsEvtIfZoomActivedL" ) + const TInt type = aEvent.Type(); + switch( type ) + { + case EEventKey: + case EEventKeyUp: + case EEventKeyDown: + { + const TKeyEvent* keyEvent = aEvent.Key(); + + + // Up and down arrow key events does the zooming, + // and should be forwarded to appui's key event handler. + // Also ETrue must be returned, so that other controls + // would not get these key events. + TEventCode eventCode = (TEventCode)aEvent.Type(); + if ( keyEvent->iScanCode == EStdKeyUpArrow || + keyEvent->iScanCode == EStdKeyDownArrow || + keyEvent->iCode == EKeyZoomIn || + keyEvent->iCode == EKeyZoomOut ) + { + HandleKeyEventL( *keyEvent, eventCode ); + __VTPRINTEXIT( "VtUi.ProWsEvtIfZoomActivedL" ) + return ETrue; + } + __VTPRINT( DEBUG_GEN, "VtUi.HandleWsEventL zoom mode set" ); + // If user selects zoom mode from options menu EEventKeyUp + // will be generated after that. Therefore this event must be + // ignored. Also EEventKeyDown are ignored. This means that + // only EEventKey events can dismiss the zoom mode. + if ( type != EEventKeyUp && type != EEventKeyDown ) + { + // If zoom mode is on only zoom mode button is available in + // toolbar. Pressing the zoom mode button in toolbar + // should not dismiss the zoom mode, that is why this events + // are ignored. If toolbar is not available and + // also EKeyDevice3 (selection key) event should dismiss + // the zoom mode. + if ( keyEvent->iCode != EKeyDevice3 || + ( keyEvent->iCode == EKeyDevice3 && + !iUiStates->IsToolbarAvailable() ) ) + { + __VTPRINT( DEBUG_GEN, "VtUi.ProWsEvtIfZoomActivedL.EKeyDevice3" ); + SetZoomModeL( EFalse ); + } + } + } + break; + + case EEventPointer: + __VTPRINT( DEBUG_GEN, "VtUi.ProWsEvtIfZoomActivedL.EEventPointer" ); + break; + + case KAknHardwareLayoutSwitch: + // Window server event used when layout changes + __VTPRINT( DEBUG_GEN, "VtUi.ProcessWsEventIfZoomModeIsActiveL.LayoutSwitch" ); + break; + + case EEventScreenDeviceChanged: + // The screen size mode has changed, for instance when the cover on a phone + // that supports screen flipping is opened or closed. + __VTPRINT( DEBUG_GEN, "VtUi.ProcessWsEventIfZoomModeIsActiveL.ScreenChanged" ); + break; + + case EVtUiWsEventNumberSourceDeactivate: + // Number source deactivated + __VTPRINT( DEBUG_GEN, "VtUi.ProWsEvtIfZoomActivedL.NumberDeactivate" ); + break; + + default: + __VTPRINT( DEBUG_GEN, "VtUi.ProWsEvtIfZoomActivedL.default" ); + // EVtUiWsEventNumberSourceActivate could be generated through number buttons + // and execution runs to default statement + SetZoomModeL( EFalse ); + break; + } + __VTPRINTEXIT( "VtUi.ProWsEvtIfZoomActivedL2" ) + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::StopSliders() +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::StopSliders() + { + __VTPRINTENTER( "VtUi.StopSliders" ) + if( iUiStates->IsBrightnessModeOn() ) + { + // if brightness feature is active, stop that + MVtUiFeature* br = iFeatureManager->GetFeatureById( EVtUiFeatureIdBrightness ); + if ( br ) + { + if ( br->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "VtUi.StopSliders br->STOP" ) + br->Stop(); + } + } + } + // if contrast feature is active, stop that + if( iUiStates->IsContrastModeOn() ) + { + // if contrast feature is active, stop that + MVtUiFeature* cr = iFeatureManager->GetFeatureById( EVtUiFeatureIdContrast ); + if ( cr ) + { + if ( cr->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "VtUi.StopSliders cr->STOP" ) + cr->Stop(); + } + } + } + // if volume feature is active, stop that + if( iUiStates->IsVolumeModeOn() ) + { + // if volume feature is active, stop that + MVtUiFeature* vl = iFeatureManager->GetFeatureById( EVtUiFeatureIdVolume ); + if ( vl ) + { + if ( vl->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "VtUi.StopSliders vl->STOP" ) + vl->Stop(); + } + } + } + // if zoom feature is active, stop that + if( iUiStates->IsZoomModeOn() ) + { + // if zoom feature is active, stop that + MVtUiFeature* zm = iFeatureManager->GetFeatureById( EVtUiFeatureIdZoom ); + if ( zm ) + { + if ( zm->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "VtUi.StopSliders zm->STOP" ) + zm->Stop(); + } + } + } + __VTPRINTEXIT( "VtUi.StopSliders" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CanSwapImagePlaces() +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::CanSwapImagePlaces() + { + __VTPRINTENTER( "VtUi.CanSwapImagePlaces" ) + TTime now; + now.HomeTime(); + // User can swap image places if the frequency is lower than maximum frequency. + if ( now.MicroSecondsFrom( iLastSwapTime ).Int64() >= KVtUiMaxSwapImagesFreq ) + { + __VTPRINT( DEBUG_GEN, "VtUi.Swap can swap image" ) + iLastSwapTime = now; + __VTPRINTEXIT( "VtUi.CanSwapImagePlaces" ) + return ETrue; + } + else + { + __VTPRINT( DEBUG_GEN, "VtUi.Swap can not swap image" ) + __VTPRINTEXIT( "VtUi.CanSwapImagePlaces" ) + return EFalse; + } + } + +// Implementation of CVtUiAppUi::CInstance + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CInstance::CInstance +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::CInstance::CInstance( CVtUiAppUi& aAppUi ) + : iAppUi( aAppUi ) + { + } + +void CVtUiAppUi::CInstance::CreateRemoteVideoControl() + { + iRemoteVideoControl = CVtUiRemoteVideoControl::NewL( iAppUi ); + iRemoteVideoControl->MakeVisible(EFalse); + iMainControl->SetRemoteVideoControl( iRemoteVideoControl ); + iMainControl->LayoutRemoteVideo(); + + iAppUi.AddToStackL( iRemoteVideoControl ); + + iRemoteVideoControlInStack = ETrue; + + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CInstance::ConstructL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CInstance::ConstructL() + { + iBitmapManager = new ( ELeave ) CVtUiBitmapManager; + + TRect parent; + TAknWindowLineLayout control; + + VtUiLayout::GetApplicationParentRect( parent ); + iMainControl = CVtUiMainControl::NewL( *iBitmapManager, + iAppUi, + *iAppUi.iUiStates ); + + VtUiLayout::GetMainPaneLayout( control ); + AknLayoutUtils::LayoutControl( iMainControl, parent, control ); + + iAppUi.AddToStackL( iMainControl ); + iMainControlInStack = ETrue; + + TAknLayoutRect layout; + layout.LayoutRect( parent, control ); + iNumberEntryActivation = + new ( ELeave ) CVtUiNumberEntryActivationControl( iAppUi ); + iNumberEntryActivation->ConstructL( layout.Rect() ); + + iContextControl = CVtUiContextControl::NewL( + *iBitmapManager, + iAppUi, + *iAppUi.iUiStates ); + + VtUiLayout::GetFirstWindowBackgroundLayout( + control ); + AknLayoutUtils::LayoutControl( iContextControl, parent, control ); + 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() ), + iAppUi ); + + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CInstance::LayoutChanged +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CInstance::LayoutChanged() + { + // Layout controls. + TRect parent; + TAknWindowLineLayout control; + VtUiLayout::GetApplicationParentRect( parent ); + VtUiLayout::GetMainPaneLayout( control ); + AknLayoutUtils::LayoutControl( iMainControl, parent, control ); + iMainControl->DrawNow(); + if(iMainControl) + { + iMainControl->LayoutRemoteVideo(); + } + + AknLayoutUtils::LayoutControl( iNumberEntryActivation, parent, control ); + VtUiLayout::GetFirstWindowBackgroundLayout( control ); + AknLayoutUtils::LayoutControl( iContextControl, parent, control ); + iContextControl->DrawNow(); + if(iContextControl) + iContextControl->LayoutRemoteVideo(); + VtUiLayout::GetButtonPaneLayout( control ); + AknLayoutUtils::LayoutControl( iEndCallButtonPane, parent, control ); + iEndCallButtonPane->DrawNow(); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CInstance::VolumeKeyPressedL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CInstance::VolumeKeyPressedL() + { + __VTPRINTENTER( "CVtUiAppUi.VolumeKeyPressedL" ) + // if the application is in foreground show volume sliders + if ( iAppUi.IsForeground() ) + { + // If application is shutting down, no need to show volume popup + if ( iAppUi.iState == NULL || + iAppUi.iState == + TVtUiStateResetting::InstanceL( iAppUi, *iAppUi.iUiStates ) ) + { + return; + } + + CVtUiVolume* volume = static_cast< CVtUiVolume* >( + iAppUi.iFeatureManager->GetFeatureById( EVtUiFeatureIdVolume ) ); + if ( volume ) + { + // If the capture mode is on we should + // end the capture mode + if( iAppUi.iUiStates->IsCaptureModeOn() ) + { + __VTPRINT( DEBUG_GEN, "CVtUiAppUi.VolumeKeyPressedL cancel capture" ) + iAppUi.CmdCancelCaptureL(); + } + else if ( iAppUi.iUiStates->IsZoomModeOn() ) + { + // If zoom feature is active, stop that + MVtUiFeature* zm = iAppUi.iFeatureManager->GetFeatureById( EVtUiFeatureIdZoom ); + if ( zm ) + { + if ( zm->State() == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "CVtUiAppUi.VolumeKeyPressedL zm->STOP" ) + zm->Stop(); + } + } + } + + iAppUi.RetryToStartTbL(); + volume->StartL(); + + // Toolbar needs to be refreshed if zoom, contrat and brightness were dismissed + CVtUiToolbarBase* tb = static_cast< CVtUiToolbarBase* >( + iAppUi.iFeatureManager->GetFeatureById( EVtUiFeatureIdToolbar ) ); + if ( tb ) + { + tb->RefreshL(); + } + } + } + __VTPRINTEXIT( "CVtUiAppUi.VolumeKeyPressedL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CInstance::NewL +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::CInstance* CVtUiAppUi::CInstance::NewL( CVtUiAppUi& aAppUi ) + { + CInstance* self = new ( ELeave ) CInstance( aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CInstance::~CInstance +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::CInstance::~CInstance() + { + if ( iMainControl && iMainControlInStack ) + { + iAppUi.RemoveFromStack( iMainControl ); + } + if ( iContextControl && iContextControlInStack ) + { + iAppUi.RemoveFromStack( iContextControl ); + } + if(iRemoteVideoControl &&iRemoteVideoControlInStack) + { + 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 + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::CEventObserver +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::CEventObserver::CEventObserver( CVtUiAppUi& aAppUi ) + : iAppUi( aAppUi ), + iCommandObservers( KVtUiCommandObserverArrayGranularity ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::ConstructL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::ConstructL() + { + iModel = CVtEngModel::NewL( *this, *this ); + + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::NewL +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::CEventObserver* CVtUiAppUi::CEventObserver::NewL( + CVtUiAppUi& aAppUi ) + { + CEventObserver* self = new ( ELeave ) CEventObserver( aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::~CEventObserver +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::CEventObserver::~CEventObserver() + { + iCommandObservers.Close(); + + delete iModel; + delete iBeat; + + delete iRemConInterfaceSelector; + iRemConCoreApiTarget = NULL; // not owned. + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::Model +// ----------------------------------------------------------------------------- +// +inline CVtEngModel& CVtUiAppUi::CEventObserver::Model() + { + return *iModel; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::CreateRemConSessionL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::CreateRemConSessionL() + { + __VTPRINTENTER( "VtUiComms.CreateRemCon" ) + // If one of the iRemCon* pointers equals to NULL, then all of them are + // NULL. + if ( !iRemConInterfaceSelector ) + { + CRemConInterfaceSelector* interfaceSelector = + CRemConInterfaceSelector::NewL(); + CleanupStack::PushL( interfaceSelector ); + + CRemConCoreApiTarget* coreApiTarget = + CRemConCoreApiTarget::NewL( *interfaceSelector, *this ); + // The coreApiTarget instance is owned by interfaceSelector instance. + // This instance must implement MRemConCoreApiTargetObserver interface. + __VTPRINT( DEBUG_GEN, "VtUiComms.CreateRemCon, done creating coreApiTarget" ) + CleanupStack::PushL( coreApiTarget ); + interfaceSelector->OpenTargetL(); + + iRemConVolumeRepeatTimer = CPeriodic::NewL( CActive::EPriorityHigh ); + + CleanupStack::Pop( coreApiTarget ); + CleanupStack::Pop( interfaceSelector ); + + iRemConInterfaceSelector = interfaceSelector; + iRemConCoreApiTarget = coreApiTarget; + } + __VTPRINTEXIT( "VtUiComms.CreateRemCon" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::DeleteRemConSession +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::DeleteRemConSession() + { + delete iRemConVolumeRepeatTimer; + iRemConVolumeRepeatTimer = NULL; + + delete iRemConInterfaceSelector; + iRemConInterfaceSelector = NULL; + + iRemConCoreApiTarget = NULL; // not owned. + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::CommandSupported +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::CEventObserver::CommandSupported( + const TInt aCommandId ) const + { + const TInt caps = iModel->CommandHandler().GetCommandCaps( aCommandId ); + return + ( caps >= KErrNone ) && + ( caps & MVtEngCommandHandler::EAttribSupported ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::CommandSupportedAndSynchronous +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::CEventObserver::CommandSupportedAndSynchronous( + const TInt aCommandId ) const + { + const TInt caps = iModel->CommandHandler().GetCommandCaps( aCommandId ); + return + ( caps >= KErrNone ) && + ( caps & MVtEngCommandHandler::EAttribSupported ) && + ( ~caps & MVtEngCommandHandler::EAttribAsync ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::AddObserverL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::AddObserverL( + MVtEngCommandObserver& aObserver ) + { + User::LeaveIfError( + iCommandObservers.Append( &aObserver ) ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::RemoveObserver +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::RemoveObserver( + MVtEngCommandObserver& aObserver ) + { + const TInt pos = iCommandObservers.Find( &aObserver ); + if ( pos != KErrNotFound ) + { + if ( !iInCommandPerformed ) + { + iCommandObservers.Remove( pos ); + } + else + { + iCommandObservers[ pos ] = NULL; + } + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::StartBeatL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::StartBeatL() + { + if ( !iBeat ) + { + iBeat = CHeartbeat::NewL( CActive::EPriorityStandard ); + } + + if ( !iBeat->IsActive() ) + { + iBeat->Start( ETwelveOClock, this ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::StopBeat +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::StopBeat() + { + delete iBeat; + iBeat = NULL; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::StopVolumeRepeatTimer +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::StopVolumeRepeatTimer() + { + iRemConVolumeRepeatTimer->Cancel(); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::HandleVtEventL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::HandleVtEventL( + TInt aEvent ) + { + __VTPRINTENTER( "VtUiComms.HandleVtEventL" ) + __VTPRINT2( DEBUG_GEN, "VtUi.HandleEvt=%d", aEvent ) + + /** Allow application state to handle event first. It may also deny further + * handling by indicating the event was handled */ + if ( iAppUi.iState && + iAppUi.iState->HandleVtEventL( aEvent ) + == TVtUiAppStateBase::EEventHandled ) + { + __VTPRINTEXITR( "VtUiComms.HandleVtEventL %d", 0 ) + return; + } + + TInt callBits = EVtUiRefreshStates; + + // New camera orientation + switch( aEvent ) + { + case KVtEngSourceChanged: + callBits |= EVtUiSetOrientation; + break; + default: + break; + } + + switch( aEvent ) + { + case KVtEngSourceChanged: + callBits |= EVtUiStopWBOrColortone; + break; + default: + break; + } + + switch( aEvent ) + { + case KVtEngSessionWaitingCallActive: + case KVtEngSessionWaitingCallInactive: + iAppUi.HandleWaitingStateChange( + aEvent == KVtEngSessionWaitingCallActive ); + break; + default: + break; + } + switch( aEvent ) + { + case KVtEngShareImageInitializeBegin: + callBits |= EVtUiShowImageInitializingProgress; + break; + + case KVtEngShareImageInitializeEnd: + callBits |= EVtUiHideImageInitializingProgress; + break; + + case KVtEngShareImageDecodingError: + callBits |= EVtUiShowDecodingError; + break; + + default: + break; + } + + // Handle rendering problems. + switch ( aEvent ) + { + case KVtEngRemoteRenderingProblem: + callBits |= EVtUiHandleVideoFrameRemoteProblem; + break; + + case KVtEngViewFinderStopped: + case KVtEngLocalRenderingProblem: + callBits |= EVtUiHandleVideoFrameLocalProblem; + break; + + default: + break; + } + + // Refresh navipane. + switch ( aEvent ) + { + case KVtEngSourceChanged: + case KVtEngCameraChanged: + case KVtEngSessionStateChanged: + case KVtEngDurationSettingChanged: + case KVtEngAudioOutputVolumeChanged: + case KVtEngAudioRoutingChanged: + case KVtEngAudioMuted: + case KVtEngAudioUnmuted: + callBits |= EVtUiRefreshNaviPane; + break; + + default: + break; + } + + // Refresh softkeys. + switch ( aEvent ) + { + case KVtEngSourceChanged: + case KVtEngSourceCapsChanged: + case KVtEngSessionAnswerPossible: + case KVtEngSessionStateChanged: + case KVtEngAudioRoutingChanged: + case KVtEngAudioRoutingAvailabilityChanged: + case KVtEngAudioMuted: + case KVtEngAudioUnmuted: + case KVtEngLCHProviderSwitchDone: + callBits |= EVtUiRefreshSoftkeys; + break; + + default: + break; + } + + // Refresh blind status + switch ( aEvent ) + { + case KVtEngSourceChanged: + case KVtEngRemoteVideoPaused: + case KVtEngRemoteVideoResumed: + case KVtEngRemoteVideoStarted: + case KVtEngRemoteVideoStopped: + case KVtEngLCHProviderSwitchDone: + callBits |= EVtUiRefreshBlind; + break; + + default: + break; + } + + // Check if it's required to stop "waiting image" display. + switch ( aEvent ) + { + case KVtEngRemoteVideoResumed: + case KVtEngRemoteVideoStarted: + callBits |= EVtUiStopWaitingImage; + break; + + default: + break; + } + + // Check if it is needed to set a new layout for remote renderer. + switch ( aEvent ) + { + case KVtEngResolutionToQCIF: + callBits |= EVtUiChangeRemoteVideoLayout; + iAppUi.RemoteVideoIsSQCif( EFalse ); + break; + case KVtEngResolutionToSQCIF: + callBits |= EVtUiChangeRemoteVideoLayout; + iAppUi.RemoteVideoIsSQCif( ETrue ); + break; + default: + break; + } + + switch ( aEvent ) + { + case KVtEngAudioRoutingChanged: + case KVtEngAudioRoutingAvailabilityChanged: + case KVtEngMediaOutgoingVideoChannelStatusChanged: + case KVtEngMediaOutgoingAudioChannelStatusChanged: + callBits |= EVtUiMediaStateChanged; + break; + + case KVtEngAudioVolumeMin: + iAppUi.KeySounds()->PlaySound( EAvkonSIDVolumeMinTone ); + break; + + case KVtEngAudioVolumeMax: + iAppUi.KeySounds()->PlaySound( EAvkonSIDVolumeMaxTone ); + break; + + default: + break; + } + + // Refresh Menu. + switch ( aEvent ) + { + case KVtEngSourceChanged: + callBits |= EVtUiRefreshMenu; + callBits |= EVtUiStopBrightnessOrContrast; + callBits |= EVtUiRefreshZoomPopup; + callBits |= EVtUiEnableEndCallButton; + break; + default: + break; + } + switch ( aEvent ) + { + case KVtEngAudioMuted: + case KVtEngAudioUnmuted: + callBits |= EVtUiRefreshMenu; + break; + default: + break; + } + TRAP_IGNORE ( DoExecuteL( callBits ) ); + __VTPRINTEXITR( "VtUiComms.HandleVtEventL %d", 1 ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::HandleVTCommandPerformedL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::HandleVTCommandPerformedL( + TVtEngCommandId aCommand, + const TInt aError ) + { + __VTPRINTENTER( "VtUiComms.HandleVTCommandPerformedL" ) + __VTPRINT2( DEBUG_GEN, "VtUiComms.HandleVTCommandPerformedL aCommand = %d", + aCommand ) + + if ( aCommand == KVtEngSetSource && + TVtUiAppStateBase::ShutdownRequested() ) + { + // We are going to quit + // Pending cmd needs to be set none + iAppUi.iPendingCmd = KVtEngCommandNone; + // The next layoutchange needs to be cancelled + iAppUi.iUiStates->SetLayoutChangeNeeded( EFalse ); + } + else + { + if ( iAppUi.iState && + iAppUi.iState->HandleVTCommandPerformedL( aCommand, aError ) == + TVtUiAppStateBase::EEventHandled ) + { + // state didn't allow further processing of command completion + __VTPRINTEXITR( "VtUiComms.HandleVTCommandPerformedL %d", 0 ) + return; + } + } + + iAppUi.RefreshStatesL(); + + if ( aCommand == KVtEngMuteOutgoingAudio || + aCommand == KVtEngUnmuteOutgoingAudio ) + { + iAppUi.RefreshL(); + } + + const TInt count = iCommandObservers.Count(); + TInt nullPosition = KErrNotFound; + + iInCommandPerformed = ETrue; + + // iInCommandPerformed equals ETrue while inside the following loop; + // Exceptions must not be raised. + for ( TInt index = 0; index < count; index++ ) + { + MVtEngCommandObserver* obs = iCommandObservers[ index ]; + if ( obs ) + { + TRAP_IGNORE( obs->HandleVTCommandPerformedL( aCommand, aError ) ); + } + else + { + // We store only one position; eventually all NULL elements of the + // array will be removed. + nullPosition = index; + } + } + iInCommandPerformed = EFalse; + + if ( nullPosition != KErrNotFound ) + { + iCommandObservers.Remove( nullPosition ); + } + + // Specific handling of some commands: + if ( aCommand == KVtEngResetEngine ) // Engine has been reset + { + __ASSERT_ALWAYS( !aError, VtUiPanic::Panic( EVtUiPanicResetFailed ) ); + iAppUi.HandleEngineResetL(); + } + else if ( ( aCommand == KVtEngInitializeShareImage ) || + ( aCommand == KVtEngStartShareImage ) ) + { + __VTPRINT3( DEBUG_GEN, + "VtUi.HandleVTCommandPerformedL cmd=%d err=%d", aCommand, aError ); + + iAppUi.iShareImageOngoing = EFalse; + if( aError != KErrNone ) + { + // stop toolbar feature to prevent drawing over error dialog + MVtUiFeature* tb = iAppUi.iFeatureManager-> + GetFeatureById( EVtUiFeatureIdToolbar ); + if ( tb ) + { + tb->Stop(); + } + iAppUi.iAsyncCallback->Set( + TCallBack( &AsyncShowErrorAndRestartShare, &iAppUi ) ); + iAppUi.iAsyncCallback->CallBack(); + } + else if( aCommand == KVtEngInitializeShareImage ) + { + if ( iAppUi.iUiStates->IsViewFinderToMainPane() ) + { + iAppUi.iAsyncCallback->Set( + TCallBack( &AsyncViewFinderToMainPaneAndShare, &iAppUi ) ); + } + else + { + iAppUi.iAsyncCallback->Set( + TCallBack( &AsyncShare, &iAppUi ) ); + } + iAppUi.iAsyncCallback->CallBack(); + iAppUi.iShareImageOngoing = ETrue; + } + else if( iAppUi.iUiStates->IsLayoutChangeNeeded() && + aCommand == KVtEngStartShareImage && + aCommand == iAppUi.iPendingCmd ) + { + iAppUi.iPendingCmd = KVtEngCommandNone; + iAppUi.iUiStates->SetLayoutChangeNeeded( EFalse ); + iAppUi.DoHandleLayoutChangedL(); + } + } + else if ( iAppUi.iUiStates->IsLayoutChangeNeeded() && + ( aCommand == KVtEngSetSource || + aCommand == KVtEngPrepareCamera || + aCommand == KVtEngStopShareImage || + aCommand == KVtEngUnfreeze || + aCommand == KVtEngHandleLayoutChange ) || + ( ( aCommand == KVtEngMuteOutgoingAudio || + aCommand == KVtEngUnmuteOutgoingAudio || + aCommand == KVtEngSetAudioRouting || + aCommand == KVtEngSetAudioVolume ) && + ( aCommand == iAppUi.iPendingCmd ) ) ) + { + iAppUi.iPendingCmd = KVtEngCommandNone; + iAppUi.iUiStates->SetLayoutChangeNeeded( EFalse ); + iAppUi.DoHandleLayoutChangedL(); + } + // Handle condition that commmand setsource and layoutchange + // without layoutchange needed in UI + else if ( aCommand == KVtEngHandleLayoutChange || + aCommand == KVtEngSetSource ) + { + iAppUi.EndCallButtonPane().SetEnabled( ETrue ); + } + __VTPRINTEXITR( "VtUiComms.HandleVTCommandPerformedL %d", 1 ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::vtHandleFrameL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::vtHandleFrameL( + TFrameType aType, + CFbsBitmap* aBitmap ) + { + static TUint32 lastTick = 0; + static TBool flag = EFalse; + + + CEikMenuBar* menuBar = (STATIC_CAST(CEikonEnv*, this->iAppUi.iCoeEnv))->AppUiFactory()->MenuBar(); + if ( menuBar && menuBar->IsDisplayed() ) + { + if ( !flag ) + { + flag = ETrue; + lastTick = User::NTickCount(); + } + else + { + TUint32 newTick = User::NTickCount(); + + //don't consider time wrap + //one frame per 200ms + if ( newTick - lastTick < 400 ) + { + __VTPRINTEXITR( "CVtUiAppUi::CEventObserver::vtSetFrame %d", 0 ) + return; + } + else + { + lastTick = newTick; + } + } + } + else + { + flag = EFalse; + } + + TBool local = EFalse; + switch ( aType ) + { + case ELocalVideoFrame: + local = ETrue; + break; + + case ERemoteVideoFrame: + default: + break; + } + + iAppUi.HandleVideoFrameL( local, aBitmap ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::vtSetFrame +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::vtSetFrame( + TFrameType aType, + CFbsBitmap* aBitmap ) + { + TBool local = EFalse; + switch ( aType ) + { + case ELocalVideoFrame: + local = ETrue; + break; + + case ERemoteVideoFrame: + default: + break; + } + + iAppUi.SetVideoFrame( local, aBitmap ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::Beat +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::Beat() + { + iAppUi.HandleBeat(); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::Synchronize +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::Synchronize() + { + iAppUi.HandleBeat(); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::DoExecuteL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::DoExecuteL( TInt aBits ) + { + __VTPRINT2( DEBUG_GEN, "VtUi.DoExec.bits=%d", aBits ) + + // Array of methods - leaving methods are allowed. + const TMethodL methodArray[] = + { + &CVtUiAppUi::RefreshStatesL, + &CVtUiAppUi::HandleVideoFrameRemoteProblemL, + &CVtUiAppUi::HandleVideoFrameLocalProblemL, + &CVtUiAppUi::RefreshNaviPaneL, + &CVtUiAppUi::RefreshSoftkeysL, + &CVtUiAppUi::RefreshBlind, + &CVtUiAppUi::StopWaitingImage, + &CVtUiAppUi::ChangeRemoteVideoLayoutL, + &CVtUiAppUi::ShowImageInitializeProgressL, + &CVtUiAppUi::HideImageInitializeProgressL, + &CVtUiAppUi::SetCameraOrientationL, + &CVtUiAppUi::MediaStateChangedL, + &CVtUiAppUi::ShowImageDecodingErrorNoteL, + &CVtUiAppUi::StopWhiteBalanceOrColortone, + &CVtUiAppUi::RefreshMenuL, + &CVtUiAppUi::StopBrightnessOrContrast, + &CVtUiAppUi::RefreshZoomPopupL, + &CVtUiAppUi::EnableEndCallButton + }; + const TInt count = ( sizeof( methodArray ) / sizeof ( TMethodL ) ); + + // Execute selected methods. + while ( aBits ) + { + for ( TInt index = 0; ( index < count ) && aBits; index++ ) + { + const TInt mask = ( 1 << index ); + if ( aBits & mask ) + { + // Bit is set if corresponding method + // is wanted to be executed. + + aBits &= ~mask; + TMethodL method = methodArray[ index ]; + ( iAppUi.*method )(); // may leave + } + } + aBits = 0; // for loop executed successfully. + } + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::HandleVolumeChange +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::HandleVolumeChange( + TRemConCoreApiButtonAction aButtonAct ) + { + __VTPRINTENTER( "VtUi.HandleVolumeChange" ) + // Order of the events is as follows: + // Click - Immediately when key is pressed down + // Press - After 0.6 seconds + // Release - When key is released after 0.6 seconds + // + // Thus, the following sequences are possible from single keypress: + // + // <0.6 sec pause> + + switch ( aButtonAct ) + { + case ERemConCoreApiButtonPress: + __VTPRINT( DEBUG_GEN, "VtUi.HandleVolumeChange.ButtonPress" ) + TRAP_IGNORE( iAppUi.AdjustVolumeL( iRCCAOperationId ) ); + TRAP_IGNORE( iAppUi.RefreshVolumeL() ); + TRAP_IGNORE( iAppUi.iInstance->VolumeKeyPressedL() ); + + iRemConVolumeRepeatTimer->Start( + KVtUiVolumeRepeatLongDelay, + KVtUiVolumeRepeatDelay, + TCallBack( DoHandleVolumeRepeat, this ) ); + + break; + + case ERemConCoreApiButtonRelease: + __VTPRINT( DEBUG_GEN, "VtUi.HandleVolumeChange.ButtonRelease" ) + iRCCAOperationId = ENop; + TRAP_IGNORE( iAppUi.iInstance->VolumeKeyPressedL() ); + break; + + case ERemConCoreApiButtonClick: + __VTPRINT( DEBUG_GEN, "VtUi.HandleVolumeChange.ButtonClick" ) + TRAP_IGNORE( iAppUi.AdjustVolumeL( iRCCAOperationId ) ); + TRAP_IGNORE( iAppUi.RefreshVolumeL() ); + TRAP_IGNORE( iAppUi.iInstance->VolumeKeyPressedL() ); + break; + + default: + break; + } + __VTPRINTEXIT( "VtUi.HandleVolumeChange" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::HandleRemMuteChange +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::HandleRemMuteChange( + TRemConCoreApiButtonAction aButtonAct ) + { + __VTPRINTENTER( "VtUi.EventObserver.HandleRemMuteChange" ) + TBool AudioEn (EFalse ); + AudioEn = iAppUi.iUiStates->AudioState().IsAudio(); + if( AudioEn ) + iAppUi.HandleCommandL( EVtUiCmdDisableAudio ); + else + iAppUi.HandleCommandL( EVtUiCmdEnableAudio ); + __VTPRINTEXIT( "VtUi.EventObserver.HandleRemMuteChange" ) + } +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::DoHandleVolumeRepeat +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::CEventObserver::DoHandleVolumeRepeat( TAny* aAny ) + { + __VTPRINTENTER( "VtUi.SvkRpt" ) + CEventObserver* self = reinterpret_cast< CEventObserver* >( aAny ); + TRAP_IGNORE( self->iAppUi.AdjustVolumeL( self->iRCCAOperationId ) ); + TRAP_IGNORE( self->iAppUi.RefreshVolumeL() ); + __VTPRINTEXIT( "VtUi.SvkRpt" ) + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::RefreshVolumeL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::RefreshVolumeL() + { + __VTPRINTENTER( "VtUi.RefreshVolumeL" ) + // Refresh volume + CVtUiVolume* volume = static_cast< CVtUiVolume* >( + iFeatureManager->GetFeatureById( EVtUiFeatureIdVolume ) ); + if ( volume ) + { + volume->RefreshL(); + } + __VTPRINTEXIT( "VtUi.RefreshVolumeL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::AdjustVolumeL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::AdjustVolumeL( TRemConCoreApiOperationId aOperationId ) + { + __VTPRINTENTER( "VtUi.AdjustVolumeL" ) + __VTPRINT2( DEBUG_GEN, + "VtUi.AdjustVolumeL aOperationId = %d", aOperationId ) + TInt command( KVtEngCommandNone ); + switch ( aOperationId ) + { + case ERemConCoreApiVolumeDown: + command = KVtEngDecreaseAudioVolume; + break; + + case ERemConCoreApiVolumeUp: + command = KVtEngIncreaseAudioVolume; + break; + + default: + break; + } + + if ( command != KVtEngCommandNone ) + { + ExecuteCmdL( command ); + } + __VTPRINTEXIT( "VtUi.AdjustVolumeL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CEventObserver::MrccatoCommand +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CEventObserver::MrccatoCommand( + TRemConCoreApiOperationId aOperationId, + TRemConCoreApiButtonAction aButtonAct ) + { + __VTPRINTENTER( "VtUi.MrccatoCommand" ) + // Side volume keys will also dismiss zoom mode if zoom mode is active + if ( iAppUi.iUiStates->IsZoomModeOn() ) + { + __VTPRINT( DEBUG_GEN, "VtUi.MrccatoCommand1" ) + TRAP_IGNORE( iAppUi.SetZoomModeL( EFalse )); + } + + iRemConVolumeRepeatTimer->Cancel(); + iRCCAOperationId = aOperationId; + switch ( aOperationId ) + { + case ERemConCoreApiVolumeUp: + // if volume in maximum value and volume up is pressed + // volume indicator must still be shown for a while if + // muted or call duration is shown in navipane + __VTPRINT( DEBUG_GEN, "VtUi.MrccatoCommand ERemConCoreApiVolumeUp" ) + HandleVolumeChange( aButtonAct ); + break; + + case ERemConCoreApiVolumeDown: + // if volume in minimun value and volume down is pressed + // volume indicator must still be shown for a while if + // muted or call duration is shown in navipane + __VTPRINT( DEBUG_GEN, "VtUi.MrccatoCommand ERemConCoreApiVolumeDown" ) + HandleVolumeChange( aButtonAct ); + break; + case ERemConCoreApiMute: + __VTPRINT( DEBUG_GEN, "VtUi.MrccatoCommand ERemConCoreApiMute" ) + HandleRemMuteChange( aButtonAct ); + default: + // Other commands ignored. + break; + } + __VTPRINTEXIT( "VtUi.MrccatoCommand" ) + } + +// Implementation of CVtUiAppUi::CVtUiAppUiMGVerifier + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CVtUiAppUiMGVerifier::NewLC +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::CVtUiAppUiMGVerifier* CVtUiAppUi::CVtUiAppUiMGVerifier::NewLC( + CVtUiAppUi& aAppUi, CCoeEnv& aCoeEnv ) + { + CVtUiAppUiMGVerifier* self = new ( ELeave ) + CVtUiAppUiMGVerifier( aAppUi, aCoeEnv ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CVtUiAppUiMGVerifier::~CVtUiAppUiMGVerifier +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::CVtUiAppUiMGVerifier::~CVtUiAppUiMGVerifier() + { + delete iManager; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CVtUiAppUiMGVerifier::VerifySelectionL +// ----------------------------------------------------------------------------- +// +TBool CVtUiAppUi::CVtUiAppUiMGVerifier::VerifySelectionL( + const MDesCArray* aSelectedFiles ) + { + TBool isOk( EFalse ); + if ( aSelectedFiles->MdcaCount() > 0 ) + { + TVirtualPathPtr virtualPath( + aSelectedFiles->MdcaPoint( 0 ), KDefaultContentObject ); + + // not ptotected by default + TInt isProtected = 0; + + TInt err = iManager->GetAttribute( EIsProtected, + isProtected, virtualPath ); + if ( isProtected ) + { + iAppUi.ShowDRMNotAllowedNoteL(); + } + if ( err == KErrNone ) + { + isOk = !isProtected; + } + } + return isOk; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CVtUiAppUiMGVerifier::ConstructL +// ----------------------------------------------------------------------------- +// +void CVtUiAppUi::CVtUiAppUiMGVerifier::ConstructL() + { + iManager = CManager::NewL(); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppUi::CVtUiAppUiMGVerifier::CVtUiAppUiMGVerifier +// ----------------------------------------------------------------------------- +// +CVtUiAppUi::CVtUiAppUiMGVerifier::CVtUiAppUiMGVerifier( + CVtUiAppUi& aAppUi, CCoeEnv& aCoeEnv ) + : iAppUi( aAppUi ), iCoeEnv( &aCoeEnv ) + { + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiBitmapManager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiBitmapManager.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,662 @@ +/* +* Copyright (c) 2004 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: Implementation of the CVtUiBitmapManager class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiBitmapManager.h" +#include "VtUiLayout.h" +#include "VtUiPanic.h" + +#include +#include +#include + +// CONSTANTS + +// Granularity of bitmap manager array. +const TInt KVtUiBitmapManagerGranularity = 16; + +// MODULE DATA STRUCTURES + +/** +* CBitmapInfo instances hold information of a bitmap and its mask. +* @since Series 60 2.8 +*/ +class CVtUiBitmapManager::CBitmapInfo + : public CBase + { + public: // Constructors and destructor + + /** + * Constructor. + */ + inline CBitmapInfo( + TVtUiBitmapPoolId aId ); + + /** + * Destructor. + */ + ~CBitmapInfo(); + + /** + * Sets bitmap identifiers. + * @param aBitmapId bitmap identifier. + * @param aBitmapMaskId bitmap mask identifier. + */ + inline void SetBitmaps( + TVtUiBitmapId aBitmapId, + TVtUiBitmapId aBitmapMaskId ); + + /** + * Sets bitmap identifier. + * @param aBitmapId bitmap identifier. + */ + inline void SetBitmap( + TVtUiBitmapId aBitmapId ); + + /** + * Sets size. + * @param aSize size of the bitmaps. + */ + inline void SetSize( const TSize& aSize ); + + /** + * Sets aspect ratio preservation. + * @param aPreserve ETrue if aspect ratio preserved. + */ + inline void SetAspectRatio( TBool aPreserve ); + + /** + * Sets default color required / not required for this bitmap. + * By default, default color is not required. + * @param aRequireDefaultColor ETrue if default color is required, + * EFalse otherwise. + */ + inline void SetDefaultColorRequired( + TBool aRequireDefaultColor ); + + /** + * Sets default color. + * @param aDefaultColor default color. + */ + inline void SetDefaultColor( const TRgb& aDefaultColor ); + + /** + * Returns bitmap pool identifier. + * @return bitmap pool identifier. + */ + inline TVtUiBitmapPoolId BitmapPoolId() const; + + /** + * Gets a bitmap and its mask. + * @param aBitmap bitmap. + * @param aBitmapMask bitmap mask. + */ + inline void GetBitmap( + CFbsBitmap*& aBitmap, + CFbsBitmap*& aBitmapMask ); + + /** + * Resets bitmap information. + */ + void Reset(); + + /** + * Constructs bitmap as far as possible. + * @param aTmpFileName temporary file name, + */ + void Require( TFileName& aTmpFileName ); + + private: + + /** + * Creates bitmaps using AVKON methods. + * @param aTmpFileName temporary file name, + */ + void DoCreateBitmapsL( TFileName& aTmpFileName ); + + /** + * Sets size to the bitmap using AVKON method. + */ + void DoSetSize(); + + private: + + // Bitmap pool identifier. + TVtUiBitmapPoolId iBitmapPoolId; + + // Size has been defined. + TBool iHasSize; + + // Size of the bitmap has been changed. + TBool iSizeChanged; + + // Size of the bitmaps. + TSize iSize; + + // ETrue if default color required. + TBool iRequireDefaultColor; + + // Default color has been defined. + TBool iHasDefaultColor; + + // Default color. + TRgb iDefaultColor; + + // Bitmap identifier. + TVtUiBitmapId iBitmapId; + + // Owned bitmap instance. + CFbsBitmap* iBitmap; + + // Bitmap mask identifier. + TVtUiBitmapId iBitmapMaskId; + + // Owned bitmap mask instance. + CFbsBitmap* iBitmapMask; + + // ETrue if bitmaps have been created. + TBool iDoCreateBitmaps; + + // ETrue if size has been set. + TBool iDoSetSize; + + // ETrue if aspect ratio preservation has been updated. + TBool iHasAspectRatioPreserve; + + // ETrue if aspect ratio should be preserved. + TBool iAspectRatioPreserve; + + }; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CVtUiBitmapManager +// ----------------------------------------------------------------------------- +// +CVtUiBitmapManager::CVtUiBitmapManager() + : iBitmapArray( KVtUiBitmapManagerGranularity ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::~CVtUiBitmapManager +// ----------------------------------------------------------------------------- +// +CVtUiBitmapManager::~CVtUiBitmapManager() + { + iBitmapArray.ResetAndDestroy(); + iBitmapArray.Close(); + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::AddBitmapsL +// ----------------------------------------------------------------------------- +// +TVtUiBitmapPoolId CVtUiBitmapManager::AddBitmapsL( + TVtUiBitmapId aBitmapId, + TVtUiBitmapId aBitmapMaskId, + TBool aExpectDefaultColor ) + { + iBitmapId++; + CBitmapInfo* bitmapInfo = new ( ELeave ) CBitmapInfo( iBitmapId ); + CleanupStack::PushL( bitmapInfo ); + bitmapInfo->SetBitmaps( aBitmapId, aBitmapMaskId ); + bitmapInfo->SetDefaultColorRequired( aExpectDefaultColor ); + bitmapInfo->Require( iTmpFileName ); + + User::LeaveIfError( iBitmapArray.Append( bitmapInfo ) ); + CleanupStack::Pop( bitmapInfo ); + return iBitmapId; + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::AddBitmapL +// ----------------------------------------------------------------------------- +// +TVtUiBitmapPoolId CVtUiBitmapManager::AddBitmapL( + TVtUiBitmapId aBitmapId, + TBool aExpectDefaultColor ) + { + iBitmapId++; + CBitmapInfo* bitmapInfo = new ( ELeave ) CBitmapInfo( iBitmapId ); + CleanupStack::PushL( bitmapInfo ); + bitmapInfo->SetBitmap( aBitmapId ); + bitmapInfo->SetDefaultColorRequired( aExpectDefaultColor ); + bitmapInfo->Require( iTmpFileName ); + + User::LeaveIfError( iBitmapArray.Append( bitmapInfo ) ); + CleanupStack::Pop( bitmapInfo ); + return iBitmapId; + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::RemoveBitmap +// ----------------------------------------------------------------------------- +// +void CVtUiBitmapManager::RemoveBitmap( + TVtUiBitmapPoolId aId ) + { + const TInt pos = Find( aId ); + if ( pos != KErrNotFound ) + { + CBitmapInfo* bitmapInfo = iBitmapArray[ pos ]; + iBitmapArray.Remove( pos ); + delete bitmapInfo; + } + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::SetSize +// ----------------------------------------------------------------------------- +// +void CVtUiBitmapManager::SetSize( + TVtUiBitmapPoolId aId, + const TSize& aSize ) + { + const TInt pos = Find( aId ); + if ( pos != KErrNotFound ) + { + CBitmapInfo* bitmapInfo = iBitmapArray[ pos ]; + bitmapInfo->SetSize( aSize ); + bitmapInfo->Require( iTmpFileName ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::SetAspectRatio +// ----------------------------------------------------------------------------- +// +void CVtUiBitmapManager::SetAspectRatio( + TVtUiBitmapPoolId aId, + TBool aPreserve ) + { + const TInt pos = Find( aId ); + if ( pos != KErrNotFound ) + { + CBitmapInfo* bitmapInfo = iBitmapArray[ pos ]; + bitmapInfo->SetAspectRatio( aPreserve ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::SetSizeAndColor +// ----------------------------------------------------------------------------- +// +void CVtUiBitmapManager::SetSizeAndColor( + TVtUiBitmapPoolId aId, + const TSize& aSize, + const TRgb& aDefaultColor ) + { + const TInt pos = Find( aId ); + if ( pos != KErrNotFound ) + { + CBitmapInfo* bitmapInfo = iBitmapArray[ pos ]; + bitmapInfo->SetSize( aSize ); + bitmapInfo->SetDefaultColor( aDefaultColor ); + bitmapInfo->Require( iTmpFileName ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::RequireBitmap +// ----------------------------------------------------------------------------- +// +void CVtUiBitmapManager::RequireBitmap( TVtUiBitmapPoolId aId ) + { + const TInt pos = Find( aId ); + if ( pos != KErrNotFound ) + { + CBitmapInfo* bitmapInfo = iBitmapArray[ pos ]; + bitmapInfo->Require( iTmpFileName ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::GetBitmaps +// ----------------------------------------------------------------------------- +// +void CVtUiBitmapManager::GetBitmaps( + TVtUiBitmapPoolId aId, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aBitmapMask ) + { + aBitmap = NULL; + aBitmapMask = NULL; + + const TInt pos = Find( aId ); + if ( pos != KErrNotFound ) + { + CBitmapInfo* bitmapInfo = iBitmapArray[ pos ]; + bitmapInfo->GetBitmap( aBitmap, aBitmapMask ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::GetBitmap +// ----------------------------------------------------------------------------- +// +void CVtUiBitmapManager::GetBitmap( + TVtUiBitmapPoolId aId, + CFbsBitmap*& aBitmap ) + { + CFbsBitmap* dummy = NULL; + GetBitmaps( aId, aBitmap, dummy ); + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::InvalidateBitmaps +// ----------------------------------------------------------------------------- +// +void CVtUiBitmapManager::InvalidateBitmaps() + { + const TInt count = iBitmapArray.Count(); + for ( TInt index = 0; index < count; index++ ) + { + CBitmapInfo* bitmapInfo = iBitmapArray[ index ]; + bitmapInfo->Reset(); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::Find +// ----------------------------------------------------------------------------- +// +TInt CVtUiBitmapManager::Find( TVtUiBitmapPoolId aId ) const + { + TInt result = KErrNotFound; + const TInt count = iBitmapArray.Count(); + for ( TInt index = 0; index < count; index++ ) + { + CBitmapInfo* bitmapInfo = iBitmapArray[ index ]; + if ( bitmapInfo->BitmapPoolId() == aId ) + { + result = index; + index = count; // out of the loop + } + } + + return result; + } + +// Implementation of CBitmapInfo: + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::CBitmapInfo +// ----------------------------------------------------------------------------- +// +inline CVtUiBitmapManager::CBitmapInfo::CBitmapInfo( + TVtUiBitmapPoolId aId ) + : iBitmapPoolId( aId ), + iBitmapId( EVtUiBitmapNone ), + iBitmapMaskId( EVtUiBitmapNone ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::~CBitmapInfo +// ----------------------------------------------------------------------------- +// +CVtUiBitmapManager::CBitmapInfo::~CBitmapInfo() + { + delete iBitmap; + delete iBitmapMask; + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::SetBitmaps +// ----------------------------------------------------------------------------- +// +inline void CVtUiBitmapManager::CBitmapInfo::SetBitmaps( + TVtUiBitmapId aBitmapId, + TVtUiBitmapId aBitmapMaskId ) + { + iBitmapId = aBitmapId; + iBitmapMaskId = aBitmapMaskId; + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::SetBitmap +// ----------------------------------------------------------------------------- +// +inline void CVtUiBitmapManager::CBitmapInfo::SetBitmap( + TVtUiBitmapId aBitmapId ) + { + iBitmapId = aBitmapId; + iBitmapMaskId = EVtUiBitmapNone; + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::SetSize +// ----------------------------------------------------------------------------- +// +inline void CVtUiBitmapManager::CBitmapInfo::SetSize( + const TSize& aSize ) + { + if ( iHasSize ) + { + iSizeChanged = ( iSize != aSize ); + } + + iHasSize = ETrue; + iSize = aSize; + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::SetAspectRatio +// ----------------------------------------------------------------------------- +// +inline void CVtUiBitmapManager::CBitmapInfo::SetAspectRatio( TBool aPreserve ) + { + iHasAspectRatioPreserve = ETrue; + iAspectRatioPreserve = aPreserve; + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::SetDefaultColorRequired +// ----------------------------------------------------------------------------- +// +inline void CVtUiBitmapManager::CBitmapInfo::SetDefaultColorRequired( + TBool aRequireDefaultColor ) + { + iRequireDefaultColor = aRequireDefaultColor; + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::SetDefaultColor +// ----------------------------------------------------------------------------- +// +inline void CVtUiBitmapManager::CBitmapInfo::SetDefaultColor( + const TRgb& aDefaultColor ) + { + __ASSERT_DEBUG( iRequireDefaultColor, + VtUiPanic::Panic( EVtUiPanicDefaultColorRequireMismatch ) ); + iHasDefaultColor = ETrue; + iDefaultColor = aDefaultColor; + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::BitmapPoolId +// ----------------------------------------------------------------------------- +// +inline TVtUiBitmapPoolId CVtUiBitmapManager::CBitmapInfo::BitmapPoolId() const + { + return iBitmapPoolId; + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::GetBitmap +// ----------------------------------------------------------------------------- +// +inline void CVtUiBitmapManager::CBitmapInfo::GetBitmap( + CFbsBitmap*& aBitmap, + CFbsBitmap*& aBitmapMask ) + { + if ( iDoCreateBitmaps && iDoSetSize ) + { + aBitmap = iBitmap; + aBitmapMask = iBitmapMask; + } + else + { + aBitmap = NULL; + aBitmapMask = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::Reset +// ----------------------------------------------------------------------------- +// +void CVtUiBitmapManager::CBitmapInfo::Reset() + { + delete iBitmap; + iBitmap = NULL; + + delete iBitmapMask; + iBitmapMask = NULL; + + iSize = TSize(); + iHasSize = EFalse; + iSizeChanged = EFalse; + iHasDefaultColor = EFalse; + iDefaultColor = TRgb(); + iDoCreateBitmaps = EFalse; + iDoSetSize = EFalse; + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::Require +// ----------------------------------------------------------------------------- +// +void CVtUiBitmapManager::CBitmapInfo::Require( TFileName& aTmpFileName ) + { + // Bitmap can be created when the following has been satisfied + // a) It has not been created yet and default color is not required, + // b) It has not been created yet and default color is required and + // default color is available. + if ( !iDoCreateBitmaps && !( iRequireDefaultColor && !iHasDefaultColor ) ) + { + TRAP_IGNORE( DoCreateBitmapsL( aTmpFileName ) ); + } + + DoSetSize(); + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::DoCreateBitmapsL +// ----------------------------------------------------------------------------- +// +void CVtUiBitmapManager::CBitmapInfo::DoCreateBitmapsL( + TFileName& aTmpFileName ) + { + if ( !iDoCreateBitmaps ) + { + TInt bitmapIndex = KErrNotFound; + + VtUiLayout::Resolve( iBitmapId, aTmpFileName, bitmapIndex ); + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + TAknsItemID skinId = VtUiLayout::MapBitmapToSkinId( iBitmapId ); + + TAknsItemID colorId = KAknsIIDNone; + TInt colorIndex = KErrNotFound; + TBool colorAvailable = EFalse; + if ( iHasDefaultColor ) + { + colorAvailable = + VtUiLayout::MapBitmapToColorId( + iBitmapId, colorId, colorIndex ); + } + + if ( iBitmapMaskId != EVtUiBitmapNone ) + { + TInt bitmapMaskIndex = KErrNotFound; +#ifdef _DEBUG + TFileName fileName; + VtUiLayout::Resolve( iBitmapMaskId, fileName, bitmapMaskIndex ); + __ASSERT_ALWAYS( aTmpFileName == fileName, + VtUiPanic::Panic( EVtUiPanicMismatchInBitmapFileNames ) ); +#else + VtUiLayout::Resolve( iBitmapMaskId, aTmpFileName, bitmapMaskIndex ); +#endif + if ( colorAvailable ) + { + AknsUtils::CreateColorIconL( + skin, skinId, + colorId, colorIndex, + iBitmap, iBitmapMask, + aTmpFileName, + bitmapIndex, + bitmapMaskIndex, + iDefaultColor ); + } + else + { + AknsUtils::CreateIconL( + skin, skinId, + iBitmap, iBitmapMask, + aTmpFileName, + bitmapIndex, + bitmapMaskIndex ); + } + } + else + { + // Only normal skinning for these. + AknsUtils::CreateIconL( + skin, + skinId, + iBitmap, + aTmpFileName, + bitmapIndex ); + } + + iDoCreateBitmaps = ETrue; + } + } + +// ----------------------------------------------------------------------------- +// CVtUiBitmapManager::CBitmapInfo::DoSetSize +// ----------------------------------------------------------------------------- +// +void CVtUiBitmapManager::CBitmapInfo::DoSetSize() + { + if ( iDoCreateBitmaps && iHasSize && ( !iDoSetSize || iSizeChanged ) ) + { + iSizeChanged = EFalse; + TInt retBitmap = KErrNone; + if ( !iHasAspectRatioPreserve ) + { + retBitmap = AknIconUtils::SetSize( iBitmap, iSize ); + } + else + { + TScaleMode scaleMode = + iAspectRatioPreserve ? + EAspectRatioPreserved : + EAspectRatioNotPreserved; + retBitmap = AknIconUtils::SetSize( iBitmap, iSize, scaleMode ); + } + + iDoSetSize = ( retBitmap == KErrNone ); + } + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiBlankControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiBlankControl.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2004 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: Implementation of the CVtUiBlankControl control class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiBlankControl.h" +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiBlankControl::CVtUiBlankControl +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiBlankControl::CVtUiBlankControl() + { + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankControl::ConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CVtUiBlankControl::ConstructL( const TRect& aRect ) + { + CreateWindowL(); + MakeVisible( EFalse ); + SetRect( aRect ); + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankControl::~CVtUiBlankControl +// Destructor. +// ----------------------------------------------------------------------------- +// +CVtUiBlankControl::~CVtUiBlankControl() + { + AknsUtils::DeregisterControlPosition( this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankControl::SetActive +// ----------------------------------------------------------------------------- +// +void CVtUiBlankControl::SetActive( TBool aStatus ) + { + iBlankerActive = aStatus; + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankControl::OfferKeyEventL +// ----------------------------------------------------------------------------- +// +TKeyResponse CVtUiBlankControl::OfferKeyEventL( + const TKeyEvent& /*aKeyEvent*/, + TEventCode /*aType*/ ) + { + return iBlankerActive ? EKeyWasConsumed : EKeyWasNotConsumed; + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankControl::Draw +// ----------------------------------------------------------------------------- +// +void CVtUiBlankControl::Draw( const TRect& /*aRect*/ ) const + { + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankControl::SizeChanged +// ----------------------------------------------------------------------------- +// +void CVtUiBlankControl::SizeChanged() + { + AknsUtils::RegisterControlPosition( this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankControl::PositionChanged +// ----------------------------------------------------------------------------- +// +void CVtUiBlankControl::PositionChanged() + { + AknsUtils::RegisterControlPosition( this ); + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiBlankDialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiBlankDialog.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2004 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: Implementation of the CVtUiBlankDialog class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiBlankDialog.h" +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiBlankDialog::CVtUiBlankDialog +// ----------------------------------------------------------------------------- +// +CVtUiBlankDialog::CVtUiBlankDialog( + CEikDialog** aSelfPtr ) + : iSelfPtr( aSelfPtr ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankDialog::~CVtUiBlankDialog +// ----------------------------------------------------------------------------- +// +CVtUiBlankDialog::~CVtUiBlankDialog() + { + if ( iSelfPtr ) + { + *iSelfPtr = NULL; + iSelfPtr = NULL; + } + + if ( iRequest ) + { + User::RequestComplete( iRequest, KErrCancel ); + iRequest = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankDialog::ExecuteDialogNoWaitLD +// ----------------------------------------------------------------------------- +// +void CVtUiBlankDialog::ExecuteDialogNoWaitLD() + { + ExecuteLD( R_VIDEOTELUI_BLANK_NOWAIT_DLG ); + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankDialog::ExecuteDialogLD +// ----------------------------------------------------------------------------- +// +void CVtUiBlankDialog::ExecuteDialogLD( + TRequestStatus* aRequest ) + { + if ( !aRequest ) + { + TInt error = KErrNone; + iError = &error; + + ExecuteLD( R_VIDEOTELUI_BLANK_DLG ); + User::LeaveIfError( error ); + } + else + { + // It's assumed that either ExecuteLD leaves or + // then dialog is started (& dialog is not immediately deleted). + *aRequest = KRequestPending; + ExecuteLD( R_VIDEOTELUI_BLANK_NOWAIT_DLG ); + iRequest = aRequest; + } + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankDialog::Complete +// ----------------------------------------------------------------------------- +// +void CVtUiBlankDialog::Complete( const TInt aError ) + { + if ( iError ) + { + *iError = aError; + } + + if ( iRequest ) + { + User::RequestComplete( iRequest, aError ); + iRequest = NULL; + } + + delete this; + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankDialog::PreLayoutDynInitL +// ----------------------------------------------------------------------------- +// +void CVtUiBlankDialog::PreLayoutDynInitL() + { + MakeVisible( EFalse ); + ButtonGroupContainer().MakeVisible( EFalse ); + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankDialog::PostLayoutDynInitL +// ----------------------------------------------------------------------------- +// +void CVtUiBlankDialog::PostLayoutDynInitL() + { + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankDialog::OkToExitL +// ----------------------------------------------------------------------------- +// +TBool CVtUiBlankDialog::OkToExitL( TInt aButtonId ) + { + if ( aButtonId != EEikBidCancel ) + { + return EFalse; + } + else + { + return CEikDialog::OkToExitL( aButtonId ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiBlankDialog::Draw +// ----------------------------------------------------------------------------- +// +void CVtUiBlankDialog::Draw( const TRect& /*aRect*/ ) const + { + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiContextControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiContextControl.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,385 @@ +/* +* Copyright (c) 2004, 2005 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: Implementation of the CVtUiContextControl control class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiContextControl.h" +#include "VtUiLayout.h" +#include +#include +#include +#include +#include "CVtUiAppUi.h" +#include "tvtuistates.h" +#include "tVtuifeaturevariation.h" +#include "CVtUiMainControl.h" + + +// ----------------------------------------------------------------------------- +// CVtUiContextControl::NewL +// Constructor that may leave. +// ----------------------------------------------------------------------------- +// +CVtUiContextControl* CVtUiContextControl::NewL( + CVtUiBitmapManager& aBitmapManager, CVtUiAppUi& aAppUi, + TVtUiStates& aUiStates) + { + __VTPRINTENTER( "CtxCtrl.NewL" ) + CVtUiContextControl* self = new ( ELeave ) CVtUiContextControl( + aBitmapManager, aAppUi, aUiStates ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "CtxCtrl.NewL" ) + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiContextControl::~CVtUiContextControl +// Destructor. +// ----------------------------------------------------------------------------- +// +CVtUiContextControl::~CVtUiContextControl() + { + __VTPRINTENTER( "CtxCtrl.~" ) + BitmapManager().RemoveBitmap( iBackgroundId ); + BitmapManager().RemoveBitmap( iBlindId ); + BitmapManager().RemoveBitmap( iBlindMaskId ); + if ( iAppUi.EventMonitor() ) + { + iAppUi.EventMonitor()->RemoveObserver( this ); + } + __VTPRINTEXIT( "CtxCtrl.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiContextControl::HandlePointerEventL +// ----------------------------------------------------------------------------- +// +void CVtUiContextControl::HandlePointerEventL( + const TPointerEvent& aPointerEvent) + { + __VTPRINTENTER( "CtxCtrl.HandlePointerEventL" ) + __VTPRINT2( DEBUG_GEN, "CtxCtrl.HandlePtr ok= %d", iOkToSwapOnButtonUp ) + if ( AknLayoutUtils::PenEnabled() ) + { + __VTPRINT2( DEBUG_GEN, "CtxCtrl.HandlePtr.Position.iX = %d", aPointerEvent.iPosition.iX ) + __VTPRINT2( DEBUG_GEN, "CtxCtrl.HandlePtr.Position.iY = %d", aPointerEvent.iPosition.iY ) + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + TRect window( Size() ); + if ( !window.Contains( aPointerEvent.iPosition ) || + iAppUi.MainControl().IsMainControlPointerEvent() ) + { + __VTPRINT( DEBUG_GEN, "CtxCtrl.HandlePtr.Button1Down outside" ) + // Down outside of Ctx ctrl, set inside false + iPointerButton1DownInside = EFalse; + } + else + { + __VTPRINT( DEBUG_GEN, "CtxCtrl.HandlePtrButton1Down inside" ) + // Only true here + iPointerButton1DownInside = ETrue; + } + } + else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + TRect window( Size() ); + if ( !window.Contains( aPointerEvent.iPosition ) || + iAppUi.MainControl().IsMainControlPointerEvent() ) + { + __VTPRINT( DEBUG_GEN, "CtxCtrl.HandlePtr.Button1Up outside" ) + + // Up outside of Ctx ctrl, set inside false + iPointerButton1DownInside = EFalse; + + iOkToSwapOnButtonUp = ETrue; + SetGloballyCapturing( EFalse ); + SetPointerCapture( EFalse ); + } + else if( iOkToSwapOnButtonUp ) + { + __VTPRINT( DEBUG_GEN, "CtxCtrl.HandlePtr.Button1Up inside" ) + if ( !iUiStates.IsWhiteBalanceModeOn() && + !iUiStates.IsColorToneModeOn() && + !iUiStates.IsZoomModeOn() && + !iUiStates.IsCaptureModeOn() && + !iUiStates.IsContrastModeOn() && + !iUiStates.IsBrightnessModeOn() && + !iUiStates.IsVolumeModeOn() ) + { + if ( !iPointerButton1DownInside || + !( iAppUi.CanSwapImagePlaces() ) ) + { + // Set the flag back + iPointerButton1DownInside = EFalse; + return; + } + // Set the flag back + iPointerButton1DownInside = EFalse; + iAppUi.HandleCommandL( EVtUiCmdSwapImagesPlaces ); + } + } + else + { + __VTPRINT( DEBUG_GEN, "CtxCtrl.HandlePtr.Button1Up inside" ) + SetGloballyCapturing( EFalse ); + SetPointerCapture( EFalse); + iOkToSwapOnButtonUp = ETrue; + // Set the flag back + iPointerButton1DownInside = EFalse; + } + } + } + __VTPRINTEXIT( "CtxCtrl.HandlePointerEventL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiContextControl::HandleSizeChanged +// ----------------------------------------------------------------------------- +// +void CVtUiContextControl::HandleSizeChanged() + { + __VTPRINTENTER( "CtxCtrl.HandleSizeChanged" ) + TRect screen; + VtUiLayout::GetApplicationParentRect( screen ); + + TAknWindowLineLayout control; + VtUiLayout::GetFirstWindowBackgroundLayout( control ); + TAknLayoutRect backLayout; + backLayout.LayoutRect( screen, control ); + BitmapManager().SetSize( iBackgroundId, backLayout.Rect().Size() ); + + const TPoint positionRelativeToScreen( -PositionRelativeToScreen() ); + + VtUiLayout::GetFirstWindowStreamDisabledIconLayout( control ); + TAknLayoutRect blindLayout; + blindLayout.LayoutRect( screen, control ); + iBlindRect = blindLayout.Rect(); + iBlindRect.Move( positionRelativeToScreen ); + BitmapManager().SetSize( iBlindId, iBlindRect.Size() ); + BitmapManager().SetSize( iBlindMaskId, iBlindRect.Size() ); + + VtUiLayout::GetFirstWindowStreamLayout( control ); + TAknLayoutRect streamLayout; + streamLayout.LayoutRect( screen, control ); + iStreamRect = streamLayout.Rect(); + iStreamRect.Move( positionRelativeToScreen ) ; + __VTPRINTEXIT( "CtxCtrl.HandleSizeChanged" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiContextControl::StreamBlitPosition +// ----------------------------------------------------------------------------- +// +TPoint CVtUiContextControl::StreamBlitPosition() const + { + __VTPRINTENTER( "CtxCtrl.StreamBlitPosition" ) + __VTPRINTEXIT( "CtxCtrl.StreamBlitPosition" ) + return iStreamRect.iTl; + } + +// --------------------------------------------------------------------------- +// CVtUiContextControl::StreamClippingRect +// --------------------------------------------------------------------------- +// +TRect CVtUiContextControl::StreamClippingRect() const + { + __VTPRINTENTER( "CtxCtrl.StreamClippingRect" ) + __VTPRINTEXIT( "CtxCtrl.StreamClippingRect" ) + return iStreamRect; + } + +// ----------------------------------------------------------------------------- +// CVtUiContextControl::DrawColoredBackground +// ----------------------------------------------------------------------------- +// +void CVtUiContextControl::DrawColoredBackground( CWindowGc& aGc ) const + { + __VTPRINTENTER( "CtxCtrl.DrawColoredBackground" ) + CVtUiVideoControlBase::DrawColoredBackground( aGc ); + // Draw background image + CFbsBitmap* bg = NULL; + CFbsBitmap* bgMask = NULL; + BitmapManager().GetBitmaps( iBackgroundId, bg, bgMask ); + if ( bg ) + { + const TPoint origin; + const TRect rect( origin, bg->SizeInPixels() ); + if ( bgMask ) + { + aGc.BitBltMasked( origin, bg, rect, bgMask, ETrue ); + } + else + { + aGc.BitBlt( origin, bg ); + } + } + __VTPRINTEXIT( "CtxCtrl.DrawColoredBackground" ) + } + +// --------------------------------------------------------------------------- +// CVtUiContextControl::BlindImage +// --------------------------------------------------------------------------- +// +CFbsBitmap* CVtUiContextControl::BlindImage() const + { + __VTPRINTENTER( "CtxCtrl.BlindImage" ) + __VTPRINTEXIT( "CtxCtrl.BlindImage" ) + return Bitmap( iBlindId ); + } + +// --------------------------------------------------------------------------- +// CVtUiContextControl::BlindMask +// --------------------------------------------------------------------------- +// +CFbsBitmap* CVtUiContextControl::BlindMask() const + { + __VTPRINTENTER( "CtxCtrl.BlindImage" ) + __VTPRINTEXIT( "CtxCtrl.BlindImage" ) + return Bitmap( iBlindMaskId ); + } + +// --------------------------------------------------------------------------- +// CVtUiContextControl::BlindBlitPosition +// --------------------------------------------------------------------------- +// +TPoint CVtUiContextControl::BlindBlitPosition() const + { + __VTPRINTENTER( "CtxCtrl.BlindBlitPosition" ) + __VTPRINTEXIT( "CtxCtrl.BlindBlitPosition" ) + return iBlindRect.iTl; + } + +// ----------------------------------------------------------------------------- +// CVtUiContextControl::CVtUiContextControl +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiContextControl::CVtUiContextControl( + CVtUiBitmapManager& aBitmapManager, + CVtUiAppUi& aAppUi, + TVtUiStates& aUiStates ) + : CVtUiVideoControlBase( aBitmapManager ), + iAppUi( aAppUi ), + iUiStates( aUiStates ) + { + __VTPRINTENTER( "CtxCtrl.ctor" ) + SetRenderingHint( ENoWaitingText ); + SetRenderingHint( EColoredBackground ); + __VTPRINTEXIT( "CtxCtrl.ctor" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiContextControl::ConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CVtUiContextControl::ConstructL() + { + __VTPRINTENTER( "CtxCtrl.ConstructL" ) + BaseConstructL(); + iBackgroundId = + BitmapManager().AddBitmapsL( + EVtUiBitmap_qgn_graf_call_video_out_bg, + EVtUiBitmap_qgn_graf_call_video_out_bg_mask, + EFalse ); + BitmapManager().SetAspectRatio( iBackgroundId, EFalse ); + iBlindId = + BitmapManager().AddBitmapL( + EVtUiBitmap_qgn_indi_call_video_blind_out, + EFalse ); + BitmapManager().SetAspectRatio( iBlindId, EFalse ); + iBlindMaskId = + BitmapManager().AddBitmapL( + EVtUiBitmap_qgn_indi_call_video_blind_out_mask_icon, + EFalse ); + BitmapManager().SetAspectRatio( iBlindMaskId, EFalse ); + SetNonFocusing(); + if ( iAppUi.EventMonitor() ) + { + iAppUi.EventMonitor()->AddObserverL( this ); + } + + iOkToSwapOnButtonUp = ETrue; + + ClaimPointerGrab( ETrue ); + + __VTPRINTEXIT( "CtxCtrl.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiContextControl::HandleWsEventL +// ----------------------------------------------------------------------------- +// +void CVtUiContextControl::HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ) + { + __VTPRINTENTER( "CVtUiContextControl.HandleWsEventL" ) + if( aEvent.Type() == EEventPointer ) + { + // Touch outside of volume popup, close volume popup + if ( aEvent.Pointer()->iType == TPointerEvent::EButton1Down ) + { + __VTPRINT( DEBUG_GEN, "CtxCtrl.WsEvent.Button1Down inside" ) + iOkToSwapOnButtonUp = !iUiStates.IsZoomModeOn() && + !iUiStates.IsContrastModeOn() && + !iUiStates.IsBrightnessModeOn() && + !iUiStates.IsVolumeModeOn(); + + if( iUiStates.IsZoomModeOn() && iUiStates.IsCaptureModeOn() ) + { + iOkToSwapOnButtonUp = ETrue; + } + + if ( aDestination == this ) + { + iOkToSwapOnButtonUp = !iUiStates.IsZoomModeOn() && + !iUiStates.IsCaptureModeOn() && + !iUiStates.IsContrastModeOn() && + !iUiStates.IsBrightnessModeOn() && + !iUiStates.IsVolumeModeOn(); + SetGloballyCapturing( ETrue ); + SetPointerCapture( ETrue ); + } + } + else if ( aEvent.Pointer()->iType == TPointerEvent::EButton1Up ) + { + __VTPRINT( DEBUG_GEN, "CtxCtrl.WsEvent.Button1Up inside" ) + } + } + __VTPRINTEXIT( "CVtUiContextControl.HandleWsEventL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiContextControl::LayoutRemoteVideo +// ----------------------------------------------------------------------------- +// +void CVtUiContextControl::LayoutRemoteVideo() + { + __VTPRINTENTER( "CVtUiContextControl.LayoutRemoteVideo" ) + if ( NULL != iRemoteVideoControl && iRemoteVideoControl->IsVisible() ) + { + TRect rectRemoteVideo(StreamClippingRect()); + rectRemoteVideo.Move(PositionRelativeToScreen()); + iRemoteVideoControl->SetExtent(rectRemoteVideo.iTl,rectRemoteVideo.Size()); + } + __VTPRINTEXIT( "CVtUiContextControl.LayoutRemoteVideo" ) + } +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiDoc.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiDoc.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2004 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: Implementation of the CVtUiDoc document class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiDoc.h" +#include "CVtUiAppUi.h" +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiDoc::CVtUiDoc +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiDoc::CVtUiDoc( CEikApplication& aApp ) + : CAknDocument( aApp ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiDoc::CreateAppUiL +// Creates application UI instance. +// ----------------------------------------------------------------------------- +// +CEikAppUi* CVtUiDoc::CreateAppUiL() + { + return new ( ELeave ) CVtUiAppUi; + } + +// ----------------------------------------------------------------------------- +// CVtUiDoc::UpdateTaskNameL +// Creates application UI instance. +// ----------------------------------------------------------------------------- +// +void CVtUiDoc::UpdateTaskNameL( CApaWindowGroupName* aWgName ) + { + CAknDocument::UpdateTaskNameL( aWgName ); + aWgName->SetHidden( ETrue ); + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiEndCallButton.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiEndCallButton.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,270 @@ +/* +* 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" + +const TInt KEndCallButtonText = 255; + +// ----------------------------------------------------------------------------- +// 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 ); + + // buffer for visually ordered text + TBuf< KEndCallButtonText + KAknBidiExtraSpacePerLine> visualText; + TInt clipWidth = iLayoutText.TextRect().Width(); + + // bidi processing - using AknBidiTextUtils. + AknBidiTextUtils::ConvertToVisualAndClip( + state->Text(), + visualText, + *iLayoutText.Font(), + clipWidth, + clipWidth ); + + iLayoutText.DrawText( aGc, visualText, 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 f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiEndCallButtonPane.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiEndCallButtonPane.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,245 @@ +/* +* 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 + +#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(); + + // For set non focus and recieve all point event + SetNonFocusing(); + ClaimPointerGrab( ETrue ); + + __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->HandleCommandL( EVtUiCmdEndActiveCall ); + __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" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiEndCallButtonPane::SetEnabled +// ----------------------------------------------------------------------------- +// +void CVtUiEndCallButtonPane::SetEnabled( TBool aEnabled ) + { + iEndButton->SetDimmed( !aEnabled ); + DrawNow(); + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiExecuteCmdDialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiExecuteCmdDialog.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,312 @@ +/* +* Copyright (c) 2004-2006 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: Implementation of the CVtUiExecuteCmdDialog class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiExecuteCmdDialog.h" +#include "MVtUiEngineCommandManager.h" +#include +#include + +// MODULE DATA STRUCTURES + +/** +* Active object to perform asynchronous commands. +* @since Series 60 2.6 +*/ +class CVtUiExecuteCmdDialog::CActiveCmd + : public CActive + { + public: // Constructors and destructor + + /** + * Constructor. + */ + CActiveCmd( + CVtUiExecuteCmdDialog& aDialog, + MVtEngCommandHandler& aCommandHandler, + TVtEngCommandId aCommand, + TDesC8* aParams ); + + /** + * Destructor. + */ + ~CActiveCmd(); + + public: // New functions + + /** + * Starts active object. Command will be performed in RunL. + */ + void Start(); + + /** + * Checks if command has been performed. + * @return ETrue if command has been performed. + */ + TBool CommandPerformed() const; + + private: + + /** + * @see CActive::RunL + */ + void RunL(); + + /** + * @see CActive::DoCancel. + */ + void DoCancel(); + + /** + * @see CActive::RunError. + */ + TInt RunError( TInt aResult ); + + private: + + // Ref to dialog. + CVtUiExecuteCmdDialog& iDialog; + + // Ref to command handler. + MVtEngCommandHandler& iCommandHandler; + + // Command to be executed. + TVtEngCommandId iCommand; + + // Owned parameters. + TDesC8* iCommandParams; + + // ETrue if command has been performed. + TBool iCommandPerformed; + + }; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::CVtUiExecuteCmdDialog +// ----------------------------------------------------------------------------- +// +CVtUiExecuteCmdDialog::CVtUiExecuteCmdDialog( + CEikDialog** aSelfPtr, + MVtEngCommandHandler& aCommandHandler, + MVtUiEngineCommandManager& aCommandManager ) + : CVtUiBlankDialog( aSelfPtr ), + iCommandHandler( aCommandHandler ), + iCommandManager( aCommandManager ) + { + __VTPRINT2( DEBUG_GEN, "Ui.Dlg.Ctor this=%d", (TInt)this ) + } + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::~CVtUiExecuteCmdDialog +// ----------------------------------------------------------------------------- +// +CVtUiExecuteCmdDialog::~CVtUiExecuteCmdDialog() + { + __VTPRINTENTER( "VtUiExCmdDlg.~" ) + __VTPRINT2( DEBUG_GEN, "VtUiExCmdDlg.~ this=%d", (TInt)this ) + if ( iActiveCmd ) + { + if ( !iCommandCompleted && iActiveCmd->CommandPerformed() ) + { + iCommandHandler.CancelCommand( iCommand ); // ignore error + } + } + delete iCommandParams; + delete iActiveCmd; + + iCommandManager.RemoveObserver( *this ); + __VTPRINTEXIT( "VtUiExCmdDlg.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::ExecuteCmdLD +// ----------------------------------------------------------------------------- +// +void CVtUiExecuteCmdDialog::ExecuteCmdLD( + const TVtEngCommandId aCommandId, + TDesC8* aParams, + TRequestStatus* aRequest ) + { + __VTPRINTENTER( "VtUiExCmdDlg.ExecuteCmd" ) + __VTPRINT2( DEBUG_GEN, "Ui.Dlg.Exec this=%d", (TInt)this ) + iCommand = aCommandId; + CleanupStack::PushL( this ); + if ( aParams ) + { + iCommandParams = aParams->AllocL(); + } + + iCommandManager.AddObserverL( *this ); + CleanupStack::Pop( this ); + + CVtUiBlankDialog::ExecuteDialogLD( aRequest ); + __VTPRINTEXIT( "VtUiExCmdDlg.ExecuteCmd" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::PostLayoutDynInitL +// ----------------------------------------------------------------------------- +// +void CVtUiExecuteCmdDialog::PostLayoutDynInitL() + { + __VTPRINTENTER( "VtUiExCmdDlg.PostL" ) + iActiveCmd = + new ( ELeave ) CActiveCmd( + *this, iCommandHandler, iCommand, iCommandParams ); + iActiveCmd->Start(); + __VTPRINTEXITR( "VtUiExCmdDlg.PostL this=%d", (TInt)this ) + } + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::HandleVTCommandPerformedL +// ----------------------------------------------------------------------------- +// +void CVtUiExecuteCmdDialog::HandleVTCommandPerformedL( + TVtEngCommandId aCommand, + const TInt aError ) + { + __VTPRINTENTER( "VtUiExCmdDlg.HandleVTCommandPerformed" ) + __VTPRINT2( DEBUG_GEN, "VtUiExCmdDlg.cmd.%d", aCommand ) + __VTPRINT2( DEBUG_GEN, "VtUiExCmdDlg.err.%d", aError ) + if ( iActiveCmd && ( aCommand == iCommand ) ) + { + if ( iActiveCmd->CommandPerformed() && !iCommandCompleted ) + { + __VTPRINT( DEBUG_GEN, "VtUiExCmdDlg.match" ) + iCommandCompleted = ETrue; + // Corrupted images may leave during initialization, thus we have + // to mask out errors when they happen during share initialize. + // Error code is handled correctly in CVtUiAppUi::CEventObserver:: + // HandleVTCommandPerformedL() method, thus it will not be ignored. + if ( aCommand == KVtEngInitializeShareImage ) + { + Complete( KErrNone ); + } + else + { + Complete( aError ); + } + } + } + __VTPRINTEXIT( "VtUiExCmdDlg.HandleVTCommandPerformed" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::HandleExecuteFailed +// ----------------------------------------------------------------------------- +// +void CVtUiExecuteCmdDialog::HandleExecuteFailed( TInt aResult ) + { + __VTPRINT3( DEBUG_GEN, "VtUiExCmdDlg.Fail this=%d res=%d", + (TInt)this, aResult ) + Complete( aResult ); + } + +// Implementation of CVtUiExecuteCmdDialog::CActiveCmd: + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::CActiveCmd::CActiveCmd +// ----------------------------------------------------------------------------- +// +CVtUiExecuteCmdDialog::CActiveCmd::CActiveCmd( + CVtUiExecuteCmdDialog& aDialog, + MVtEngCommandHandler& aCommandHandler, + TVtEngCommandId aCommand, + TDesC8* aParams) + : CActive( CActive::EPriorityHigh ), + iDialog( aDialog ), + iCommandHandler( aCommandHandler ), + iCommand( aCommand ), + iCommandParams( aParams ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::CActiveCmd::~CActiveCmd +// ----------------------------------------------------------------------------- +// +CVtUiExecuteCmdDialog::CActiveCmd::~CActiveCmd() + { + __VTPRINT2( DEBUG_GEN, "VtUiExCmdDlgCmd.Dtor this=%d", (TInt)this ) + Cancel(); + } + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::CActiveCmd::Start +// ----------------------------------------------------------------------------- +// +void CVtUiExecuteCmdDialog::CActiveCmd::Start() + { + __VTPRINTENTER( "VtUiExCmdDlgCmd.Start" ) + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + SetActive(); + __VTPRINTEXITR( "VtUiExCmdDlgCmd.Start this=%d", (TInt)this ) + } + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::CActiveCmd::CommandPerformed +// ----------------------------------------------------------------------------- +// +TBool CVtUiExecuteCmdDialog::CActiveCmd::CommandPerformed() const + { + __VTPRINT3( DEBUG_GEN, "VtUiExCmdDlgCmd.Perf this=%d,cmd=%d", + (TInt)this, iCommandPerformed ) + return iCommandPerformed; + } + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::CActiveCmd::RunL +// ----------------------------------------------------------------------------- +// +void CVtUiExecuteCmdDialog::CActiveCmd::RunL() + { + __VTPRINTENTER( "VtUiExCmdDlgCmd.RunL" ) + iCommandHandler.ExecuteL( iCommand, iCommandParams ); + iCommandPerformed = ETrue; + __VTPRINTEXITR( "VtUiExCmdDlgCmd.RunL this=%d", (TInt)this ) + } + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::CActiveCmd::DoCancel +// ----------------------------------------------------------------------------- +// +void CVtUiExecuteCmdDialog::CActiveCmd::DoCancel() + { + __VTPRINT2( DEBUG_GEN, "VtUiExCmdDlgCmd.DoCnl this=%d", (TInt)this ) + // Request is completed immediately. + } + +// ----------------------------------------------------------------------------- +// CVtUiExecuteCmdDialog::CActiveCmd::RunError +// ----------------------------------------------------------------------------- +// +TInt CVtUiExecuteCmdDialog::CActiveCmd::RunError( TInt aResult ) + { + __VTPRINTENTER( "VtUiExCmdDlgCmd.RunError" ) + // Exception was raised in RunL. Inform the dialog to close itself. + iDialog.HandleExecuteFailed( aResult ); + __VTPRINTEXITR( "VtUiExCmdDlgCmd.RunError this=%d", (TInt)this ) + return KErrNone; + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiMainControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiMainControl.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,278 @@ +/* +* Copyright (c) 2004 - 2006 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: Implementation of the CVtUiMainControl control class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiMainControl.h" +#include "VtUiLayout.h" +#include +#include +#include +#include +#include "tvtuistates.h" +#include "tVtuifeaturevariation.h" +#include "CVtUiAppUi.h" +#include "CVtUiContextControl.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::NewL +// ----------------------------------------------------------------------------- +CVtUiMainControl* CVtUiMainControl::NewL( CVtUiBitmapManager& aBitmapManager, + CVtUiAppUi& aAppUi, + TVtUiStates& aUiStates ) + { + __VTPRINTENTER( "MainCtrl.NewL" ) + CVtUiMainControl* self = + new ( ELeave ) CVtUiMainControl( aBitmapManager, aAppUi, aUiStates ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "MainCtrl.NewL" ) + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::CVtUiMainControl +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiMainControl::CVtUiMainControl( CVtUiBitmapManager& aBitmapManager, + CVtUiAppUi& aAppUi, TVtUiStates& aUiStates ) : + CVtUiVideoControlBase( aBitmapManager ), iAppUi( aAppUi ), + iUiStates ( aUiStates ), iMCPointerEvent( EFalse ) + { + __VTPRINTENTER( "MainCtrl.Ctor" ) + SetRenderingHint( ESkinnedBackground ); + __VTPRINTEXIT( "MainCtrl.Ctor" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::ConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CVtUiMainControl::ConstructL() + { + __VTPRINTENTER( "MainCtrl.ConstructL" ) + BaseConstructL(); + iBlindId = + BitmapManager().AddBitmapL( + EVtUiBitmap_qgn_indi_call_video_blind_in, + EFalse ); + BitmapManager().SetAspectRatio( iBlindId, EFalse ); + iBlindMaskId = + BitmapManager().AddBitmapL( + EVtUiBitmap_qgn_indi_call_video_blind_in_mask_icon, + EFalse ); + BitmapManager().SetAspectRatio( iBlindMaskId, EFalse ); + + // For set non focus and recieve all point event + SetNonFocusing(); + ClaimPointerGrab( ETrue ); + + __VTPRINTEXIT( "MainCtrl.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::~CVtUiMainControl +// Destructor. +// ----------------------------------------------------------------------------- +// +CVtUiMainControl::~CVtUiMainControl() + { + __VTPRINTENTER( "MainCtrl.~" ) + BitmapManager().RemoveBitmap( iBlindId ); + BitmapManager().RemoveBitmap( iBlindMaskId ); + __VTPRINTEXIT( "MainCtrl.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::HandlePointerEventL +// ----------------------------------------------------------------------------- +// +void CVtUiMainControl::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + __VTPRINTENTER( "MainCtrl.HandlePointerEventL" ) + // Let context control handle this + iMCPointerEvent = ETrue; + iAppUi.ContextControl().HandlePointerEventL( aPointerEvent ); + iMCPointerEvent = EFalse; + __VTPRINTEXIT( "MainCtrl.HandlePointerEventL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::HandleSizeChanged +// ----------------------------------------------------------------------------- +// +void CVtUiMainControl::HandleSizeChanged() + { + __VTPRINTENTER( "MainCtrl.HandleSizeChanged" ) + const TRect mainPaneRect( Rect() ); + TRect screen; + VtUiLayout::GetApplicationParentRect( screen ); + + // blind icon and mask + TAknWindowLineLayout blind; + VtUiLayout::GetSecondWindowDisabledIconLayout( blind ); + iBlindLayout.LayoutRect( screen, blind ); + const TSize blindSize( iBlindLayout.Rect().Size() ); + BitmapManager().SetSize( iBlindId, blindSize ); + BitmapManager().SetSize( iBlindMaskId, blindSize ); + + // stream + TAknWindowLineLayout stream; + VtUiLayout::GetSecondWindowStreamWholeLayout( stream, + iUiStates.IsToolbarAvailable(), iSQCifRemote ); + + iStreamLayoutRect.LayoutRect( mainPaneRect, stream ); + + __VTPRINTEXIT( "MainCtrl.HandleSizeChanged" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::DrawWaitingText +// ----------------------------------------------------------------------------- +// +TBool CVtUiMainControl::DrawWaitingText( CWindowGc& aGc ) const + { + __VTPRINTENTER( "MainCtrl.DrawWaitingText" ) + TBool wasDrawn( EFalse ); + if ( !iSQCifRemote) + { + wasDrawn = CVtUiVideoControlBase::DrawWaitingText( aGc ); + } + __VTPRINTEXITR( "MainCtrl.DrawWaitingText %d", wasDrawn ) + return wasDrawn; + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::StreamBlitPosition +// ----------------------------------------------------------------------------- +// +TPoint CVtUiMainControl::StreamBlitPosition() const + { + __VTPRINTENTER( "MainCtrl.StreamBlitPosition" ) + const TSize videoSize( iStreamBitmap->SizeInPixels() ); + const TSize streamSize( iStreamLayoutRect.Rect().Size() ); + __VTPRINTEXIT( "MainCtrl.StreamBlitPosition" ) + return AdjustPointForDP( iStreamLayoutRect.Rect().iTl ); + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::StreamClippingRect +// ----------------------------------------------------------------------------- +// +TRect CVtUiMainControl::StreamClippingRect() const + { + __VTPRINTENTER( "MainCtrl.StreamClippingRect" ) + __VTPRINTEXIT( "MainCtrl.StreamClippingRect" ) + return AdjustRectForDP( iStreamLayoutRect.Rect() ); + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::BlindImage +// ----------------------------------------------------------------------------- +// +CFbsBitmap* CVtUiMainControl::BlindImage() const + { + __VTPRINTENTER( "MainCtrl.BlindImage" ) + __VTPRINTEXIT( "MainCtrl.BlindImage" ) + return Bitmap( iBlindId ); + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::BlindMask +// ----------------------------------------------------------------------------- +// +CFbsBitmap* CVtUiMainControl::BlindMask() const + { + __VTPRINTENTER( "MainCtrl.BlindMask" ) + __VTPRINTEXIT( "MainCtrl.BlindMask" ) + return Bitmap( iBlindMaskId ); + } + +// --------------------------------------------------------------------------- +// CVtUiMainControl::BlindBlitPosition +// --------------------------------------------------------------------------- +// +TPoint CVtUiMainControl::BlindBlitPosition() const + { + __VTPRINTENTER( "CVtUiMainControl.BlindBlitPosition" ) + __VTPRINTEXIT( "CVtUiMainControl.BlindBlitPosition" ) + return iBlindLayout.Rect().iTl; + } + +// --------------------------------------------------------------------------- +// CVtUiMainControl::WaitingTextLayout +// --------------------------------------------------------------------------- +// +TAknTextLineLayout CVtUiMainControl::WaitingTextLayout( TInt aLine ) + { + __VTPRINTENTER( "MainCtrl.WaitingTextLayout" ) + TAknTextLineLayout textLayout; + VtUiLayout::GetSecondWindowWaitingTextLayout( textLayout, + aLine ? EFalse : ETrue ); + __VTPRINTEXIT( "MainCtrl.WaitingTextLayout" ) + return textLayout; + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::SupportSQCif +// ----------------------------------------------------------------------------- +// +void CVtUiMainControl::SupportSQCif( TBool aIsSupported ) + { + __VTPRINTENTER( "MainCtrl.SupportSQCif" ) + const TBool layoutUpdateRequired( aIsSupported != iSQCifRemote ); + iSQCifRemote = aIsSupported; + if ( layoutUpdateRequired ) + { + HandleSizeChanged(); + } + __VTPRINTEXITR( "MainCtrl.SupportSQCif %d", iSQCifRemote ) + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::LayoutRemoteVideo +// ----------------------------------------------------------------------------- +// +void CVtUiMainControl::LayoutRemoteVideo( ) + { + __VTPRINTENTER( "MainCtrl.LayoutRemoteVideo" ) + if ( NULL != iRemoteVideoControl && iRemoteVideoControl->IsVisible() ) + { + TRect rectRemoteVideo(StreamClippingRect()); + rectRemoteVideo.Move(PositionRelativeToScreen()); + iRemoteVideoControl->SetExtent(rectRemoteVideo.iTl,rectRemoteVideo.Size()); + } + __VTPRINTEXIT( "MainCtrl.LayoutRemoteVideo" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::IsMainControlPointerEvent +// ----------------------------------------------------------------------------- +// +TBool CVtUiMainControl::IsMainControlPointerEvent() + { + return iMCPointerEvent; + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiMutedControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiMutedControl.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 2004 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: Implementation of the CVtUiMutedControl control class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiMutedControl.h" +#include "VtUiLayout.h" +#include +#include +#include +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiMutedControl::CVtUiMutedControl +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiMutedControl::CVtUiMutedControl() + { + } + +// ----------------------------------------------------------------------------- +// CVtUiMutedControl::ConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CVtUiMutedControl::ConstructL() + { + HBufC* mutedText = + StringLoader::LoadLC( R_VIDEOTELUI_QTN_INCAL_MUTED_PANE ); + + iMutedLabel = new ( ELeave ) CEikLabel; + iMutedLabel->SetContainerWindowL( *this ); + iMutedLabel->SetTextL( *mutedText ); + + CleanupStack::PopAndDestroy( mutedText ); + } + +// ----------------------------------------------------------------------------- +// CVtUiMutedControl::~CVtUiMutedControl +// Destructor. +// ----------------------------------------------------------------------------- +// +CVtUiMutedControl::~CVtUiMutedControl() + { + AknsUtils::DeregisterControlPosition( this ); + + delete iMutedLabel; + } + +// ----------------------------------------------------------------------------- +// CVtUiMutedControl::HandleResourceChange +// ----------------------------------------------------------------------------- +// +void CVtUiMutedControl::HandleResourceChange( + TInt aType ) + { + CCoeControl::HandleResourceChange( aType ); + + if ( aType == KAknsMessageSkinChange ) + { + SizeChanged(); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiMutedControl::Draw +// ----------------------------------------------------------------------------- +// +void CVtUiMutedControl::Draw( const TRect& /*aRect*/ ) const + { + } + +// ----------------------------------------------------------------------------- +// CVtUiMutedControl::SizeChanged +// ----------------------------------------------------------------------------- +// +void CVtUiMutedControl::SizeChanged() + { + AknsUtils::RegisterControlPosition( this ); + + TRect naviPane( Rect() ); + if ( naviPane.IsEmpty() ) + { + return; + } + + TAknTextLineLayout label; + VtUiLayout::GetMutedTextLayout( label ); + + AknLayoutUtils::LayoutLabel( iMutedLabel, naviPane, label ); + + // Update label color + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + TRgb skinColor; + + TInt error = + AknsUtils::GetCachedColor( + skin, + skinColor, + KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG2 ); + + if ( ( error == KErrNone ) && iMutedLabel ) + { + // Ignore error + TRAP_IGNORE( + iMutedLabel->OverrideColorL( EColorLabelText, skinColor ) ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiMutedControl::PositionChanged +// ----------------------------------------------------------------------------- +// +void CVtUiMutedControl::PositionChanged() + { + AknsUtils::RegisterControlPosition( this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiMutedControl::CountComponentControls +// ----------------------------------------------------------------------------- +// +TInt CVtUiMutedControl::CountComponentControls() const + { + return 1; // one label + } + +// ----------------------------------------------------------------------------- +// CVtUiMutedControl::ComponentControl +// ----------------------------------------------------------------------------- +// +CCoeControl* CVtUiMutedControl::ComponentControl( + TInt /*aIndex*/ ) const + { + return iMutedLabel; + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiNaviPane.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiNaviPane.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,364 @@ +/* +* Copyright (c) 2004-2006 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: Implementation of the CVtUiNaviPane class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiNaviPane.h" +#include "CVtUiNaviPaneControl.h" +#include "CVtUiMutedControl.h" +#include "CVtUiAppUi.h" + +#include +#include +#include +#include +#include +#include "tVtuifeaturevariation.h" + +// CONSTANTS + +// Timeout after which voice volume bar is switched back to indicators. +const TInt KVtUiVoiceVolumeTimeout = 2000000; + +// LOCAL FUNCTION PROTOTYPES + +/** +* Creates navigation decorator. +* @param aNaviPane reference to navi pane. +* @param aControl control to be decorated, ownership passed. +* @return new navigation decorator instance. +*/ +CAknNavigationDecorator* CreateDecoratorL( + CAknNavigationControlContainer& aNaviPane, + CCoeControl* aControl ); + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CreateDecoratorL Creates navigation decorator. +// Returns: new navigation decorator instance. +// ----------------------------------------------------------------------------- +// +CAknNavigationDecorator* CreateDecoratorL( + CAknNavigationControlContainer& aNaviPane, + CCoeControl* aControl ) + { + CAknNavigationDecorator* decoratedFolder = + CAknNavigationDecorator::NewL( + &aNaviPane, + aControl, + CAknNavigationDecorator::ENotSpecified ); + + CleanupStack::PushL( decoratedFolder ); + decoratedFolder->SetContainerWindowL( aNaviPane ); + aControl->SetContainerWindowL( *decoratedFolder ); + CleanupStack::Pop( decoratedFolder ); + + decoratedFolder->MakeScrollButtonVisible( EFalse ); + + return decoratedFolder; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::CVtUiNaviPane +// ----------------------------------------------------------------------------- +// +CVtUiNaviPane::CVtUiNaviPane( + CAknNavigationControlContainer& aNaviPane, + CVtUiAppUi& aAppUi ) + : CActive( CActive::EPriorityStandard ), + iNaviPane( aNaviPane ), + iAppUi ( aAppUi ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::ConstructL +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPane::ConstructL( ) + { + // Create the navi pane indicator (call duration). + { + CVtUiNaviPaneControl* naviControl = + new ( ELeave ) CVtUiNaviPaneControl( *this ); + CleanupStack::PushL( naviControl ); + naviControl->ConstructL(); + CleanupStack::Pop( naviControl ); + + iMainIndicators = + CreateDecoratorL( iNaviPane, naviControl ); + + iNaviPaneControl = naviControl; + } + + // Create muted indicator. + { + CVtUiMutedControl* naviControl = + new ( ELeave ) CVtUiMutedControl; + CleanupStack::PushL( naviControl ); + naviControl->ConstructL(); + CleanupStack::Pop( naviControl ); + + iMutedIndicator = + CreateDecoratorL( iNaviPane, naviControl ); + iMutedControl = naviControl; + } + + User::LeaveIfError( iTimer.CreateLocal() ); + + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::NewL +// ----------------------------------------------------------------------------- +// +CVtUiNaviPane* CVtUiNaviPane::NewL( + CAknNavigationControlContainer& aNaviPane, + CVtUiAppUi& aAppUi ) + { + CVtUiNaviPane* self = + new ( ELeave ) CVtUiNaviPane( + aNaviPane, aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::~CVtUiNaviPane +// ----------------------------------------------------------------------------- +// +CVtUiNaviPane::~CVtUiNaviPane() + { + Cancel(); + + delete iMainIndicators; + delete iMutedIndicator; + + iTimer.Close(); + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::SetCurrentSpeaker +// Parameter aLoudspeaker defines which speaker is used. +// ETrue for loudspeaker, EFalse for handset. +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPane::SetCurrentSpeaker( const TBool aLoudspeaker ) + { + if( iLoudspeaker != aLoudspeaker ) + { + Cancel(); + if( iCallDurationEnabled || iMicrophoneMuted ) + { + iSliderType = ENone; + } + } + iLoudspeaker = aLoudspeaker; + } + + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::SetMuted +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPane::SetMuted( + const TBool aStatus ) + { + __VTPRINT2( DEBUG_GEN, "NaviPane.SetMuted.aStatus=%d", aStatus ) + if( iMicrophoneMuted != aStatus ) + { + Cancel(); + // if volume indicator is shown when audio is umuted + // volume indicator won't be dismissed and call duration + // will not be shown + if( iCallDurationEnabled || aStatus ) + { + iSliderType = ENone; + } + } + iMicrophoneMuted = aStatus; + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::SetCallDuration +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPane::SetCallDuration( + const TTimeIntervalSeconds& aDuration, + const TBool aEnabled ) + { + iCallDurationEnabled = aEnabled; + iNaviPaneControl->SetCallDuration( aDuration, aEnabled ); + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::CommitL +// +// Priority order of different navi pane elements is the following: +// 1. Muted indicator +// 2. Main indicators (call duration) +// +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPane::CommitL() + { + CAknNavigationDecorator* selected = DefaultIndicator(); + + PushL( selected ); + + // If current is main indicators, then update now. + if ( iCurrent == iMainIndicators ) + { + iNaviPaneControl->CommitL(); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::GetSpeakerVolume +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPane::GetSpeakerVolume( + const TBool , + TInt& aValue ) const + { + aValue = 0; + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::HandleResourceChange +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPane::HandleResourceChange( + TInt aType ) + { + // iCurrent will get event through navi pane. + if ( iMainIndicators != iCurrent ) + { + iMainIndicators->HandleResourceChange( aType ); + iNaviPaneControl->HandleResourceChange( aType ); + } + if ( iMutedIndicator != iCurrent ) + { + iMutedIndicator->HandleResourceChange( aType ); + iMutedControl->HandleResourceChange( aType ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::DoCancel +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPane::DoCancel() + { + iTimer.Cancel(); + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::RunL +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPane::RunL() + { + iSliderType = ENone; + CAknNavigationDecorator* selected = DefaultIndicator(); + if ( selected ) + { + PushL( selected ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::PushAfterTimeout +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPane::PushAfterTimeout() + { + Cancel(); + iTimer.After( iStatus, KVtUiVoiceVolumeTimeout ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::PushL +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPane::PushL( CAknNavigationDecorator* aNew ) + { + if ( !aNew ) + { + if ( iCurrent ) + { + iNaviPane.Pop(); + iCurrent = NULL; + } + else + { + iNaviPane.PushDefaultL(); + } + } + else if ( iCurrent != aNew ) + { + // If current not defined, then push to navi pane. This should be called + // during construction. + if ( !iCurrent ) + { + iNaviPane.PushL( *aNew ); + iCurrent = aNew; + } + // Otherwise replace the old one. + else + { + iNaviPane.ReplaceL( *iCurrent, *aNew ); + iCurrent = aNew; + } + } + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::DefaultIndicator +// Returns default indicator. Note that this does not include temporary +// zoom indicator. +// ----------------------------------------------------------------------------- +// +CAknNavigationDecorator* CVtUiNaviPane::DefaultIndicator() const + { + CAknNavigationDecorator* selected = NULL; + + if ( IsActive() ) + { + selected = iMainIndicators; + } + else if ( iMicrophoneMuted && iSliderType != EVolume && iSliderType != EZoom ) + { + selected = iMutedIndicator; + } + else if ( iCallDurationEnabled && iSliderType != EVolume && iSliderType != EZoom ) + { + selected = iMainIndicators; + } + + return selected; + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiNaviPaneControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiNaviPaneControl.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,256 @@ +/* +* Copyright (c) 2004, 2005 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: Implementation of the CVtUiNaviPaneControl control class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiNaviPaneControl.h" +#include "CVtUiNaviPane.h" +#include "VtUiLayout.h" +#include +#include + +// CONSTANTS + +// There are sixty seconds in one minute. +const TInt KVtUiOneMinuteInSeconds = 60; + +// There are sixty minutes in one hour. +const TInt KVtUiOneHourInSeconds = 3600; + +// Maximum duration is 99:59:59. +const TInt KVtUiMaxDurationInSeconds = + 99*KVtUiOneHourInSeconds + + 59*KVtUiOneMinuteInSeconds + + 59; + +// Amount of digits. +const TInt KVtUiDigits = 10; + +// Index of time separator. +const TInt KVtUiSeparatorTime = 0; + +// Index of hour separator. +const TInt KVtUiSeparatorHour = 1; + +// Index of minute separator. +const TInt KVtUiSeparatorMinute = 2; + +// Index of second separator. +const TInt KVtUiSeparatorSecond = 3; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiNaviPaneControl::CVtUiNaviPaneControl +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiNaviPaneControl::CVtUiNaviPaneControl( CVtUiNaviPane& aNaviPane ) + : iNaviPane ( aNaviPane ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPaneControl::ConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPaneControl::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPaneControl::~CVtUiNaviPaneControl +// Destructor. +// ----------------------------------------------------------------------------- +// +CVtUiNaviPaneControl::~CVtUiNaviPaneControl() + { + AknsUtils::DeregisterControlPosition( this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPaneControl::SetCallDuration +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPaneControl::SetCallDuration( + const TTimeIntervalSeconds& aDuration, + const TBool aEnabled ) + { + iCallDurationEnabled = aEnabled; + iCallDuration = aDuration; + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPaneControl::CommitL +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPaneControl::CommitL() + { + ReportEventL( MCoeControlObserver::EEventStateChanged ); + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPaneControl::Draw +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPaneControl::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc = SystemGc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + const TDesC& callDurationText = GetCallDurationText(); + if ( callDurationText.Length() ) + { + TRgb color = iCallDurationLayout.Color(); + // Color is not updated if it not found from the skin + AknsUtils::GetCachedColor( + skin, + color, + KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG2 ); + iCallDurationLayout.DrawText( gc, callDurationText, EFalse, color ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPaneControl::SizeChanged +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPaneControl::SizeChanged() + { + AknsUtils::RegisterControlPosition( this ); + TAknWindowLineLayout rect; + TRect parent( Rect() ); + if ( parent.IsEmpty() ) + { + return; + } + + TAknTextLineLayout text; + VtUiLayout::GetCallDurationTextLayout( text ); + iCallDurationLayout.LayoutText( parent, text ); + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPaneControl::PositionChanged +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPaneControl::PositionChanged() + { + AknsUtils::RegisterControlPosition( this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPaneControl::GetCallDurationText +// ----------------------------------------------------------------------------- +// +const TDesC& CVtUiNaviPaneControl::GetCallDurationText() const + { + iCallDurationBuffer.Zero(); + + if ( iCallDurationEnabled ) + { + TLocale locale; + + TInt durationInseconds = iCallDuration.Int(); + if ( durationInseconds > KVtUiMaxDurationInSeconds ) + { + durationInseconds = KVtUiMaxDurationInSeconds; + } + + const TInt hours = durationInseconds / KVtUiOneHourInSeconds; + const TInt secondsLeft = + durationInseconds - ( hours * KVtUiOneHourInSeconds ); + + const TInt minutes = secondsLeft / KVtUiOneMinuteInSeconds; + const TInt seconds = + secondsLeft - ( minutes * KVtUiOneMinuteInSeconds ); + + AppendChar( + iCallDurationBuffer, + locale.TimeSeparator( KVtUiSeparatorTime ) ); + + AppendNum( + iCallDurationBuffer, + hours ); + + AppendChar( + iCallDurationBuffer, + locale.TimeSeparator( KVtUiSeparatorHour ) ); + + AppendNum( + iCallDurationBuffer, + minutes ); + + AppendChar( + iCallDurationBuffer, + locale.TimeSeparator( KVtUiSeparatorMinute ) ); + + AppendNum( + iCallDurationBuffer, + seconds ); + + AppendChar( + iCallDurationBuffer, + locale.TimeSeparator( KVtUiSeparatorSecond ) ); + + // Convert numbers to display language. + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( + iCallDurationBuffer ); + } + + return iCallDurationBuffer; + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPaneControl::AppendChar +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPaneControl::AppendChar( + TDes& aBuffer, + const TChar& aChar ) + { + if ( aChar ) + { + aBuffer.Append( aChar ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPaneControl::AppendNum +// ----------------------------------------------------------------------------- +// +void CVtUiNaviPaneControl::AppendNum( + TDes& aBuffer, + TInt aNumber ) + { + if ( aNumber < 0 ) + { + aNumber = 0; + } + + const TInt firstDigit = ( aNumber / KVtUiDigits ) % KVtUiDigits; + const TInt secondDigit = ( aNumber % KVtUiDigits ); + + aBuffer.AppendNum( firstDigit ); + aBuffer.AppendNum( secondDigit ); + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiNumberEntryActivationControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiNumberEntryActivationControl.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2004 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: Implementation of the CVtUiNumberEntryActivationControl +* control class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiNumberEntryActivationControl.h" +#include "CVtUiAppUi.h" +#include "VtUiUtility.h" + +#include +#include +#include +#include + +// CONSTANTS + +// Control priority for the forwarder control. Above all other controls. +extern const TInt KVtUiNumberEntryActivationPriority = + ECoeStackPriorityEnvironmentFilter + 100; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryActivationControl::CVtUiNumberEntryActivationControl +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiNumberEntryActivationControl::CVtUiNumberEntryActivationControl( + CVtUiAppUi& aAppUi ) + : iAppUi( aAppUi ), iIsActive ( ETrue ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryActivationControl::ConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryActivationControl::ConstructL( const TRect& aRect ) + { + // Create invisible control. + CreateWindowL(); + MakeVisible( EFalse ); + SetRect( aRect ); + + iAppUi.AddToStackL( + this, + KVtUiNumberEntryActivationPriority, + ECoeStackFlagRefusesFocus ); + iAddedToStack = ETrue; + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryActivationControl::~CVtUiNumberEntryActivationControl +// Destructor. +// ----------------------------------------------------------------------------- +// +CVtUiNumberEntryActivationControl::~CVtUiNumberEntryActivationControl() + { + AknsUtils::DeregisterControlPosition( this ); + + if ( iAddedToStack ) + { + iAppUi.RemoveFromStack( this ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryActivationControl::Draw +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryActivationControl::Draw( const TRect& /*aRect*/ ) const + { + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryActivationControl::SizeChanged +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryActivationControl::SizeChanged() + { + AknsUtils::RegisterControlPosition( this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryActivationControl::PositionChanged +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryActivationControl::PositionChanged() + { + AknsUtils::RegisterControlPosition( this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryActivationControl::OfferKeyEventL +// ----------------------------------------------------------------------------- +// +TKeyResponse CVtUiNumberEntryActivationControl::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + __VTPRINTENTER( "VtUiNumberEntryAC.OfferKeyEvent" ) + TBool numberEntryOpen = EFalse; + TChar dtmfTone; + TBool playDtmfTone = EFalse; + TKeyResponse keyResponse = EKeyWasNotConsumed; + if ( aKeyEvent.iScanCode == EStdKeyYes ) + { + // send key is always consumed to prevent event forwarding to telephony + // EStdKeyYes is scan code for send key, iCode cannot be used because + // it is valid only when event type is EEventKey (not in up/down events) + keyResponse = EKeyWasConsumed; + } + if ( !iIsActive ) + { + return keyResponse; + } + + if ( !aKeyEvent.iRepeats ) + { + if ( VtUiUtility::IsDTMFEvent( aKeyEvent, dtmfTone ) ) + { + numberEntryOpen = iAppUi.OpenNumberEntryL(); + playDtmfTone = ( aType == EEventKey ); + } + else if ( aKeyEvent.iCode == EKeyPhoneSend ) + { + keyResponse = iAppUi.HandlePhoneSendKeyL( aKeyEvent, aType ); + } + } + + if ( numberEntryOpen ) + { + iEikonEnv->SyncNotifyFocusObserversOfChangeInFocus(); + } + + // Tone actions are delegated to current state for validation. + if ( playDtmfTone ) + { + iAppUi.State().StartDtmfTone( dtmfTone ); + } + else if ( aType == EEventKeyUp ) + { + iAppUi.State().StopDtmfTone(); + } + __VTPRINTEXITR( "VtUiNumberEntryAC.OfferKeyEvent %d", keyResponse ) + return keyResponse; + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryActivationControl::SetActive +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryActivationControl::SetActive( TBool aIsActive ) + { + iIsActive = aIsActive; + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiRemoteVideoControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiRemoteVideoControl.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,224 @@ +/* +* Copyright (c) 2004 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: Implementation of the CVtUiRemoteVideoControl +* control class. +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "CVtUiRemoteVideoControl.h" +#include "CVtUiAppUi.h" +#include "CVtUiContextControl.h" + + +// Implementation of CVtUiRemoteVideoControl + +// ----------------------------------------------------------------------------- +// CVtUiRemoteVideoControl::NewL +// ----------------------------------------------------------------------------- + +CVtUiRemoteVideoControl* CVtUiRemoteVideoControl::NewL( CVtUiAppUi& aAppUi) + { + __VTPRINTENTER( "RemoteVideoControl.NewL" ) + CVtUiRemoteVideoControl* self = new ( ELeave ) CVtUiRemoteVideoControl(aAppUi); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "RemoteVideoControl.NewL" ) + return self; + + } +// --------------------------------------------------------------------------- +// CVtUiRemoteVideoControl::~CVtUiRemoteVideoControl +// --------------------------------------------------------------------------- +// +CVtUiRemoteVideoControl::~CVtUiRemoteVideoControl() + { + if ( iAppUi.EventMonitor() ) + { + iAppUi.EventMonitor()->RemoveObserver( this ); + } + __VTPRINTENTER( "RemoteVideoControl.~" ) + __VTPRINTEXIT( "RemoteVideoControl.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiRemoteVideoControl::CVtUiVideoControlBase +// --------------------------------------------------------------------------- +// +CVtUiRemoteVideoControl::CVtUiRemoteVideoControl( CVtUiAppUi& aAppUi): + iAppUi(aAppUi) + { + __VTPRINTENTER( "RemoteVideoControl.ctor" ) + __VTPRINTEXIT( "RemoteVideoControl.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiRemoteVideoControl::BaseConstructL +// --------------------------------------------------------------------------- +// +void CVtUiRemoteVideoControl::ConstructL() + { + __VTPRINTENTER( "RemoteVideoControl.ConstructL" ) + CreateWindowL(); + SetExtent( TPoint(), TSize() ); + ActivateL(); + + if ( iAppUi.EventMonitor() ) + { + iAppUi.EventMonitor()->AddObserverL( this ); + } + + __VTPRINTEXIT( "RemoteVideoControl.ConstructL" ) + } + +RWindow& CVtUiRemoteVideoControl::GetRWindow() + { + __VTPRINTENTER( "RemoteVideoControl.GetRWindow" ) + __VTPRINTEXIT( "RemoteVideoControl.GetRWindow" ) + return Window(); + } + +// --------------------------------------------------------------------------- +// CVtUiRemoteVideoControl::HandleSizeChanged +// --------------------------------------------------------------------------- +// +void CVtUiRemoteVideoControl::HandleSizeChanged() + { + __VTPRINTENTER( "RemoteVideoControl.HandleSizeChanged" ) + __VTPRINTEXIT( "RemoteVideoControl.HandleSizeChanged" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiRemoteVideoControl::SizeChanged +// ----------------------------------------------------------------------------- +// +void CVtUiRemoteVideoControl::SizeChanged() + { + __VTPRINTENTER( "RemoteVideoControl.SizeChanged" ) + TPoint position = Position(); + TRect rect = Rect(); + __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl position x:%d", position.iX ) + __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl position y:%d", position.iY ) + __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iTl.x:%d", rect.iTl.iX ) + __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iTl.y:%d", rect.iTl.iY ) + __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iBr.x:%d", rect.iBr.iX ) + __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iBr.y:%d", rect.iBr.iY ) + + __VTPRINTEXIT( "RemoteVideoControl.SizeChanged" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiRemoteVideoControl::PositionChanged +// ----------------------------------------------------------------------------- +// +void CVtUiRemoteVideoControl::PositionChanged() + { + __VTPRINTENTER( "RemoteVideoControl.PositionChanged" ) + __VTPRINTEXIT( "RemoteVideoControl.PositionChanged" ) + } + +// --------------------------------------------------------------------------- +// CVtUiRemoteVideoControl::Draw +// --------------------------------------------------------------------------- +// +void CVtUiRemoteVideoControl::Draw( const TRect& ) const + { + __VTPRINTENTER( "RemoteVideoControl.Draw" ) + //DoDraw( SystemGc() ); + __VTPRINTEXIT( "RemoteVideoControl.Draw" ) + } + +// --------------------------------------------------------------------------- +// CVtUiRemoteVideoControl::DoDraw +// --------------------------------------------------------------------------- +// +void CVtUiRemoteVideoControl::DoDraw( CWindowGc& aGc ) const + { + __VTPRINTENTER( "RemoteVideoControl.DoDraw(gc)" ) + + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetPenStyle( CGraphicsContext::ENullPen ); + aGc.SetBrushColor( KRgbRed ); + aGc.DrawRect( Rect() ); + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + + TPoint position = Position(); + TRect rect = Rect(); + __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl position x:%d", position.iX ) + __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl position y:%d", position.iY ) + __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iTl.x:%d", rect.iTl.iX ) + __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iTl.y:%d", rect.iTl.iY ) + __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iBr.x:%d", rect.iBr.iX ) + __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iBr.y:%d", rect.iBr.iY ) + + __VTPRINTEXIT( "RemoteVideoControl.DoDraw(gc)" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiRemoteVideoControl::HandlePointerEventL +// ----------------------------------------------------------------------------- +// +void CVtUiRemoteVideoControl::HandlePointerEventL( + const TPointerEvent& aPointerEvent) + { + __VTPRINTENTER( "RemoteVideoControl.HandlePointerEventL" ) + + if(iAppUi.ContextControl().RemoteVideoControl()) + { + iAppUi.ContextControl().HandlePointerEventL(aPointerEvent); + } + + __VTPRINTEXIT( "RemoteVideoControl.HandlePointerEventL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiRemoteVideoControl::HandleWsEventL +// ----------------------------------------------------------------------------- +// +void CVtUiRemoteVideoControl::HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ) + { + __VTPRINTENTER( "RemoteVideoControl.HandleWsEventL" ) + + if(iAppUi.ContextControl().RemoteVideoControl()) + { + iAppUi.ContextControl().HandleWsEventL( aEvent, aDestination ); + } + + __VTPRINTEXIT( "RemoteVideoControl.HandleWsEventL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiZoomControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiZoomControl.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,856 @@ +/* +* Copyright (c) 2004, 2005 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: Implementation of the CVtUiZoomControl control class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiZoomControl.h" +#include "VtUiLayout.h" +#include +#include +#include "videotelui.hrh" + +#include +// CONSTANTS + +// Maximum amount of steps. +const TInt KVtUiZoomControlMaxSteps = 11; + +// Minimum amount of steps. +const TInt KVtUiZoomControlMinSteps = 1; + +// Fixed point position. +const TInt KVtUiZoomControlFixed = 16; + +// Fixed point number, corresponds to one. +const TInt KVtUiZoomControlOne = ( 1 << KVtUiZoomControlFixed ); + +// Amount of partial bits. It is expected that +// KVtUiZoomControlFixed >= KVtUiZoomControlPartial. +const TInt KVtUiZoomControlPartial = 8; + +// Maximum duration of zooming from minimum to maximum, in microseconds. +const TInt KVtUiZoomDurationMax = 2000000; + +// Maximum duration to increase zoom step by one, in microseconds. +const TInt KVtUiZoomStepDurationMax = 200000; + +// Index of transparent color. +const TInt KVtUiZoomTransparent = 0; + +// MODULE DATA STRUCTURES + +/** +* Inner class to hold everything related to one bitmap. +* @since Series 60 2.6 +*/ +class CVtUiZoomControl::CBitmap + : public CBase + { + public: // Constructors and destructors. + + /** + * Constructor. + */ + CBitmap(); + + /** + * Symbian OS constructor. + * @param aSize size of the bitmap. + * @param aMode display mode of the bitmap. + */ + void ConstructL( + const TSize& aSize, + const TDisplayMode aMode ); + + /** + * Destructor. + */ + ~CBitmap(); + + public: + + /** + * Returns bitmap. + * @return bitmap, ownership not passed. + */ + inline CFbsBitmap* Bitmap() const; + + /** + * Returns bitmap context. + * @return bitmap context, ownership not passed. + */ + inline CFbsBitGc* Context() const; + + private: + + // Owned bitmap. + CFbsBitmap* iBitmap; + + // Owned device. + CFbsBitmapDevice* iDevice; + + // Owned context. + CFbsBitGc* iContext; + + }; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::CVtUiZoomControl +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiZoomControl::CVtUiZoomControl( CVtUiBitmapManager& aBitmapManager ) + : iBitmapManager( aBitmapManager ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::ConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::ConstructL() + { + iZoomDirId = + iBitmapManager.AddBitmapsL( + EVtUiBitmap_qgn_indi_zoom_dir, + EVtUiBitmap_qgn_indi_zoom_dir_mask, + ETrue ); + iZoomAreaId = + iBitmapManager.AddBitmapL( EVtUiBitmap_qgn_graf_zoom_area, EFalse ); + iBitmapManager.SetAspectRatio( iZoomAreaId, EFalse ); + + iZoomMinId = + iBitmapManager.AddBitmapL( EVtUiBitmap_qgn_indi_zoom_min, EFalse ); + iBitmapManager.SetAspectRatio( iZoomMinId, EFalse ); + + iZoomMaxId = + iBitmapManager.AddBitmapL( EVtUiBitmap_qgn_indi_zoom_max, EFalse ); + iBitmapManager.SetAspectRatio( iZoomMaxId, EFalse ); + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::~CVtUiZoomControl +// Destructor. +// ----------------------------------------------------------------------------- +// +CVtUiZoomControl::~CVtUiZoomControl() + { + AknsUtils::DeregisterControlPosition( this ); + + iBitmapManager.RemoveBitmap( iZoomDirId ); + iBitmapManager.RemoveBitmap( iZoomAreaId ); + iBitmapManager.RemoveBitmap( iZoomMinId ); + iBitmapManager.RemoveBitmap( iZoomMaxId ); + + delete iZoomPartialMask; + delete iZoomPartialShade; + delete iZoomPartialShadeMask; + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::SetZoomParams +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::SetZoomParams( + const TInt aStepCount, + const TInt aCurrentStep ) + { + iCurrentZoomStep = aCurrentStep; + iMaxZoomStep = aStepCount; + if ( iMaxZoomStep < 0 ) + { + iMaxZoomStep = 0; + } + iCurrentZoomStep = Max( Min( iCurrentZoomStep, iMaxZoomStep ), 0 ); + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::CommitL +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::CommitL() + { + ReportEventL( MCoeControlObserver::EEventStateChanged ); + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::IsZoomEnabled +// ----------------------------------------------------------------------------- +// +TBool CVtUiZoomControl::IsZoomEnabled() const + { + return ( iMaxZoomStep > 0 ); + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::GetZoomParams +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::GetZoomParams( + TInt& aStepCount, + TInt& aCurrentStep ) const + { + aStepCount = iMaxZoomStep; + aCurrentStep = iCurrentZoomStep; + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::UpdateZoomL +// ----------------------------------------------------------------------------- +// +TBool CVtUiZoomControl::UpdateZoomL() + { + const TInt oldZoomStep = iCurrentZoomStep; + if ( iZoomDirection ) + { + __VTPRINT( DEBUG_GEN, "VtUiZmCtl.UpdZoom" ) + TTime timeNow; + timeNow.UniversalTime(); + + const TTimeIntervalMicroSeconds duration = + timeNow.MicroSecondsFrom( iZoomStartTime ); + + if ( duration >= TInt64( KVtUiZoomDurationMax ) ) + { + // Duration is over maximum, so we can stop zooming. + if ( iZoomDirection > 0 ) + { + iCurrentZoomStep = iMaxZoomStep; + } + else + { + iCurrentZoomStep = 0; + } + + iZoomDirection = 0; + } + else if ( duration < TInt64( 0 ) ) + { + // Clock has been changed. Stop zooming. + iZoomDirection = 0; + } + else + { + // Zoom is increased at least by one step per 0.2 seconds. + TInt64 minimum( duration.Int64() ); + minimum /= KVtUiZoomStepDurationMax; + + // Zoom is increased from minimum to maximum in 2 seconds. + TInt64 maximum( duration.Int64() ); + maximum *= iMaxZoomStep; + maximum /= KVtUiZoomDurationMax; + + // Select maximum. + TInt zoomStepDelta = + iZoomDirection * Max( I64INT( minimum ), I64INT( maximum ) ); + TInt zoomStep = iZoomStepStart + zoomStepDelta; + + // If minimum has been reached, zooming can be stopped. + if ( zoomStep < 0 ) + { + zoomStep = 0; + iZoomDirection = 0; + } + // If maximum has been reached, zooming can be stopped. + if ( zoomStep > iMaxZoomStep ) + { + zoomStep = iMaxZoomStep; + iZoomDirection = 0; + } + + iCurrentZoomStep = zoomStep; + } + __VTPRINT( DEBUG_GEN, "VtUiZmCtl.chk" ) + } + + const TBool updateNeeded = ( oldZoomStep != iCurrentZoomStep ); + if ( updateNeeded ) + { + __VTPRINT( DEBUG_GEN, "VtUiZmCtl.upd" ) + ReportEventL( MCoeControlObserver::EEventStateChanged ); + } + + return updateNeeded; + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::StopZoom +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::StopZoom() + { + iZoomDirection = 0; + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::OfferKeyEventL +// ----------------------------------------------------------------------------- +// +TKeyResponse CVtUiZoomControl::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + TKeyResponse response = EKeyWasNotConsumed; + + if ( aKeyEvent.iScanCode == EStdKeyUpArrow || + aKeyEvent.iScanCode == EStdKeyDownArrow || + aKeyEvent.iCode == EKeyZoomIn || + aKeyEvent.iCode == EKeyZoomOut ) + { + switch ( aType ) + { + case EEventKey: + { + TInt direction = +1; + if ( aKeyEvent.iScanCode == EStdKeyDownArrow || + aKeyEvent.iCode == EKeyZoomOut ) + { + direction = -1; + } + + if ( !aKeyEvent.iRepeats ) + { + // Update start parameters. + iZoomDirection = direction; + iZoomStepStart = iCurrentZoomStep + direction; + iZoomStepStart = Min( iZoomStepStart, iMaxZoomStep ); + iZoomStepStart = Max( iZoomStepStart, 0 ); + iZoomStartTime.UniversalTime(); + } + + (void)UpdateZoomL(); + } + break; + + case EEventKeyUp: + // Stop zooming. + iZoomDirection = 0; + break; + + default: + // Do nothing. + break; + } + + response = EKeyWasConsumed; + } + + return response; + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::HandleResourceChange +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::HandleResourceChange( + TInt aType ) + { + if ( aType == KAknsMessageSkinChange ) + { + // We must refresh partial bitmap upon next redraw. + iZoomMaskPartial = KErrNotFound; + iZoomMaskRow = KErrNotFound; + } + + CCoeControl::HandleResourceChange( aType ); + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::Draw +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::Draw( const TRect& /*aRect*/ ) const + { + __VTPRINT( DEBUG_GEN, "VtUiZmCtl.Draw" ) + iBitmapManager.SetSizeAndColor( + iZoomDirId, + iZoomDirLayout.Rect().Size(), + iZoomDirLayout.Color() ); + iBitmapManager.SetSize( + iZoomAreaId, + iZoomAreaLayout.Rect().Size() ); + iBitmapManager.SetSize( + iZoomMinId, + iZoomAreaLayout.Rect().Size() ); + iBitmapManager.SetSize( + iZoomMaxId, + iZoomAreaLayout.Rect().Size() ); + + CFbsBitmap* maxBitmap = NULL; + CFbsBitmap* minBitmap = NULL; + CFbsBitmap* areaBitmap = NULL; + iBitmapManager.GetBitmap( iZoomMaxId, maxBitmap ); + iBitmapManager.GetBitmap( iZoomMinId, minBitmap ); + iBitmapManager.GetBitmap( iZoomAreaId, areaBitmap ); + + TInt full; + TInt partial; + TRect drawRect; + TPoint drawPos; + + DetermineSteps( full, partial ); + if ( areaBitmap && partial && ( full < KVtUiZoomControlMaxSteps ) ) + { + // First generate bitmaps, so that drawing can be done + // quickly in sequence. + GetPositionAndRect( + drawPos, + drawRect, + full + 1 ); + + if ( !GenerateZoomMaskBitmap( + areaBitmap, + partial, + drawRect.iTl.iY, + drawRect.Size() ) ) + { + // If zoom mask generation fails, then we have no choice + // than not to draw. + partial = 0; + } + } + + CWindowGc& gc = SystemGc(); + gc.SetBrushStyle( CGraphicsContext::ENullBrush ); + + // Draw zoom direction indicator: + + CFbsBitmap* zoomDirBitmap = NULL; + CFbsBitmap* zoomDirMask = NULL; + iBitmapManager.GetBitmaps( iZoomDirId, zoomDirBitmap, zoomDirMask ); + if ( zoomDirBitmap && zoomDirMask ) + { + iZoomDirLayout.DrawImage( gc, zoomDirBitmap, zoomDirMask ); + } + + // Draw zoom indicator: + if ( !areaBitmap ) + { + // If area bitmap is invalid, then we have to return. + return; + } + + if ( maxBitmap ) + { + // First, draw maximum area. + for ( TInt index = KVtUiZoomControlMinSteps; + index <= full; + index++ ) + { + GetPositionAndRect( + drawPos, + drawRect, + index ); + gc.BitBltMasked( + drawPos, + maxBitmap, + drawRect, + areaBitmap, + ETrue ); + } + } + + if ( minBitmap && ( full < KVtUiZoomControlMaxSteps ) ) + { + // Then draw minimum area. + for ( TInt index = full + 1; + index <= KVtUiZoomControlMaxSteps; + index++ ) + { + GetPositionAndRect( + drawPos, + drawRect, + index ); + gc.BitBltMasked( + drawPos, + minBitmap, + drawRect, + areaBitmap, + ETrue ); + } + + if ( maxBitmap && partial && iZoomPartialMask ) + { + // Finally draw partial area. + GetPositionAndRect( + drawPos, + drawRect, + full + 1 ); + gc.BitBltMasked( + drawPos, + maxBitmap, + drawRect, + iZoomPartialMask->Bitmap(), + ETrue ); + } + } + + __VTPRINT( DEBUG_GEN, "VtUiZmCtl.Draw.ok" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::SizeChanged +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::SizeChanged() + { + AknsUtils::RegisterControlPosition( this ); + + TRect parent( Rect() ); + TAknWindowLineLayout rect; + if ( parent.IsEmpty() ) + { + return; + } + + { + TAknLayoutRect& tmpRect = iZoomDirLayout; + VtUiLayout::GetZoomPaneLayout( rect ); + tmpRect.LayoutRect( parent, rect ); + parent = tmpRect.Rect(); + iZoomPaneRect = parent; + } + + VtUiLayout::GetZoomDirLayout( rect ); + iZoomDirLayout.LayoutRect( parent, rect ); + iBitmapManager.SetSizeAndColor( + iZoomDirId, + iZoomDirLayout.Rect().Size(), + iZoomDirLayout.Color() ); + + VtUiLayout::GetZoomAreaLayout( rect ); + iZoomAreaLayout.LayoutRect( parent, rect ); + iBitmapManager.SetSize( + iZoomAreaId, + iZoomAreaLayout.Rect().Size() ); + iBitmapManager.SetSize( + iZoomMinId, + iZoomAreaLayout.Rect().Size() ); + iBitmapManager.SetSize( + iZoomMaxId, + iZoomAreaLayout.Rect().Size() ); + (void) CreateBitmaps(); + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::PositionChanged +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::PositionChanged() + { + AknsUtils::RegisterControlPosition( this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::DetermineSteps +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::DetermineSteps( + TInt& aFullSteps, + TInt& aPartialStep ) const + { + aFullSteps = 1; + aPartialStep = 0; + + TInt currentZoomStep = Max( Min( iCurrentZoomStep, iMaxZoomStep ), 0 ); + + if ( iMaxZoomStep > 0 ) + { + TInt zoomDeltaSteps = 0; + TInt zoomDeltaMaxSteps = 0; + + // Formula equals: x = ( N * ( y - 1 ) ) / 10. + + aFullSteps = KVtUiZoomControlMinSteps; + const TInt divider = + KVtUiZoomControlMaxSteps - KVtUiZoomControlMinSteps; + for ( TInt row = KVtUiZoomControlMaxSteps - 1; + row >= KVtUiZoomControlMinSteps - 1; + row-- ) + { + const TInt zoomStartSteps = + ( iMaxZoomStep * row ) / divider; + const TInt previousZoomStartSteps = + ( iMaxZoomStep * ( row - 1 ) ) / divider; + + if ( ( currentZoomStep >= zoomStartSteps ) && + ( previousZoomStartSteps != zoomStartSteps ) ) + { + aFullSteps = ( row + 1 ); + zoomDeltaSteps = currentZoomStep - zoomStartSteps; + zoomDeltaMaxSteps = ( iMaxZoomStep * ( row + 1 ) ) / divider; + zoomDeltaMaxSteps -= zoomStartSteps; + break; + } + } + + aPartialStep = 0; + if ( zoomDeltaSteps && zoomDeltaMaxSteps ) + { + TInt64 partial( zoomDeltaSteps ); + partial *= KVtUiZoomControlOne; + partial /= zoomDeltaMaxSteps; + + partial >>= ( KVtUiZoomControlFixed - KVtUiZoomControlPartial ); + aPartialStep = I64INT( partial ); + } + } + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::GenerateZoomMaskBitmap +// ----------------------------------------------------------------------------- +// +TBool CVtUiZoomControl::GenerateZoomMaskBitmap( + CFbsBitmap* aMaskBitmap, + const TInt aPartial, + const TInt aRow, + const TSize& aRowSize ) const + { + if ( iZoomPartialMask && + ( ( iZoomMaskPartial != aPartial ) || + ( iZoomMaskRow != aRow ) ) ) + { + DoGenerateZoomMaskBitmap( + aMaskBitmap, + aPartial, + aRow, + aRowSize ); + } + return ( iZoomPartialMask != NULL ); + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::DoGenerateZoomMaskBitmap +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::DoGenerateZoomMaskBitmap( + CFbsBitmap* aMaskBitmap, + const TInt aPartial, + const TInt aRow, + const TSize& aRowSize ) const + { + CFbsBitGc* bitmapMaskGc = iZoomPartialMask->Context(); + + CFbsBitmap* shade = iZoomPartialShade->Bitmap(); + CFbsBitGc* shadeGc = iZoomPartialShade->Context(); + + // Fill shade with aPartial. + shadeGc->SetPenStyle( CGraphicsContext::ENullPen ); + shadeGc->SetBrushColor( TRgb::Gray256( aPartial ) ); + shadeGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + shadeGc->Clear(); + + // Now grab one row from iZoomAreaBitmap. + CFbsBitmap* mask = iZoomPartialShadeMask->Bitmap(); + CFbsBitGc* maskGc = iZoomPartialShadeMask->Context(); + + // Clear with transparency. + maskGc->SetPenStyle( CGraphicsContext::ENullPen ); + maskGc->SetBrushColor( TRgb::Gray2( 1 ) ); // transparency + maskGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + maskGc->Clear(); + + maskGc->SetPenStyle( CGraphicsContext::ENullPen ); + // Blit appropriate region from aMaskBitmap to maskGc. + maskGc->BitBlt( + TPoint( 0, aRow ), + aMaskBitmap, + TRect( TPoint( 0, aRow ), aRowSize ) ); + + // Now fill bitmapMask with black (= transparency). + bitmapMaskGc->SetPenStyle( CGraphicsContext::ENullPen ); + bitmapMaskGc->SetBrushColor( TRgb::Gray256( KVtUiZoomTransparent ) ); + bitmapMaskGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + bitmapMaskGc->Clear(); + + // Then blit shade masked + TPoint origin; + TRect rect( origin, shade->SizeInPixels() ); + + bitmapMaskGc->BitBltMasked( origin, shade, rect, mask, ETrue ); + + iZoomMaskPartial = aPartial; + iZoomMaskRow = aRow; + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::CreateBitmaps +// ----------------------------------------------------------------------------- +// +TInt CVtUiZoomControl::CreateBitmaps() + { + TRAPD( err, CreateBitmapsL() ); + return err; + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::CreateBitmapsL +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::CreateBitmapsL() + { + TBool requiredToCreate = ETrue; + TSize requiredSize = SizeOfBitmap(); + if ( iZoomPartialMask ) + { + requiredToCreate = + ( requiredSize != iZoomPartialMask->Bitmap()->SizeInPixels() ); + } + + if ( requiredToCreate ) + { + iZoomMaskPartial = KErrNotFound; + iZoomMaskRow = KErrNotFound; + + // Delete old ones away. + delete iZoomPartialMask; + iZoomPartialMask = NULL; + + delete iZoomPartialShade; + iZoomPartialShade = NULL; + + delete iZoomPartialShadeMask; + iZoomPartialShadeMask = NULL; + + CBitmap* zoomPartialMask = new ( ELeave ) CBitmap; + CleanupStack::PushL( zoomPartialMask ); + zoomPartialMask->ConstructL( requiredSize, EGray256 ); + + CBitmap* zoomPartialShade = new ( ELeave ) CBitmap; + CleanupStack::PushL( zoomPartialShade ); + zoomPartialShade->ConstructL( requiredSize, EGray256 ); + + CBitmap* zoomPartialShadeMask = new ( ELeave ) CBitmap; + CleanupStack::PushL( zoomPartialShadeMask ); + zoomPartialShadeMask->ConstructL( requiredSize, EGray2 ); + + // Pop zoomPartialShadeMask, zoomPartialShade & zoomPartialMask. + CleanupStack::Pop( 3, zoomPartialMask ); + iZoomPartialMask = zoomPartialMask; + iZoomPartialShade = zoomPartialShade; + iZoomPartialShadeMask = zoomPartialShadeMask; + } + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::SizeOfBitmap +// ----------------------------------------------------------------------------- +// +TSize CVtUiZoomControl::SizeOfBitmap() const + { + // Bitmaps fill the whole zoom area. + return iZoomAreaLayout.Rect().Size(); + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::GetPositionAndRect +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::GetPositionAndRect( + TPoint& aPosition, + TRect& aSourceRect, + const TInt aZoomStep ) const + { + TAknWindowLineLayout rect; + TAknLayoutRect layout; + const TRect zoomAreaRect = iZoomAreaLayout.Rect(); + const TRect& zoomParentRect = iZoomPaneRect; + + VtUiLayout::GetZoomStepLayout( + rect, + aZoomStep ); + layout.LayoutRect( zoomParentRect, rect ); + aSourceRect = layout.Rect(); + aPosition = aSourceRect.iTl; + + aSourceRect.iTl -= zoomAreaRect.iTl; + aSourceRect.iBr -= zoomAreaRect.iTl; + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::CBitmap::CBitmap +// ----------------------------------------------------------------------------- +// +CVtUiZoomControl::CBitmap::CBitmap() + { + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::CBitmap::ConstructL +// ----------------------------------------------------------------------------- +// +void CVtUiZoomControl::CBitmap::ConstructL( + const TSize& aSize, + const TDisplayMode aMode ) + { + CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( bitmap ); + + User::LeaveIfError( + bitmap->Create( aSize, aMode ) ); + + CFbsBitmapDevice* device = CFbsBitmapDevice::NewL( bitmap ); + CleanupStack::PushL( device ); + + CFbsBitGc* context = NULL; + User::LeaveIfError( device->CreateContext( context ) ); + User::LeaveIfNull( context ); + + CleanupStack::Pop( device ); + CleanupStack::Pop( bitmap ); + + iContext = context; + iDevice = device; + iBitmap = bitmap; + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::CBitmap::~CBitmap +// ----------------------------------------------------------------------------- +// +CVtUiZoomControl::CBitmap::~CBitmap() + { + delete iContext; + delete iDevice; + delete iBitmap; + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::CBitmap::Bitmap +// ----------------------------------------------------------------------------- +// +inline CFbsBitmap* CVtUiZoomControl::CBitmap::Bitmap() const + { + return iBitmap; + } + +// ----------------------------------------------------------------------------- +// CVtUiZoomControl::CBitmap::Context +// ----------------------------------------------------------------------------- +// +inline CFbsBitGc* CVtUiZoomControl::CBitmap::Context() const + { + return iContext; + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/TVtUiCallParameters.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/TVtUiCallParameters.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2004 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: Implementation of the TVtUiCallParameters class. +* +*/ + + + +// INCLUDE FILES +#include "TVtUiCallParameters.h" + +// CONSTANTS + +// Enumerates call parameter flags. +enum TVtUiCallParameterFlags + { + // Audio status has been updated. + EVtUiCallParameterFlagHasAudio = 1, + // Audio status equals to ETrue. + EVtUiCallParameterFlagAudioEnabled = 2, + // Video status has been updated. + EVtUiCallParameterFlagHasVideo = 4, + // Video status equals to ETrue. + EVtUiCallParameterFlagVideoEnabled = 8, + // Selected camera has been updated. + EVtUiCallParameterFlagHasSelectedCamera = 16, + // Primary camera has been selected. Otherwise secondary has been selected. + EVtUiCallParameterFlagHasSelectedPrimary = 32, + }; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// TVtUiCallParameters::TVtUiCallParameters +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +TVtUiCallParameters::TVtUiCallParameters() + : iFlags( 0 ) + { + } + +// ----------------------------------------------------------------------------- +// TVtUiCallParameters::Reset +// ----------------------------------------------------------------------------- +// +void TVtUiCallParameters::Reset() + { + iFlags = 0; + } + +// ----------------------------------------------------------------------------- +// TVtUiCallParameters::SetAudioStatus +// ----------------------------------------------------------------------------- +// +void TVtUiCallParameters::SetAudioStatus( const TBool aEnabled ) + { + iFlags |= ( EVtUiCallParameterFlagAudioEnabled + + EVtUiCallParameterFlagHasAudio ); + if ( !aEnabled ) + { + iFlags &= ~EVtUiCallParameterFlagAudioEnabled; + } + } + +// ----------------------------------------------------------------------------- +// TVtUiCallParameters::GetAudioStatus +// ----------------------------------------------------------------------------- +// +TInt TVtUiCallParameters::GetAudioStatus( TBool& aEnabled ) const + { + TInt err = KErrNotFound; + if ( iFlags & EVtUiCallParameterFlagHasAudio ) + { + err = KErrNone; + aEnabled = ( iFlags & EVtUiCallParameterFlagAudioEnabled ); + } + + return err; + } + +// ----------------------------------------------------------------------------- +// TVtUiCallParameters::SetVideoStatus +// ----------------------------------------------------------------------------- +// +void TVtUiCallParameters::SetVideoStatus( const TBool aEnabled ) + { + iFlags |= ( EVtUiCallParameterFlagVideoEnabled + + EVtUiCallParameterFlagHasVideo ); + if ( !aEnabled ) + { + iFlags &= ~EVtUiCallParameterFlagVideoEnabled; + } + } + +// ----------------------------------------------------------------------------- +// TVtUiCallParameters::GetVideoStatus +// ----------------------------------------------------------------------------- +// +TInt TVtUiCallParameters::GetVideoStatus( TBool& aEnabled ) + { + TInt err = KErrNotFound; + if ( iFlags & EVtUiCallParameterFlagHasVideo ) + { + err = KErrNone; + aEnabled = ( iFlags & EVtUiCallParameterFlagVideoEnabled ); + } + + return err; + } + +// ----------------------------------------------------------------------------- +// TVtUiCallParameters::SetSelectedCamera +// ----------------------------------------------------------------------------- +// +void TVtUiCallParameters::SetSelectedCamera( const TBool aPrimary ) + { + iFlags |= EVtUiCallParameterFlagHasSelectedCamera; + + if ( aPrimary ) + { + iFlags |= EVtUiCallParameterFlagHasSelectedPrimary; + } + else + { + iFlags &= ~EVtUiCallParameterFlagHasSelectedPrimary; + } + } + +// ----------------------------------------------------------------------------- +// TVtUiCallParameters::GetSelectedCamera +// ----------------------------------------------------------------------------- +// +TInt TVtUiCallParameters::GetSelectedCamera( TBool& aPrimary ) + { + TInt err = KErrNotFound; + if ( iFlags & EVtUiCallParameterFlagHasSelectedCamera ) + { + err = KErrNone; + aPrimary = ( iFlags & EVtUiCallParameterFlagHasSelectedPrimary ); + } + + return err; + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/VtUiLayout.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/VtUiLayout.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,736 @@ +/* +* Copyright (c) 2004, 2005 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: Implementation of the VtUiLayout class. +* +*/ + + + +// INCLUDE FILES +#include "VtUiLayout.h" +#include "VtUiPanic.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +// DATA TYPES + +// Enumerates files in which there can be bitmaps. +enum TVtUiBitmapFiles + { + // Video Telephone bitmap file. + EVtUiVideoBitmapFile, + // AVKON bitmap file. + EVtUiAvkonBitmapFile + }; + +// Video Telephone application bitmaps +_LIT( KVtUiVideoBitmapFileName, + "z:\\resource\\apps\\videotelui.mbm" ); +// Minimum step for zoom. +const TInt KVtUiZoomMinStep = 1; + +// Maximum step for zoom. +const TInt KVtUiZoomMaxStep = 11; + +// ============================ LOCAL FUNCTIONS =============================== + +inline TAknWindowComponentLayout DoCompose( TAknWindowComponentLayout aLine1, + TAknWindowComponentLayout aLine2 ) + { + return TAknWindowComponentLayout::Compose( aLine1, aLine2 ); + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetApplicationParentRect +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetApplicationParentRect( + TRect& aRect ) + { + // Calculate screen rectangle. + TSize screenSize = CCoeEnv::Static()->ScreenDevice()->SizeInPixels(); + TRect screenRect( screenSize ); + + // Calculate application window. + TAknLayoutRect appRect; + appRect.LayoutRect( + screenRect, + AknLayout::application_window( screenRect ) ); + aRect = appRect.Rect(); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetMainPaneLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetMainPaneLayout( + TAknWindowLineLayout& aLayout ) + { + TRect parent; + GetApplicationParentRect( parent ); + // Calculate main pane layout. + // First 1 = normal status pane, second 1 = control pane. + aLayout = AknLayout::main_pane( parent, 0, 1, 1 ); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetFirstWindowBackgroundLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetFirstWindowBackgroundLayout( + TAknWindowLineLayout& aLayout ) + { + //aLayout = AppLayout::Uplink_video_image__large__Line_1(); + TInt main_pane_variety( 0 ); + TInt vid_upl_variety( 18 ); + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + main_pane_variety = 4; + vid_upl_variety = 17; + } + + TAknWindowComponentLayout layout1 = + AknLayoutScalable_Apps::main_pane( main_pane_variety ); + TAknWindowComponentLayout layout2 = + AknLayoutScalable_Apps::main_video_tele_pane(); + TAknWindowComponentLayout layout3 = + AknLayoutScalable_Apps:: + call_video_uplink_pane_cp1( vid_upl_variety ); + TAknWindowComponentLayout layout4 = + AknLayoutScalable_Apps::call_video_uplink_pane_g1(); + aLayout = + DoCompose( + DoCompose( layout1, layout2 ), + DoCompose( layout3, layout4 ) ).LayoutLine(); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetFirstWindowStreamLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetFirstWindowStreamLayout( + TAknWindowLineLayout& aLayout ) + { + TInt main_pane_variety( 0 ); + TInt vid_upl_variety( 18 ); + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + main_pane_variety = 4; + vid_upl_variety = 17; + } + + TAknWindowComponentLayout layout1 = + AknLayoutScalable_Apps::main_pane( main_pane_variety ); + TAknWindowComponentLayout layout2 = + AknLayoutScalable_Apps::main_video_tele_pane(); + TAknWindowComponentLayout layout3 = + AknLayoutScalable_Apps:: + call_video_uplink_pane_cp1( vid_upl_variety ); + TAknWindowComponentLayout layout4 = + AknLayoutScalable_Apps::video_uplink_pane(); + aLayout = + DoCompose( + DoCompose( layout1, layout2 ), + DoCompose( layout3, layout4 ) ).LayoutLine(); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetFirstWindowStreamDisabledIconLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetFirstWindowStreamDisabledIconLayout( + TAknWindowLineLayout& aLayout ) + { + //aLayout = AppLayout::Uplink_video_image__large__Line_3(); + TInt main_pane_variety( 0 ); + TInt vid_upl_variety( 18 ); + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + main_pane_variety = 4; + vid_upl_variety = 17; + } + + TAknWindowComponentLayout layout1 = + AknLayoutScalable_Apps::main_pane( main_pane_variety ); + TAknWindowComponentLayout layout2 = + AknLayoutScalable_Apps::main_video_tele_pane(); + TAknWindowComponentLayout layout3 = + AknLayoutScalable_Apps:: + call_video_uplink_pane_cp1( vid_upl_variety ); + TAknWindowComponentLayout layout4 = + AknLayoutScalable_Apps::call_video_uplink_pane_g2(); + aLayout = + DoCompose( + DoCompose( layout1, layout2 ), + DoCompose( layout3, layout4 ) ).LayoutLine(); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetSecondWindowBackgroundLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetSecondWindowBackgroundLayout( + TAknWindowLineLayout& aLayout ) + { + aLayout = AppLayout::Downlink_video_image_Line_1(); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetSecondWindowStreamLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetSecondWindowStreamLayout( + TAknWindowLineLayout& aLayout, TBool aIsToolbar, TBool aIsSubQCIF ) + { + if( aIsSubQCIF ) + { + aLayout = AppLayout::video_down_subqcif_pane(); + } + else + { + if ( aIsToolbar ) + { + TInt varietyPr = 27; // portrait + TInt varietyLs = 26; // landscape + + TInt varietyIndex = Layout_Meta_Data::IsLandscapeOrientation() + ? varietyLs : varietyPr ; + TAknWindowComponentLayout layout1 = AknLayoutScalable_Apps:: + main_video_tele_pane(); + TAknWindowComponentLayout layout2 = AknLayoutScalable_Apps:: + video_down_crop_pane( varietyIndex ); + aLayout = TAknWindowComponentLayout::Compose( layout1, layout2 ). + LayoutLine(); + + } + else + { + aLayout = AppLayout::downlink_stream(); + } + } + } + + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetSecondWindowStreamWholeLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetSecondWindowStreamWholeLayout( + TAknWindowLineLayout& aLayout, TBool aIsToolbar, TBool aIsSubQCIF ) + { + if( aIsSubQCIF ) + { + aLayout = AppLayout::video_down_subqcif_pane(); + } + else + { + if ( aIsToolbar ) + { + TInt varietyPr = 24; // portrait + TInt varietyLs = 22; // landscape + + TInt varietyIndex = Layout_Meta_Data::IsLandscapeOrientation() + ? varietyLs : varietyPr; + TAknWindowComponentLayout layout1 = AknLayoutScalable_Apps:: + main_video_tele_pane(); + TAknWindowComponentLayout layout2 = AknLayoutScalable_Apps:: + video_down_pane( varietyIndex ); + aLayout = TAknWindowComponentLayout::Compose( layout1, layout2 ) + .LayoutLine(); + } + else + { + aLayout = AppLayout::downlink_stream_area(); + } + } + } +// ----------------------------------------------------------------------------- +// VtUiLayout::GetSecondWindowDisabledIconLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetSecondWindowDisabledIconLayout( + TAknWindowLineLayout& aLayout ) + { + 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(); + + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetSecondWindowWaitingTextLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetSecondWindowWaitingTextLayout( + TAknTextLineLayout& aLayout, + const TBool aFirstLine ) + { + TBool layoutFound = EFalse; + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + layoutFound = ETrue; + + TAknWindowComponentLayout layout1 = + AknLayoutScalable_Apps::main_video_tele_pane(); + + TAknTextComponentLayout layout2 = + aFirstLine ? + AknLayoutScalable_Apps::call_video_pane_t1(2) : + AknLayoutScalable_Apps::call_video_pane_t2(2); + + aLayout = + TAknWindowComponentLayout::ComposeText( + layout1, layout2 ).LayoutLine(); + } + + if ( !layoutFound ) + { + const TInt line( ( aFirstLine ) ? 0 : 1 ); + TAknWindowComponentLayout l1 = AknLayoutScalable_Apps:: + main_video_tele_pane(); + TAknTextComponentLayout l2; + if ( !line ) + { + l2 = AknLayoutScalable_Apps::call_video_pane_t1( 3 ); + } + else + { + l2 = AknLayoutScalable_Apps::call_video_pane_t2( 3 ); + } + aLayout = TAknWindowComponentLayout::ComposeText( l1, l2 ); + } + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetNumberEntryAreaLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetNumberEntryAreaLayout( + TAknWindowLineLayout& aLayout ) + { + TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 2 : 0; + + TAknWindowComponentLayout layout1 = + AknLayoutScalable_Apps::main_call_pane(); + TAknWindowComponentLayout layout2 = + AknLayoutScalable_Apps::popup_number_entry_window( variety ); + + aLayout = + TAknWindowComponentLayout::Compose( layout1, layout2 ).LayoutLine(); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetAudioRoutingIconLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetAudioRoutingIconLayout( + TAknWindowLineLayout& aLayout ) + { + aLayout = AppLayout::Navipane_elements_and_descendant_panes_Line_1(); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetCallDurationTextLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetCallDurationTextLayout( + TAknTextLineLayout& aLayout ) + { + aLayout = AppLayout::Navipanetexts_Line_1(); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetMutedTextLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetMutedTextLayout( + TAknTextLineLayout& aLayout ) + { + aLayout = AppLayout::Navipanetexts_Line_2(); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetZoomPaneLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetZoomPaneLayout( + TAknWindowLineLayout& aLayout ) + { + aLayout = AppLayout::zooming_pane(); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetZoomDirLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetZoomDirLayout( + TAknWindowLineLayout& aLayout ) + { + aLayout = AppLayout::Zooming_pane_elements_Line_1(); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetZoomAreaLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetZoomAreaLayout( + TAknWindowLineLayout& aLayout ) + { + aLayout = AppLayout::Zooming_pane_elements_Line_2(); + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::GetZoomStepLayout +// ----------------------------------------------------------------------------- +// +void VtUiLayout::GetZoomStepLayout( + TAknWindowLineLayout& aLayout, + TInt aZoomStep ) + { + aZoomStep = Max( Min( aZoomStep, KVtUiZoomMaxStep ), KVtUiZoomMinStep ); + aZoomStep--; // 1 .. 11 is mapped to 0 .. 10. + + // Function pointer table would be more efficient, but AppLayout methods + // are inline. + + switch ( aZoomStep ) + { + case 0: + aLayout = AppLayout::Zooming_steps_sizes_Line_1(); + break; + + case 1: + aLayout = AppLayout::Zooming_steps_sizes_Line_2(); + break; + + case 2: + aLayout = AppLayout::Zooming_steps_sizes_Line_3(); + break; + + case 3: + aLayout = AppLayout::Zooming_steps_sizes_Line_4(); + break; + + case 4: + aLayout = AppLayout::Zooming_steps_sizes_Line_5(); + break; + + case 5: + aLayout = AppLayout::Zooming_steps_sizes_Line_6(); + break; + + case 6: + aLayout = AppLayout::Zooming_steps_sizes_Line_7(); + break; + + case 7: + aLayout = AppLayout::Zooming_steps_sizes_Line_8(); + break; + + case 8: + aLayout = AppLayout::Zooming_steps_sizes_Line_9(); + break; + + case 9: + aLayout = AppLayout::Zooming_steps_sizes_Line_10(); + break; + + case 10: + default: + aLayout = AppLayout::Zooming_steps_sizes_Line_11(); + break; + } + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::MapBitmapToSkinId +// ----------------------------------------------------------------------------- +// +TAknsItemID VtUiLayout::MapBitmapToSkinId( TVtUiBitmapId aId ) + { + TAknsItemID skinId = KAknsIIDNone; + + switch ( aId ) + { + case EVtUiBitmap_qgn_graf_call_video_out_bg: + skinId = KAknsIIDQgnGrafCallVideoOutBg; + break; + + case EVtUiBitmap_qgn_indi_call_video_blind_in: + skinId = KAknsIIDQgnIndiCallVideoBlindIn; + break; + + case EVtUiBitmap_qgn_indi_call_video_blind_out: + skinId = KAknsIIDQgnIndiCallVideoBlindOut; + break; + + case EVtUiBitmap_qgn_indi_call_video_blind_in_mask_icon: + skinId = KAknsIIDQgnIndiCallVideoBlindInMaskIcon; + break; + + case EVtUiBitmap_qgn_indi_call_video_blind_out_mask_icon: + skinId = KAknsIIDQgnIndiCallVideoBlindOutMaskIcon; + break; + + case EVtUiBitmap_qgn_indi_earpiece: + skinId = KAknsIIDQgnIndiEarpiece; + break; + + case EVtUiBitmap_qgn_indi_speaker: + skinId = KAknsIIDQgnIndiSpeaker; + break; + + case EVtUiBitmap_qgn_indi_zoom_dir: + skinId = KAknsIIDQgnIndiZoomDir; + break; + + case EVtUiBitmap_qgn_graf_zoom_area: + skinId = KAknsIIDQgnGrafZoomArea; + break; + + case EVtUiBitmap_qgn_indi_zoom_min: + skinId = KAknsIIDQgnIndiZoomMin; + break; + + case EVtUiBitmap_qgn_indi_zoom_max: + skinId = KAknsIIDQgnIndiZoomMax; + break; + + case EVtUiBitmap_qgn_prop_sub_current: + 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. + break; + } + + return skinId; + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::MapBitmapToColorId +// ----------------------------------------------------------------------------- +// +TBool VtUiLayout::MapBitmapToColorId( + TVtUiBitmapId aId, + TAknsItemID& aColorId, + TInt& aColorIndex ) + { + TBool result = EFalse; + + aColorId = KAknsIIDNone; + aColorIndex = KErrNotFound; + + switch ( aId ) + { + case EVtUiBitmap_qgn_indi_earpiece: + case EVtUiBitmap_qgn_indi_earpiece_mask: + case EVtUiBitmap_qgn_indi_speaker: + case EVtUiBitmap_qgn_indi_speaker_mask: + case EVtUiBitmap_qgn_indi_zoom_dir: + case EVtUiBitmap_qgn_indi_zoom_dir_mask: + result = ETrue; + aColorId = KAknsIIDQsnIconColors; + aColorIndex = EAknsCIQsnIconColorsCG7; + break; + + default: + // Default value is OK. + break; + } + + return result; + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::Resolve +// ----------------------------------------------------------------------------- +// +void VtUiLayout::Resolve( + TVtUiBitmapId aId, + TFileName& aFileName, + TInt& aIndex ) + { + TInt index = KErrNotFound; + TVtUiBitmapFiles file = EVtUiVideoBitmapFile; + + switch ( aId ) + { + case EVtUiBitmap_qgn_graf_call_video_out_bg: + index = EMbmVideoteluiQgn_graf_call_video_out_bg; + break; + + case EVtUiBitmap_qgn_graf_call_video_out_bg_mask: + index = EMbmVideoteluiQgn_graf_call_video_out_bg_mask; + break; + + case EVtUiBitmap_qgn_indi_call_video_blind_in: + index = EMbmVideoteluiQgn_indi_call_video_blind_in; + break; + + case EVtUiBitmap_qgn_indi_call_video_blind_out: + index = EMbmVideoteluiQgn_indi_call_video_blind_out; + break; + + case EVtUiBitmap_qgn_indi_earpiece: + file = EVtUiAvkonBitmapFile; + index = EMbmAvkonQgn_indi_earpiece; + break; + + case EVtUiBitmap_qgn_indi_earpiece_mask: + file = EVtUiAvkonBitmapFile; + index = EMbmAvkonQgn_indi_earpiece_mask; + break; + + case EVtUiBitmap_qgn_indi_speaker: + file = EVtUiAvkonBitmapFile; + index = EMbmAvkonQgn_indi_speaker; + break; + + case EVtUiBitmap_qgn_indi_speaker_mask: + file = EVtUiAvkonBitmapFile; + index = EMbmAvkonQgn_indi_speaker_mask; + break; + + case EVtUiBitmap_qgn_graf_zoom_area: + index = EMbmVideoteluiQgn_graf_zoom_area; + break; + + case EVtUiBitmap_qgn_indi_zoom_dir: + index = EMbmVideoteluiQgn_indi_zoom_dir; + break; + + case EVtUiBitmap_qgn_indi_zoom_dir_mask: + index = EMbmVideoteluiQgn_indi_zoom_dir_mask; + break; + + case EVtUiBitmap_qgn_indi_zoom_min: + index = EMbmVideoteluiQgn_indi_zoom_min; + break; + + case EVtUiBitmap_qgn_indi_zoom_max: + index = EMbmVideoteluiQgn_indi_zoom_max; + break; + + case EVtUiBitmap_qgn_indi_call_video_blind_in_mask_icon: + index = EMbmVideoteluiQgn_indi_call_video_blind_in_mask_icon; + break; + + case EVtUiBitmap_qgn_indi_call_video_blind_out_mask_icon: + index = EMbmVideoteluiQgn_indi_call_video_blind_out_mask_icon; + break; + + case EVtUiBitmap_qgn_prop_sub_current: + file = EVtUiAvkonBitmapFile; + index = EMbmAvkonQgn_prop_sub_current; + break; + + case EVtUiBitmap_qgn_prop_sub_current_mask: + 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 ); + break; + } + + aIndex = index; + switch ( file ) + { + case EVtUiVideoBitmapFile: + aFileName = KVtUiVideoBitmapFileName; + break; + + case EVtUiAvkonBitmapFile: + aFileName = AknIconUtils::AvkonIconFileName(); + break; + + default: + VtUiPanic::Panic( EVtUiPanicInvalidBitmapFile ); + break; + } + } + +// ----------------------------------------------------------------------------- +// VtUiLayout::IsLandscapeOrientation +// ----------------------------------------------------------------------------- +// +TBool VtUiLayout::IsLandscapeOrientation() + { + 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 f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/VtUiPanic.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/VtUiPanic.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2004 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: Implementation of the VtUiPanic class. +* +*/ + + + +// INCLUDE FILES +#include "VtUiPanic.h" + +// CONSTANTS + +// Panic category for Video Telephone application. +_LIT( KVtUiPanicCategory, "Videotelui" ); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// VtUiPanic::Panic +// ----------------------------------------------------------------------------- +// +void VtUiPanic::Panic( TVtUiPanicReason aReason ) + { + User::Panic( KVtUiPanicCategory, aReason ); + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/VtUiUtility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/VtUiUtility.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,336 @@ +/* +* Copyright (c) 2004 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: Implementation of the VtUiUtility class. +* +*/ + + + +// INCLUDE FILES +#include "VtUiUtility.h" +#include "VtUiPanic.h" +#include +#include +#include +#include +#include "tVtuifeaturevariation.h" + +// Characters to open number entry. +_LIT( KVtUiDTMFCharacters, "0123456789*#" ); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// VtUiUtility::GetAudioRoutingAvailability +// ----------------------------------------------------------------------------- +// +void VtUiUtility::GetAudioRoutingAvailability( + MVtEngAudio& aAudio, + TInt& aAvailable ) + { + aAvailable = 0; + TVtUiBTVariation btvariation; + const TBool bluetoothAudioSupported = + btvariation.IsBTSupported(); + + MVtEngAudio::TAudioRoutingState routingState; + if ( aAudio.GetRoutingState( routingState ) == KErrNone ) + { + // Deactivate BT handsfree. + if ( bluetoothAudioSupported && + IsAudioRoutingAvailable( + aAudio, + routingState, + MVtEngAudio::EAudioBT, + MVtEngAudio::EAudioHandset ) ) + { + aAvailable |= EDeactivateBtHandsfree; + } + + // Activate BT handsfree. + if ( bluetoothAudioSupported && + ( IsAudioRoutingAvailable( + aAudio, + routingState, + MVtEngAudio::EAudioHandset, + MVtEngAudio::EAudioBT ) || + IsAudioRoutingAvailable( + aAudio, + routingState, + MVtEngAudio::EAudioLoudspeaker, + MVtEngAudio::EAudioBT ) ) ) + { + aAvailable |= EActivateBtHandsfree; + } + + // Deactivate loudspeaker + if ( IsAudioRoutingAvailable( + aAudio, + routingState, + MVtEngAudio::EAudioLoudspeaker, + MVtEngAudio::EAudioHandset ) ) + { + aAvailable |= EDeactivateLoudspeaker; + } + + // Activate loudspeaker + if ( IsAudioRoutingAvailable( + aAudio, + routingState, + MVtEngAudio::EAudioHandset, + MVtEngAudio::EAudioLoudspeaker ) || + ( bluetoothAudioSupported && + IsAudioRoutingAvailable( + aAudio, + routingState, + MVtEngAudio::EAudioBT, + MVtEngAudio::EAudioLoudspeaker ) ) ) + { + aAvailable |= EActivateLoudspeaker; + } + } + } + +// ----------------------------------------------------------------------------- +// VtUiUtility::GetOutgoingMediaState +// ----------------------------------------------------------------------------- +// +void VtUiUtility::GetOutgoingMediaState( + MVtEngMedia& aMedia, + TInt& aAvailable ) + { + TInt outgoingMediaState; + const TInt err = + aMedia.GetMediaState( + MVtEngMedia::EMediaOutgoing, + outgoingMediaState ); + if ( err == KErrNone ) + { + // If source is still image, then video sending is off. + MVtEngMedia::TMediaSource source; + if ( aMedia.GetSource( source ) == KErrNone ) + { + if ( source == MVtEngMedia::EMediaStillImage ) + { + outgoingMediaState &= ~MVtEngMedia::EMediaVideo; + } + } + TBool freezeSupported; + if( aMedia.GetFreezeSupported( freezeSupported ) == KErrNone ) + { + TBool isFrozen; + if( freezeSupported && aMedia.GetFreezeState( isFrozen ) == KErrNone ) + { + if( isFrozen ) + { + outgoingMediaState &= ~MVtEngMedia::EMediaVideo; + } + } + } + } + else + { + outgoingMediaState = + ( MVtEngMedia::EMediaAudio | MVtEngMedia::EMediaVideo ); + } + aAvailable = outgoingMediaState; + } + +// ----------------------------------------------------------------------------- +// VtUiUtility::GetIncomingMediaState +// ----------------------------------------------------------------------------- +// +void VtUiUtility::GetIncomingMediaState( + MVtEngMedia& aMedia, + TInt& aAvailable ) + { + TInt mediaState; + const TInt err = + aMedia.GetMediaState( + MVtEngMedia::EMediaIncoming, + mediaState ); + if ( err != KErrNone ) + { + mediaState = + ( MVtEngMedia::EMediaAudio | MVtEngMedia::EMediaVideo ); + } + + aAvailable = mediaState; + } + +// ----------------------------------------------------------------------------- +// VtUiUtility::HasStillImage +// ----------------------------------------------------------------------------- +// +TBool VtUiUtility::HasStillImage( + MVtEngMedia& aMedia ) + { + TInt caps; + const TInt capsErr = aMedia.GetSourcesCaps( caps ); + return ( capsErr == KErrNone ) && + ( caps & MVtEngMedia::ESourceCapsStillImage ); + } + +// ----------------------------------------------------------------------------- +// VtUiUtility::GetFreezeState +// ----------------------------------------------------------------------------- +// +TBool VtUiUtility::GetFreezeState( + MVtEngMedia& aMedia ) + { + TBool isFrozen; + const TInt err = aMedia.GetFreezeState( isFrozen ); + if ( err == KErrNone ) + { + return isFrozen; + } + else //provider was not ready + { + return EFalse; + } + } + +// ----------------------------------------------------------------------------- +// VtUiUtility::IsFreezeSupported +// ----------------------------------------------------------------------------- +// +TBool VtUiUtility::IsFreezeSupported( + MVtEngMedia& aMedia ) + { + TBool isFreezeSupported; + const TInt err = aMedia.GetFreezeSupported( isFreezeSupported ); + if ( err == KErrNone ) + { + return isFreezeSupported; + } + else //provider was not ready + { + return EFalse; + } + } + +// ----------------------------------------------------------------------------- +// VtUiUtility::GetVideoQuality +// ----------------------------------------------------------------------------- +// +void VtUiUtility::GetVideoQuality( + MVtEngMedia& aMedia, + MVtEngMedia::TVideoQuality& aVideoQuality ) + { + aMedia.GetVideoQuality( aVideoQuality ); + } + +// ----------------------------------------------------------------------------- +// VtUiUtility::GetObjectSharingState +// ----------------------------------------------------------------------------- +// +void VtUiUtility::GetObjectSharingState( + MVtEngMedia& aMedia, + MVtEngMedia::TShareObjectState& aShareObjectState ) + { + aMedia.GetObjectSharingState( aShareObjectState ); + } + + +// ----------------------------------------------------------------------------- +// VtUiUtility::IsZoomAllowed +// ----------------------------------------------------------------------------- +// +TBool VtUiUtility::IsZoomAllowed( + MVtEngMedia& aMedia ) + { + TBool result = EFalse; + + TInt currentStep; + if ( aMedia.GetCurrentZoomStep( currentStep ) == KErrNone ) + { + TInt max; + if ( aMedia.GetMaxZoomStep( max ) == KErrNone ) + { + // Zooming is allowed if maximum zoom step is greater than + // zero and camera is in use (and not still image / none). + TInt avail; + GetOutgoingMediaState( aMedia, avail ); + + result = ( max > 0 ) && ( avail & MVtEngMedia::EMediaVideo ); + } + } + + __VTPRINT2( DEBUG_GEN, "Ui.AllowZoom.%d", result ) + return result; + } + +// ----------------------------------------------------------------------------- +// VtUiUtility::HasCameras +// ----------------------------------------------------------------------------- +// +TBool VtUiUtility::HasCameras( MVtEngMedia& aMedia ) + { + TInt sourceCaps; + if ( aMedia.GetSourcesCaps( sourceCaps ) != KErrNone ) + { + sourceCaps = 0; + } + return ( sourceCaps & MVtEngMedia::ESourceCapsPrimaryCamera ) || + ( sourceCaps & MVtEngMedia::ESourceCapsSecondaryCamera ); + } + +// ----------------------------------------------------------------------------- +// VtUiUtility::IsAudioRoutingAvailable +// ----------------------------------------------------------------------------- +// +TBool VtUiUtility::IsAudioRoutingAvailable( + MVtEngAudio& aAudio, + const MVtEngAudio::TAudioRoutingState aCurrent, + const MVtEngAudio::TAudioRoutingState aSource, + const MVtEngAudio::TAudioRoutingState aTarget ) + { + TBool result = EFalse; + if ( aCurrent == aSource ) + { + TBool available = EFalse; + TInt err = aAudio.GetRoutingAvailability( aTarget, available ); + + result = ( ( err == KErrNone ) && ( available ) ); + } + + return result; + } + + +// ----------------------------------------------------------------------------- +// VtUiUtility::IsDTMFEvent +// ----------------------------------------------------------------------------- +// +TBool VtUiUtility::IsDTMFEvent( const TKeyEvent& aKeyEvent, TChar& aDtmfTone ) + { + TBuf<1> buffer; // one character + buffer.Append( aKeyEvent.iCode ); + AknTextUtils::ConvertDigitsTo( buffer, EDigitTypeWestern ); + aDtmfTone = buffer[ 0 ]; + return + ( KVtUiDTMFCharacters().Locate( buffer[ 0 ] ) != KErrNotFound ); + } + +// ----------------------------------------------------------------------------- +// VtUiUtility::IsDTMFCharacter +// ----------------------------------------------------------------------------- +// +TBool VtUiUtility::IsDTMFCharacter( const TChar aChar ) + { + return + ( KVtUiDTMFCharacters().Locate( aChar ) != KErrNotFound ); + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/cvtuicmdbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/cvtuicmdbase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2007 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: UI command bases class implementation. +* +*/ + + +#include "cvtuicmdbase.h" + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// FindCVtUiCmdBaseById +// --------------------------------------------------------------------------- +// +TInt FindCVtUiCmdBaseById( const CVtUiCmdBase& aC1, const CVtUiCmdBase& aC2 ) + { + return ( aC1.CommandId() - aC2.CommandId() ); + } + +// --------------------------------------------------------------------------- +// FindCVtUiCmdBaseByKey +// --------------------------------------------------------------------------- +// +TInt FindCVtUiCmdBaseByKey( const TInt* aKey, const CVtUiCmdBase& aC ) + { + return ( *aKey - aC.CommandId() ); + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiCmdBase::CommandId +// --------------------------------------------------------------------------- +// +TInt CVtUiCmdBase::CommandId() const + { + return iCommandId; + } + +// --------------------------------------------------------------------------- +// CVtUiCmdBase::LinearOrder +// --------------------------------------------------------------------------- +// +TLinearOrder< CVtUiCmdBase > CVtUiCmdBase::LinearOrder() + { + return TLinearOrder< CVtUiCmdBase >( ::FindCVtUiCmdBaseById ); + } + +// --------------------------------------------------------------------------- +// CVtUiCmdBase::LinearOrder +// --------------------------------------------------------------------------- +// +CVtUiCmdBase::TKeyOrder CVtUiCmdBase::KeyOrder() + { + return ::FindCVtUiCmdBaseByKey; + } + +// --------------------------------------------------------------------------- +// CVtUiCmdBase::CVtUiCmdBase +// --------------------------------------------------------------------------- +// +CVtUiCmdBase::CVtUiCmdBase( TInt aCommandId ) : iCommandId( aCommandId ) + { + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/cvtuicmdcontext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/cvtuicmdcontext.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2006 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: Command context base class. +* +*/ + + +#include + +#include "cvtuicmdcontext.h" +#include "cvtuicmdvalidatorbase.h" +#include "cvtuicmdvalidationactionbase.h" +#include "mvtuicommandmanager.h" + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Compare routine used by InsertInOrder() and FindInOrder() to sort validator +// instances by priority. +// --------------------------------------------------------------------------- +// +TInt ValidatorPriCmpFunc( const CVtUiCmdValidatorBase& aV1, + const CVtUiCmdValidatorBase& aV2 ) + { + return aV1.Priority() - aV2.Priority(); + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiCmdContext::~CVtUiCmdContext +// --------------------------------------------------------------------------- +// +CVtUiCmdContext::~CVtUiCmdContext() + { + __VTPRINTENTER( "CmdCtx.~" ) + iValidators.Reset(); + __VTPRINTEXIT( "CmdCtx.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdContext::ReferencePriority +// --------------------------------------------------------------------------- +// +TInt CVtUiCmdContext::ReferencePriority() const + { + __VTPRINTENTER( "CmdCtx.ReferencePriority" ) + __VTPRINTEXITR( "CmdCtx.ReferencePriority %d", iReferencePriority ) + return iReferencePriority; + } + +// --------------------------------------------------------------------------- +// CVtUiCmdContext::ContextType +// --------------------------------------------------------------------------- +// +TVtUiCmdContextType CVtUiCmdContext::ContextType() const + { + __VTPRINTENTER( "CmdCtx.ContextType" ) + __VTPRINTEXITR( "CmdCtx.ContextType %d", iContextType ) + return iContextType; + } + +// --------------------------------------------------------------------------- +// CVtUiCmdContext::AddValidator +// --------------------------------------------------------------------------- +// +TInt CVtUiCmdContext::AddValidator( CVtUiCmdValidatorBase& aValidator ) + { + __VTPRINTENTER( "CmdCtx.AddValidator" ) + TInt result( KErrNone ); + if ( !aValidator.ValidatesContext( iContextType ) ) + { + result = KErrNotSupported; + } + else + { + result = iValidators.InsertInOrderAllowRepeats( &aValidator, + TLinearOrder< CVtUiCmdValidatorBase >( ::ValidatorPriCmpFunc ) ); + } + __VTPRINTEXITR( "CmdCtx.AddValidator %d", result ) + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiCmdContext::RemoveValidator +// --------------------------------------------------------------------------- +// +void CVtUiCmdContext::RemoveValidator( const CVtUiCmdValidatorBase& aValidator ) + { + __VTPRINTENTER( "CmdCtx.RemoveValidator" ) + TInt idx( iValidators.FindInOrder( &aValidator, + TLinearOrder< CVtUiCmdValidatorBase >( ::ValidatorPriCmpFunc ) ) ); + + if ( idx != KErrNotFound ) + { + iValidators.Remove( idx ); + } + __VTPRINTEXIT( "CmdCtx.RemoveValidator" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdContext::CVtUiCmdContext +// --------------------------------------------------------------------------- +// +CVtUiCmdContext::CVtUiCmdContext( MVtUiCommandManager& aCommandManager, + TVtUiCmdContextType aCtxType, TInt aReferencePriority ) + : iCommandManager( aCommandManager ), + iReferencePriority( aReferencePriority ), iContextType( aCtxType ) + { + __VTPRINTENTER( "CmdCtx.ctor" ) + __VTPRINTEXIT( "CmdCtx.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdContext::ValidateMenuItemsL +// --------------------------------------------------------------------------- +// +void CVtUiCmdContext::ValidateMenuItemsL( + CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "CmdCtx.ValidateMenuItemsL" ) + __VTPRINT2( DEBUG_GEN, " count = %d", iValidators.Count() ) + for ( TInt i = iValidators.Count() - 1; i >= 0; i-- ) + { + iValidators[ i ]->ValidateMenuItemsL( aAction, iReferencePriority ); + } + __VTPRINTEXIT( "CmdCtx.ValidateMenuItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdContext::ValidateSoftkeyItemsL +// --------------------------------------------------------------------------- +// +void CVtUiCmdContext::ValidateSoftkeyItemsL( + CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "CmdCtx.ValidateSoftkeyItemsL" ) + __VTPRINT2( DEBUG_GEN, " count = %d", iValidators.Count() ) + for ( TInt i = iValidators.Count() - 1; i >= 0; i-- ) + { + iValidators[ i ]->ValidateSoftkeyItemsL( aAction, iReferencePriority ); + } + __VTPRINTEXIT( "CmdCtx.ValidateSoftkeyItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdContext::ValidateToolbarItemsL +// --------------------------------------------------------------------------- +// +void CVtUiCmdContext::ValidateToolbarItemsL( + CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "CmdCtx.ValidateToolbarItemsL" ) + __VTPRINT2( DEBUG_GEN, " count = %d", iValidators.Count() ) + for ( TInt i = iValidators.Count() - 1; i >= 0; i-- ) + { + iValidators[ i ]->ValidateToolbarItemsL( aAction, iReferencePriority ); + } + __VTPRINTEXIT( "CmdCtx.ValidateToolbarItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdContext::CustomValidationL +// --------------------------------------------------------------------------- +// +void CVtUiCmdContext::CustomValidationL( + CVtUiCmdCustomValidationActionBase& aAction ) + { + __VTPRINTENTER( "CmdCtx.CustomValidationL" ) + __VTPRINT2( DEBUG_GEN, " count = %d", iValidators.Count() ) + for ( TInt i = iValidators.Count() - 1; i >= 0; i-- ) + { + iValidators[ i ]->CustomValidationL( aAction, iReferencePriority ); + } + __VTPRINTEXIT( "CmdCtx.CustomValidationL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdContext::RegisterCommandContextL +// --------------------------------------------------------------------------- +// +void CVtUiCmdContext::RegisterCommandContextL() + { + __VTPRINTENTER( "CmdCtx.RegisterCommandContextL" ) + User::LeaveIfError( iCommandManager.RegisterCommandContext( *this ) ); + __VTPRINTEXIT( "CmdCtx.RegisterCommandContextL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdContext::UnregisterCommandContext +// --------------------------------------------------------------------------- +// +void CVtUiCmdContext::UnregisterCommandContext() + { + __VTPRINTENTER( "CmdCtx.UnregisterCommandContext" ) + iCommandManager.UnregisterCommandContext( *this ); + __VTPRINTEXIT( "CmdCtx.UnregisterCommandContext" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/cvtuicmdcustomvalidationactionbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/cvtuicmdcustomvalidationactionbase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2006 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: Custom command validation action base class. +* +*/ + + +#include + +#include "cvtuicmdcustomvalidationactionbase.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiCmdCustomValidationActionBase::CustomTypeId +// --------------------------------------------------------------------------- +// +CVtUiCmdCustomValidationActionBase::TCustomTypeId +CVtUiCmdCustomValidationActionBase::CustomTypeId() const + { + return iCustomTypeId; + } + +// --------------------------------------------------------------------------- +// CVtUiCmdCustomValidationActionBase::BeginProcess +// --------------------------------------------------------------------------- +// +CVtUiCmdCustomValidationActionBase::CVtUiCmdCustomValidationActionBase( + TCustomTypeId aCustomTypeId ) + : iCustomTypeId( aCustomTypeId ) + { + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/cvtuicmdstatecheckaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/cvtuicmdstatecheckaction.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2006 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: Menu item dimmer action class. +* +*/ + + +#include + +#include "cvtuicmdstatecheckaction.h" +#include "tvtuicmdvalidatorcallback.h" +#include "tvtuicmdcontexttype.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiCmdStateCheckAction::NewL +// --------------------------------------------------------------------------- +// +CVtUiCmdStateCheckAction* CVtUiCmdStateCheckAction::NewL() + { + __VTPRINTENTER( "CmdStChkAct.NewL" ) + CVtUiCmdStateCheckAction* self = + new ( ELeave ) CVtUiCmdStateCheckAction(); + __VTPRINTEXIT( "CmdStChkAct.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiCmdStateCheckAction::SetCommand +// --------------------------------------------------------------------------- +// +void CVtUiCmdStateCheckAction::SetCommand( TInt aCommandId ) + { + __VTPRINTENTER( "CmdStChkAct.SetCommand" ) + iCommandId = aCommandId; + iIsCommandAllowed = EFalse; + __VTPRINTEXIT( "CmdStChkAct.SetCommand" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdStateCheckAction::IsCommandAllowed +// --------------------------------------------------------------------------- +// +TBool CVtUiCmdStateCheckAction::IsCommandAllowed() const + { + return iIsCommandAllowed; + } + +// --------------------------------------------------------------------------- +// CVtUiCmdStateCheckAction::ProcessL +// --------------------------------------------------------------------------- +// +void CVtUiCmdStateCheckAction::ProcessL( + const MVtUiCmdValidatorCallBack& aCallBack ) + { + __VTPRINTENTER( "CmdStChkAct.ProcessL" ) + if ( !IsCommandHandled( iCommandId ) ) + { + if ( aCallBack.Call( iCommandId ) ) + { + CommandHandledL( iCommandId ); + iIsCommandAllowed = ETrue; + } + } + __VTPRINTEXIT( "CmdStChkAct.ProcessL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdStateCheckAction::CVtUiCmdStateCheckAction +// --------------------------------------------------------------------------- +// +CVtUiCmdStateCheckAction::CVtUiCmdStateCheckAction() + : CVtUiCmdCustomValidationActionBase( EVtUiCmdContextTypeExecution ) + { + __VTPRINTENTER( "CmdStChkAct.ctor" ) + __VTPRINTEXIT( "CmdStChkAct.ctor" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/cvtuicmdvalidationactionbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/cvtuicmdvalidationactionbase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2006 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: Command validation action base class. +* +*/ + + +#include + +#include "cvtuicmdvalidationactionbase.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiCmdValidationActionBase::~CVtUiCmdValidationActionBase +// --------------------------------------------------------------------------- +// +CVtUiCmdValidationActionBase::~CVtUiCmdValidationActionBase() + { + __VTPRINTENTER( "ValActBase.~" ) + iHandledCommands.Reset(); + __VTPRINTEXIT( "ValActBase.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdValidationActionBase::BeginProcess +// --------------------------------------------------------------------------- +// +void CVtUiCmdValidationActionBase::BeginProcess() + { + __VTPRINTENTER( "ValActBase.BeginProcess" ) + iHandledCommands.Reset(); + __VTPRINTEXIT( "ValActBase.BeginProcess" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdValidationActionBase::EndProcess +// --------------------------------------------------------------------------- +// +void CVtUiCmdValidationActionBase::EndProcess() + { + __VTPRINTENTER( "ValActBase.EndProcess" ) + __VTPRINTEXIT( "ValActBase.EndProcess" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdValidationActionBase::CommandHandledL +// --------------------------------------------------------------------------- +// +void CVtUiCmdValidationActionBase::CommandHandledL( TInt aCommandId ) + { + __VTPRINTENTER( "ValActBase.CommandHandledL" ) + __VTPRINT2( DEBUG_GEN, " cmdId = %d", aCommandId ); + User::LeaveIfError( iHandledCommands.InsertInOrder( aCommandId ) ); + __VTPRINTEXIT( "ValActBase.CommandHandledL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdValidationActionBase::IsCommandHandled +// --------------------------------------------------------------------------- +// +TBool CVtUiCmdValidationActionBase::IsCommandHandled( TInt aCommandId ) const + { + __VTPRINTENTER( "ValActBase.IsCommandHandled" ) + TBool result( iHandledCommands.FindInOrder( aCommandId ) != KErrNotFound ); + __VTPRINTEXITR( "ValActBase.IsCommandHandled %d", result ) + return result; + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/cvtuicmdvalidatorbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/cvtuicmdvalidatorbase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2006 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: Command validator base class. +* +*/ + + +#include + +#include "cvtuicmdvalidatorbase.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiCmdValidatorBase::Priority +// --------------------------------------------------------------------------- +// +TInt CVtUiCmdValidatorBase::Priority() const + { + __VTPRINTENTER( "ValidatorBase.Priority" ) + __VTPRINTEXITR( "ValidatorBase.Priority %d", iPriority ) + return iPriority; + } + +// --------------------------------------------------------------------------- +// CVtUiCmdValidatorBase::CVtUiCmdValidatorBase +// --------------------------------------------------------------------------- +// +CVtUiCmdValidatorBase::CVtUiCmdValidatorBase( TInt aPriority ) + : iPriority( aPriority ) + { + __VTPRINTENTER( "ValidatorBase.ctor" ) + __VTPRINTEXIT( "ValidatorBase.ctor" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/cvtuicommandmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/cvtuicommandmanager.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,421 @@ +/* +* Copyright (c) 2006 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: Command manager class. +* +*/ + + +#include + +#include "cvtuicmdbase.h" +#include "cvtuicommandmanager.h" +#include "cvtuicommandpolicymanager.h" +#include "cvtuiprimarycmdpolicy.h" +#include "cvtuiexecutioncontext.h" +#include "cvtuimenuitemdimmeraction.h" +#include "tvtuistates.h" +#include "mvtuicommandui.h" +#include "cvtuicommandmodifybase.h" +#include "cvtuicmdstatecheckaction.h" + +// Default array granularity. +static const TInt KVtUiArrayGranularity = 1; + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::NewL +// ----------------------------------------------------------------------------- +// +CVtUiCommandManager* CVtUiCommandManager::NewL( const TVtUiStates& aUiStates, + CVtUiAppUi& aAppUi ) + { + __VTPRINTENTER( "CmdMgr.NewL" ) + CVtUiCommandManager* self = new ( ELeave ) CVtUiCommandManager( aUiStates, + aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "CmdMgr.NewL" ) + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::~CVtUiCommandManager +// ----------------------------------------------------------------------------- +// +CVtUiCommandManager::~CVtUiCommandManager() + { + __VTPRINTENTER( "CmdMgr.~" ) + iCommands.Reset(); + iCommandUis.Reset(); + iCommandModifiers.Reset(); + delete iExecutionContext; + delete iCmdStateCheckAction; + delete iCmdPolicyMgr; + __VTPRINTEXIT( "CmdMgr.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::UiStates +// ----------------------------------------------------------------------------- +// +const TVtUiStates& CVtUiCommandManager::UiStates() const + { + return iUiStates; + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::AppUi +// ----------------------------------------------------------------------------- +// +const CVtUiAppUi& CVtUiCommandManager::AppUi() const + { + return iAppUi; + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::VideoTelephonyVariation +// ----------------------------------------------------------------------------- +// +const TVtUiVideoTelephonyVariation& +CVtUiCommandManager::VideoTelephonyVariation() const + { + return iVtVariation; + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::HandleCommandL +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::HandleCommandL( TInt aCommandId ) + { + TInt index( iCommands.FindInOrder( aCommandId, CVtUiCmdBase::KeyOrder() ) ); + if ( index != KErrNotFound ) + { + iCommands[ index ]->HandleL(); + } + /* + + This was commented out, because current CVtUiAppUi silently ignores + commands that are not handled, changed this to emulate same kind of + behaviour. + + else + { + User::Leave( KErrNotFound ); + } + */ + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::AddCommandUi +// ----------------------------------------------------------------------------- +// +TInt CVtUiCommandManager::AddCommandUi( MVtUiCommandUi& aCommandUi ) + { + __VTPRINTENTER( "CmdMgr.AddCommandUi" ) + TInt result( KErrAlreadyExists ); + TInt idx( iCommandUis.Find( &aCommandUi ) ); + if ( idx == KErrNotFound ) + { + result = iCommandUis.Append( &aCommandUi ); + if ( result == KErrNone ) + { + result = CommandUiAdded( aCommandUi ); + } + } + __VTPRINTEXITR( "CmdMgr.AddCommandUi %d", result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::RemoveCommandUi +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::RemoveCommandUi( MVtUiCommandUi& aCommandUi ) + { + __VTPRINTENTER( "CmdMgr.RemoveCommandUi" ) + TInt idx( iCommandUis.Find( &aCommandUi ) ); + if ( idx != KErrNotFound ) + { + iCommandUis.Remove( idx ); + CommandUiRemoved( aCommandUi ); + } + __VTPRINTEXIT( "CmdMgr.RemoveCommandUi" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::ValidateMenuItemsL +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::ValidateMenuItemsL( + CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "CmdMgr.ValidateMenuItemsL" ) + iCmdPolicyMgr->ValidateMenuItemsL( aAction ); + __VTPRINTEXIT( "CmdMgr.ValidateMenuItemsL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::ValidateSoftkeyItemsL +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::ValidateSoftkeyItemsL( + CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "CmdMgr.ValidateSoftkeyItemsL" ) + iCmdPolicyMgr->ValidateSoftkeyItemsL( aAction ); + __VTPRINTEXIT( "CmdMgr.ValidateSoftkeyItemsL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::ValidateToolbarItemsL +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::ValidateToolbarItemsL( + CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "CmdMgr.ValidateToolbarItemsL" ) + iCmdPolicyMgr->ValidateToolbarItemsL( aAction ); + __VTPRINTEXIT( "CmdMgr.ValidateToolbarItemsL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::IsCommandAllowedL +// ----------------------------------------------------------------------------- +// +TBool CVtUiCommandManager::IsCommandAllowedL( TInt aCommandId ) + { + __VTPRINTENTER( "CmdMgr.IsCommandAllowedL" ) + TInt index( iCommands.FindInOrder( aCommandId, CVtUiCmdBase::KeyOrder() ) ); + if ( index == KErrNotFound ) + { + iCmdStateCheckAction->SetCommand( aCommandId ); + iCmdPolicyMgr->CustomValidateL( *iCmdStateCheckAction ); + } + else + { + return iCommands[ index ]->IsEnabled(); + } + __VTPRINTEXIT( "CmdMgr.IsCommandAllowedL" ) + return iCmdStateCheckAction->IsCommandAllowed(); + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::RegisterCommandContext +// ----------------------------------------------------------------------------- +// +TInt CVtUiCommandManager::RegisterCommandContext( CVtUiCmdContext& aContext ) + { + __VTPRINTENTER( "CmdMgr.RegisterCommandContext" ) + TInt result( iCmdPolicyMgr->RegisterCommandContext( aContext ) ); + __VTPRINTEXITR( "CmdMgr.RegisterCommandContext %d", result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::UnregisterCommandContext +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::UnregisterCommandContext( CVtUiCmdContext& aContext ) + { + __VTPRINTENTER( "CmdMgr.UnregisterCommandContext" ) + iCmdPolicyMgr->UnregisterCommandContext( aContext ); + __VTPRINTEXIT( "CmdMgr.UnregisterCommandContext" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::AddValidator +// ----------------------------------------------------------------------------- +// +TInt CVtUiCommandManager::AddValidator( CVtUiCmdValidatorBase& aValidator ) + { + __VTPRINTENTER( "CmdMgr.AddValidator" ) + TInt result( iCmdPolicyMgr->AddValidator( aValidator ) ); + __VTPRINTEXITR( "CmdMgr.AddValidator %d", result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::RemoveValidator +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::RemoveValidator( + CVtUiCmdValidatorBase& aValidator ) + { + __VTPRINTENTER( "CmdMgr.RemoveValidator" ) + iCmdPolicyMgr->RemoveValidator( aValidator ); + __VTPRINTEXIT( "CmdMgr.RemoveValidator" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::RefreshL +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::RefreshL() + { + __VTPRINTENTER( "CmdMgr.RefreshL" ) + for ( TInt i = iCommandUis.Count() - 1; i >= 0; i-- ) + { + iCommandUis[ i ]->RefreshL(); + } + __VTPRINTEXIT( "CmdMgr.RefreshL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::AddCommandModifier +// ----------------------------------------------------------------------------- +// +TInt CVtUiCommandManager::AddCommandModifier( + CVtUiCommandModifyBase& aModifier ) + { + __VTPRINTENTER( "CmdMgr.AddCommandModifier" ) + TInt result( + iCommandModifiers.InsertInOrder( &aModifier, + CVtUiCommandModifyBase::PriorityOrder() ) ); + if ( result == KErrNone ) + { + result = CommandModifierAdded( aModifier ); + } + __VTPRINTEXITR( "CmdMgr.AddCommandModifier %d", result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::RemoveCommandModifier +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::RemoveCommandModifier( + CVtUiCommandModifyBase& aModifier ) + { + __VTPRINTENTER( "CmdMgr.RemoveCommandModifier" ) + TInt idx( iCommandModifiers.FindInOrder( &aModifier, + CVtUiCommandModifyBase::PriorityOrder() ) ); + if ( idx != KErrNotFound ) + { + iCommandModifiers.Remove( idx ); + CommandModifierRemoved( aModifier ); + } + __VTPRINTEXIT( "CmdMgr.RemoveCommandModifier" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::RegisterCommandL +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::RegisterCommandL( CVtUiCmdBase& aCommand ) + { + __VTPRINTENTER( "CmdMgr.RegisterCommandL" ) + iCommands.InsertInOrderL( &aCommand, CVtUiCmdBase::LinearOrder() ); + __VTPRINTEXIT( "CmdMgr.RegisterCommandL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::UnregisterCommand +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::UnregisterCommand( const CVtUiCmdBase& aCommand ) + { + __VTPRINTENTER( "CmdMgr.UnregisterCommand" ) + TInt index( iCommands.FindInOrder( &aCommand, + CVtUiCmdBase::LinearOrder() ) ); + if ( index != KErrNotFound ) + { + iCommands.Remove( index ); + } + __VTPRINTEXIT( "CmdMgr.UnregisterCommand" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::CVtUiCommandManager +// ----------------------------------------------------------------------------- +// +CVtUiCommandManager::CVtUiCommandManager( const TVtUiStates& aUiStates, + CVtUiAppUi& aAppUi ) +: iCommandUis( KVtUiArrayGranularity ), + iCommandModifiers( KVtUiArrayGranularity ), + iCommands( KVtUiArrayGranularity ), + iUiStates( aUiStates ), + iAppUi( aAppUi ) + { + __VTPRINTENTER( "CmdMgr.ctor" ) + __VTPRINTEXIT( "CmdMgr.ctor" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::ConstructL +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::ConstructL() + { + __VTPRINTENTER( "CmdMgr.ConstructL" ) + iVtVariation.ReadL(); + iCmdPolicyMgr = CVtUiCommandPolicyManager::NewL( *this ); + iCmdStateCheckAction = CVtUiCmdStateCheckAction::NewL(); + iExecutionContext = CVtUiExecutionContext::NewL( *this ); + __VTPRINTEXIT( "CmdMgr.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::CommandModifierAdded +// ----------------------------------------------------------------------------- +// +TInt CVtUiCommandManager::CommandModifierAdded( + CVtUiCommandModifyBase& aModifier ) + { + TInt error( KErrNone ); + for ( TInt i = iCommandUis.Count() - 1; !error && i >= 0; i-- ) + { + error = iCommandUis[ i ]->AddCommandModifier( aModifier ); + } + return error; + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::CommandModifierRemoved +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::CommandModifierRemoved( + CVtUiCommandModifyBase& aModifier ) + { + for ( TInt i = iCommandUis.Count() - 1; i >= 0; i-- ) + { + iCommandUis[ i ]->RemoveCommandModifier( aModifier ); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::CommandUiAdded +// ----------------------------------------------------------------------------- +// +TInt CVtUiCommandManager::CommandUiAdded( MVtUiCommandUi& aCommandUi ) + { + TInt error( KErrNone ); + for ( TInt i = iCommandModifiers.Count() - 1; !error && i >= 0; i-- ) + { + error = aCommandUi.AddCommandModifier( *iCommandModifiers[ i ] ); + } + return error; + } + +// ----------------------------------------------------------------------------- +// CVtUiCommandManager::CommandUiRemoved +// ----------------------------------------------------------------------------- +// +void CVtUiCommandManager::CommandUiRemoved( MVtUiCommandUi& aCommandUi ) + { + for ( TInt i = iCommandModifiers.Count() - 1; i >= 0; i-- ) + { + aCommandUi.RemoveCommandModifier( *iCommandModifiers[ i ] ); + } + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/cvtuicommandmodifybase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/cvtuicommandmodifybase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2006 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: Command context base class. +* +*/ + + +#include + +#include "cvtuicommandmodifybase.h" + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiCommandModifyBase::CVtUiCommandModifyBase +// --------------------------------------------------------------------------- +// +CVtUiCommandModifyBase::CVtUiCommandModifyBase( TInt aPriority ) + : iPriority( aPriority ) + { + } + +// --------------------------------------------------------------------------- +// CVtUiCommandModifyBase::PriorityOrder +// --------------------------------------------------------------------------- +// +TLinearOrder< CVtUiCommandModifyBase > CVtUiCommandModifyBase::PriorityOrder() + { + return TLinearOrder< CVtUiCommandModifyBase >( PriorityOrderFunc ); + } + +// --------------------------------------------------------------------------- +// CVtUiCommandModifyBase::PriorityOrderFunc +// --------------------------------------------------------------------------- +// +TInt CVtUiCommandModifyBase::PriorityOrderFunc( + const CVtUiCommandModifyBase& aM1, const CVtUiCommandModifyBase& aM2 ) + { + return aM1.iPriority - aM2.iPriority; + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/cvtuicommandpolicymanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/cvtuicommandpolicymanager.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,334 @@ +/* +* Copyright (c) 2006 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: Command policy manager class. +* +*/ + + +#include + +#include "cvtuicommandpolicymanager.h" +#include "cvtuicmdcontext.h" +#include "cvtuicmdvalidatorbase.h" +#include "cvtuicmdvalidationactionbase.h" +#include "cvtuicmdcustomvalidationactionbase.h" +#include "cvtuiprimarycmdpolicy.h" +#include "cvtuicommandmanager.h" + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Used in InsertInOrder() method to compare two instances of CVtUiCmdContext. +// --------------------------------------------------------------------------- +// +TInt ContextTypeCmpFunc( const CVtUiCmdContext& aV1, + const CVtUiCmdContext& aV2 ) + { + return static_cast< TInt >( aV1.ContextType() ) - + static_cast< TInt >( aV2.ContextType() ); + } + +// --------------------------------------------------------------------------- +// Used in FindInOrder() method to compare instances of CVtUiCmdContext versus +// given key value. +// --------------------------------------------------------------------------- +// +TInt ContextTypeCmpFuncVsKey( const TVtUiCmdContextType* aKey, + const CVtUiCmdContext& aValue ) + { + return static_cast< TInt > ( *aKey ) - + static_cast< TInt >( aValue.ContextType() ); + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::NewL +// --------------------------------------------------------------------------- +// +CVtUiCommandPolicyManager* +CVtUiCommandPolicyManager::NewL( const CVtUiCommandManager& aCmdManager ) + { + CVtUiCommandPolicyManager* self = + new ( ELeave ) CVtUiCommandPolicyManager( aCmdManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::~CVtUiCommandPolicyManager +// --------------------------------------------------------------------------- +// +CVtUiCommandPolicyManager::~CVtUiCommandPolicyManager() + { + __VTPRINTENTER( "CmdPolicyMgr.~" ) + iContexts.Reset(); + iValidators.Reset(); + delete iPrimaryCommandPolicy; + __VTPRINTEXIT( "CmdPolicyMgr.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::RegisterCommandContext +// --------------------------------------------------------------------------- +// +TInt CVtUiCommandPolicyManager::RegisterCommandContext( + CVtUiCmdContext& aContext ) + { + __VTPRINTENTER( "CmdPolicyMgr.RegisterCommandContext" ) + TLinearOrder< CVtUiCmdContext > cmpFunc( ::ContextTypeCmpFunc ); + TInt result( KErrNone ); + TInt index( iContexts.FindInOrder( &aContext, cmpFunc ) ); + if ( index == KErrNotFound ) + { + TInt error( iContexts.InsertInOrder( &aContext, cmpFunc ) ); + if ( !error ) + { + CommandContextRegistered( aContext ); + } + result = error; + } + else + { + result = KErrAlreadyExists; + } + __VTPRINTEXITR( "CmdPolicyMgr.RegisterCommandContext %d", result ) + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::UnregisterCommandContext +// --------------------------------------------------------------------------- +// +void CVtUiCommandPolicyManager::UnregisterCommandContext( + CVtUiCmdContext& aContext ) + { + __VTPRINTENTER( "CmdPolicyMgr.UnregisterCommandContext" ) + TLinearOrder< CVtUiCmdContext > cmpFunc( ::ContextTypeCmpFunc ); + TInt index( iContexts.FindInOrder( &aContext, cmpFunc ) ); + if ( index != KErrNotFound ) + { + iContexts.Remove( index ); + CommandContextUnregistered( aContext ); + } + __VTPRINTEXIT( "CmdPolicyMgr.UnregisterCommandContext" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::AddValidator +// --------------------------------------------------------------------------- +// +TInt CVtUiCommandPolicyManager::AddValidator( + CVtUiCmdValidatorBase& aValidator ) + { + __VTPRINTENTER( "CmdPolicyMgr.AddValidator" ) + TInt error( iValidators.Append( &aValidator ) ); + if ( !error ) + { + ValidatorAdded( aValidator ); + } + __VTPRINTEXITR( "CmdPolicyMgr.AddValidator %d", error ) + return error; + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::RemoveValidator +// --------------------------------------------------------------------------- +// +void CVtUiCommandPolicyManager::RemoveValidator( + CVtUiCmdValidatorBase& aValidator ) + { + __VTPRINTENTER( "CmdPolicyMgr.RemoveValidator" ) + TInt index( iValidators.Find( &aValidator ) ); + if ( index != KErrNotFound ) + { + iValidators.Remove( index ); + ValidatorRemoved( aValidator ); + } + __VTPRINTEXIT( "CmdPolicyMgr.RemoveValidator" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::ValidateMenuItemsL +// --------------------------------------------------------------------------- +// +void CVtUiCommandPolicyManager::ValidateMenuItemsL( + CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "CmdPolicyMgr.ValidateMenuItemsL" ) + ValidateL( EVtUiCmdContextTypeMenu, aAction ); + __VTPRINTEXIT( "CmdPolicyMgr.ValidateMenuItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::ValidateSoftkeyItemsL +// --------------------------------------------------------------------------- +// +void CVtUiCommandPolicyManager::ValidateSoftkeyItemsL( + CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "CmdPolicyMgr.ValidateSoftkeyItemsL" ) + ValidateL( EVtUiCmdContextTypeSoftkey, aAction ); + __VTPRINTEXIT( "CmdPolicyMgr.ValidateSoftkeyItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::ValidateToolbarItemsL +// --------------------------------------------------------------------------- +// +void CVtUiCommandPolicyManager::ValidateToolbarItemsL( + CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "CmdPolicyMgr.ValidateToolbarItemsL" ) + ValidateL( EVtUiCmdContextTypeToolbar, aAction ); + __VTPRINTEXIT( "CmdPolicyMgr.ValidateToolbarItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::CustomValidateL +// --------------------------------------------------------------------------- +// +void CVtUiCommandPolicyManager::CustomValidateL( + CVtUiCmdCustomValidationActionBase& aAction ) + { + __VTPRINTENTER( "CmdPolicyMgr.CustomValidateL" ) + ValidateL( EVtUiCmdContextTypeExecution, aAction ); + __VTPRINTEXIT( "CmdPolicyMgr.CustomValidateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::CVtUiCommandPolicyManager +// --------------------------------------------------------------------------- +// +CVtUiCommandPolicyManager::CVtUiCommandPolicyManager( + const CVtUiCommandManager& aCmdManager ) : iCommandManager( aCmdManager ) + { + __VTPRINTENTER( "CmdPolicyMgr.ctor" ) + __VTPRINTEXIT( "CmdPolicyMgr.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiCommandPolicyManager::ConstructL() + { + __VTPRINTENTER( "CmdPolicyMgr.ConstructL" ) + iPrimaryCommandPolicy = + CVtUiPrimaryCmdPolicy::NewL( iCommandManager.UiStates(), + iCommandManager.AppUi() ); + User::LeaveIfError( AddValidator( *iPrimaryCommandPolicy ) ); + __VTPRINTEXIT( "CmdPolicyMgr.ConstructL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::CommandContextRegistered +// --------------------------------------------------------------------------- +// +void CVtUiCommandPolicyManager::CommandContextRegistered( + CVtUiCmdContext& aContext ) + { + __VTPRINTENTER( "CmdPolicyMgr.CommandContextRegistered" ) + for ( TInt i = iValidators.Count() - 1 ; i >= 0; i-- ) + { + aContext.AddValidator( *iValidators[ i ] ); + } + __VTPRINTEXIT( "CmdPolicyMgr.CommandContextRegistered" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::CommandContextUnregistered +// --------------------------------------------------------------------------- +// +void CVtUiCommandPolicyManager::CommandContextUnregistered( + CVtUiCmdContext& aContext ) + { + __VTPRINTENTER( "CmdPolicyMgr.CommandContextUnregistered" ) + for ( TInt i = iValidators.Count() - 1 ; i >= 0; i-- ) + { + aContext.RemoveValidator( *iValidators[ i ] ); + } + __VTPRINTEXIT( "CmdPolicyMgr.CommandContextUnregistered" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::ValidatorAdded +// --------------------------------------------------------------------------- +// +void CVtUiCommandPolicyManager::ValidatorAdded( + CVtUiCmdValidatorBase& aValidator ) + { + __VTPRINTENTER( "CmdPolicyMgr.ValidatorAdded" ) + for ( TInt i = iContexts.Count() - 1 ; i >= 0; i-- ) + { + iContexts[ i ]->AddValidator( aValidator ); + } + __VTPRINTEXIT( "CmdPolicyMgr.ValidatorAdded" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::ValidatorRemoved +// --------------------------------------------------------------------------- +// +void CVtUiCommandPolicyManager::ValidatorRemoved( + CVtUiCmdValidatorBase& aValidator ) + { + __VTPRINTENTER( "CmdPolicyMgr.ValidatorRemoved" ) + for ( TInt i = iContexts.Count() - 1 ; i >= 0; i-- ) + { + iContexts[ i ]->RemoveValidator( aValidator ); + } + __VTPRINTEXIT( "CmdPolicyMgr.ValidatorRemoved" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::FindCommandContextByType +// --------------------------------------------------------------------------- +// +CVtUiCmdContext* CVtUiCommandPolicyManager::FindCommandContextByType( + TVtUiCmdContextType aContextType ) + { + __VTPRINTENTER( "CmdPolicyMgr.FindCommandContextByType" ) + CVtUiCmdContext* result = NULL; + TInt index( iContexts.FindInOrder( aContextType, + ::ContextTypeCmpFuncVsKey ) ); + if ( index != KErrNotFound ) + { + result = iContexts[ index ]; + } + __VTPRINTEXIT( "CmdPolicyMgr.FindCommandContextByType" ) + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiCommandPolicyManager::ValidateL +// --------------------------------------------------------------------------- +// +void CVtUiCommandPolicyManager::ValidateL( TVtUiCmdContextType aContextType, + CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "CmdPolicyMgr.ValidateL" ) + CVtUiCmdContext* context = + FindCommandContextByType( aContextType ); + if ( context ) + { + aAction.BeginProcess(); + context->ValidateL( aAction ); + aAction.EndProcess(); + } + __VTPRINTEXIT( "CmdPolicyMgr.ValidateL" ) + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/cvtuiexecutioncontext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/cvtuiexecutioncontext.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2006 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: Execution context class. +* +*/ + + +#include + +#include "cvtuiexecutioncontext.h" +#include "cvtuicmdcustomvalidationactionbase.h" + +/** Execution context reference priority */ +static const TInt KVtUiExecutionContextPriority = 1000; + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiExecutionContext::~CVtUiExecutionContext +// --------------------------------------------------------------------------- +// +CVtUiExecutionContext::~CVtUiExecutionContext() + { + __VTPRINTENTER( "ExecCtx.~" ) + UnregisterCommandContext(); + __VTPRINTEXIT( "ExecCtx.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiExecutionContext::NewL +// --------------------------------------------------------------------------- +// +CVtUiExecutionContext* CVtUiExecutionContext::NewL( + MVtUiCommandManager& aCommandManager ) + { + __VTPRINTENTER( "ExecCtx.NewL" ) + CVtUiExecutionContext* self = + new ( ELeave ) CVtUiExecutionContext( aCommandManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "ExecCtx.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiExecutionContext::ValidateL +// --------------------------------------------------------------------------- +// +void CVtUiExecutionContext::ValidateL( CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "ExecCtx.ValidateL" ) + CustomValidationL( + static_cast< CVtUiCmdCustomValidationActionBase& >( aAction ) ); + __VTPRINTEXIT( "ExecCtx.ValidateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiExecutionContext::CVtUiExecutionContext +// --------------------------------------------------------------------------- +// +CVtUiExecutionContext::CVtUiExecutionContext( + MVtUiCommandManager& aCommandManager ) + : CVtUiCmdContext( aCommandManager, EVtUiCmdContextTypeExecution, + KVtUiExecutionContextPriority ) + { + __VTPRINTENTER( "ExecCtx.ctor" ) + __VTPRINTEXIT( "ExecCtx.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiExecutionContext::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiExecutionContext::ConstructL() + { + __VTPRINTENTER( "ExecCtx.ConstructL" ) + RegisterCommandContextL(); + __VTPRINTEXIT( "ExecCtx.ConstructL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/cvtuifeaturecmdbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/cvtuifeaturecmdbase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2007 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: Feature based UI command base class implementation. +* +*/ + + +#include "cvtuifeaturecmdbase.h" +#include "mvtuifeature.h" + +// --------------------------------------------------------------------------- +// CVtUiFeatureCmdBase::HandleL +// --------------------------------------------------------------------------- +// +void CVtUiFeatureCmdBase::HandleL() + { + iFeature.StartL(); + } + +// --------------------------------------------------------------------------- +// CVtUiFeatureCmdBase::IsEnabled +// --------------------------------------------------------------------------- +// +TBool CVtUiFeatureCmdBase::IsEnabled() const + { + return ( iFeature.State() == MVtUiFeature::EReady ) || + ( iFeature.State() == MVtUiFeature::EUnprepared ); + } + +// --------------------------------------------------------------------------- +// CVtUiFeatureCmdBase::CVtUiFeatureCmdBase +// --------------------------------------------------------------------------- +// +CVtUiFeatureCmdBase::CVtUiFeatureCmdBase( MVtUiFeature& aFeature, + TInt aCommandId ) : CVtUiCmdBase( aCommandId ), iFeature( aFeature ) + { + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/cvtuiprimarycmdpolicy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/cvtuiprimarycmdpolicy.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,534 @@ +/* +* Copyright (c) 2006 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: Primary policy class. +* +*/ + + +#include +#include +#include +#include +#include + +#include "cvtuiprimarycmdpolicy.h" +#include "cvtuicmdvalidationactionbase.h" +#include "cvtuicmdcustomvalidationactionbase.h" +#include "tvtuicmdvalidatorcallback.h" +#include "tvtuistates.h" +#include "videotelui.hrh" +#include "tVtuifeaturevariation.h" +#include "CVtUiAppUi.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::NewL +// --------------------------------------------------------------------------- +// +CVtUiPrimaryCmdPolicy* CVtUiPrimaryCmdPolicy::NewL( + const TVtUiStates& aUiStates, const CVtUiAppUi& aAppUi ) + { + __VTPRINTENTER( "PrimaryCmdPolicy.NewL" ) + CVtUiPrimaryCmdPolicy* self = + new ( ELeave ) CVtUiPrimaryCmdPolicy( aUiStates, aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "PrimaryCmdPolicy.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::~CVtUiPrimaryCmdPolicy +// --------------------------------------------------------------------------- +// +CVtUiPrimaryCmdPolicy::~CVtUiPrimaryCmdPolicy() + { + __VTPRINTENTER( "PrimaryCmdPolicy.~" ) + __VTPRINTEXIT( "PrimaryCmdPolicy.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::ValidateMenuItemsL +// --------------------------------------------------------------------------- +// +void CVtUiPrimaryCmdPolicy::ValidateMenuItemsL( + CVtUiCmdValidationActionBase& aAction, TInt ) + { + __VTPRINTENTER( "PrimaryCmdPolicy.ValidateMenuItemsL" ) + aAction.ProcessL( + TVtUiCmdValidatorCallBack< CVtUiPrimaryCmdPolicy >( *this, + ValidateMenuCommand ) ); + __VTPRINTEXIT( "PrimaryCmdPolicy.ValidateMenuItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::ValidateSoftkeyItemsL +// --------------------------------------------------------------------------- +// +void CVtUiPrimaryCmdPolicy::ValidateSoftkeyItemsL( + CVtUiCmdValidationActionBase& aAction, TInt ) + { + __VTPRINTENTER( "PrimaryCmdPolicy.ValidateSoftkeyItemsL" ) + aAction.ProcessL( + TVtUiCmdValidatorCallBack< CVtUiPrimaryCmdPolicy >( *this, + ValidateSoftkey ) ); + __VTPRINTEXIT( "PrimaryCmdPolicy.ValidateSoftkeyItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::ValidateSoftkeyItemsL +// --------------------------------------------------------------------------- +// +void CVtUiPrimaryCmdPolicy::ValidateToolbarItemsL( + CVtUiCmdValidationActionBase& aAction, TInt ) + { + __VTPRINTENTER( "PrimaryCmdPolicy.ValidateToolbarItemsL" ) + aAction.ProcessL( + TVtUiCmdValidatorCallBack< CVtUiPrimaryCmdPolicy >( *this, + ValidateToolbarCommand ) ); + __VTPRINTEXIT( "PrimaryCmdPolicy.ValidateToolbarItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::CustomValidationL +// --------------------------------------------------------------------------- +// +void CVtUiPrimaryCmdPolicy::CustomValidationL( + CVtUiCmdCustomValidationActionBase& aAction, TInt ) + { + __VTPRINTENTER( "PrimaryCmdPolicy.CustomValidationL" ) + switch ( aAction.CustomTypeId() ) + { + // Command state validation + case EVtUiCmdContextTypeExecution: + aAction.ProcessL( TVtUiCmdValidatorCallBack< CVtUiPrimaryCmdPolicy >( + *this, ValidateCommandState ) ); + break; + + default: + __VTPRINT2( DEBUG_GEN, + "PrimaryCmdPolicy.CustomValidationL unknown typeId = %d", + aAction.CustomTypeId() ); + break; + } + __VTPRINTEXIT( "PrimaryCmdPolicy.CustomValidationL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::ValidatesContext +// --------------------------------------------------------------------------- +// +TBool CVtUiPrimaryCmdPolicy::ValidatesContext( + const TVtUiCmdContextType& aCtxType ) const + { + __VTPRINTENTER( "PrimaryCmdPolicy.ValidatesContext" ) + + TBool result( EFalse ); + + switch ( aCtxType ) + { + case EVtUiCmdContextTypeMenu: + case EVtUiCmdContextTypeSoftkey: + case EVtUiCmdContextTypeToolbar: + case EVtUiCmdContextTypeExecution: + result = ETrue; + break; + + default: + break; + } + + __VTPRINTEXITR( "PrimaryCmdPolicy.ValidatesContext %d", result ) + + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::CVtUiPrimaryCmdPolicy +// --------------------------------------------------------------------------- +// +CVtUiPrimaryCmdPolicy::CVtUiPrimaryCmdPolicy( const TVtUiStates& aUiStates, + const CVtUiAppUi& aAppUi ) + : CVtUiCmdValidatorBase( EVtUiCmdPolicyPriorityPrimary ), + iUiStates( aUiStates ), iAppUi( aAppUi ) + { + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiPrimaryCmdPolicy::ConstructL() + { + TVtUiActiveIdleVariation activeIdleVariation; + iAIEnabled = activeIdleVariation.IsActiveIdleEnabled(); + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::ValidateMenuCommand +// --------------------------------------------------------------------------- +// +TBool CVtUiPrimaryCmdPolicy::ValidateMenuCommand( TInt aCommandId ) const + { + TBool handled; + return ValidateCommand( aCommandId, handled ); + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::ValidateSoftkey +// --------------------------------------------------------------------------- +// +TBool CVtUiPrimaryCmdPolicy::ValidateSoftkey( TInt aResourceId ) const + { + __VTPRINTENTER( "PrimaryCmdPolicy.ValidateSoftkey" ) + TBool result( EFalse ); + switch ( aResourceId ) + { + case R_VIDEOTELUI_SOFTKEYS_EMPTY_ACTIVE_COMMAND: + result = iUiStates.IsCommandActivating(); + break; + + case R_VIDEOTELUI_SOFTKEYS_EMPTY_DIALEREXIT: + result = iUiStates.IsDialerActivating(); + break; + + case R_VIDEOTELUI_SOFTKEYS_SHARE_OBJECT_IMAGE: + result = iUiStates.MediaState().IsSharing(); + break; + + case R_VIDEOTELUI_SOFTKEYS_CAPTURE_VIDEO: + result = iUiStates.IsCaptureModeOn(); + break; + + case R_VIDEOTELUI_SOFTKEYS_ENABLE_AUDIO: + result = !iUiStates.AudioState().IsAudio(); + break; + + case R_VIDEOTELUI_SOFTKEYS_ENABLE_VIDEO: + result = !iUiStates.MediaState().IsVideo() && + iUiStates.MediaState().HasCamera() && + ( iUiStates.ExecState() == TVtUiStates::EExecStateRunning ); + break; + + case R_VIDEOTELUI_SOFTKEYS_DIALER: + case R_VIDEOTELUI_SOFTKEYS_BT_HANDSFREE: + case R_VIDEOTELUI_SOFTKEYS_LOUDSPEAKER: + case R_VIDEOTELUI_SOFTKEYS_HANDSET_B: + { + if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) && + ( iUiStates.ExecState() == TVtUiStates::EExecStateRunning ) ) + { + switch ( aResourceId ) + { + case R_VIDEOTELUI_SOFTKEYS_DIALER: + result = ETrue; + break; + } + } + else + { + switch ( aResourceId ) + { + case R_VIDEOTELUI_SOFTKEYS_BT_HANDSFREE: + result = iUiStates.AudioState().CanActivateBtHf(); + break; + + case R_VIDEOTELUI_SOFTKEYS_LOUDSPEAKER: + result = iUiStates.AudioState().CanActivateLoudspeaker(); + break; + + case R_VIDEOTELUI_SOFTKEYS_HANDSET_B: + result = iUiStates.AudioState().CanDeactivateLoudspeaker(); + break; + } + } + } + break; + + case R_VIDEOTELUI_SOFTKEYS_END_CALL: + result = ETrue; + break; + } + __VTPRINTEXITR( "PrimaryCmdPolicy.ValidateSoftkey %d", result ) + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::ValidateToolbarCommand +// --------------------------------------------------------------------------- +// +TBool CVtUiPrimaryCmdPolicy::ValidateToolbarCommand( TInt aCommandId ) const + { + __VTPRINTENTER( "PrimaryCmdPolicy.ValidateToolbarCommand" ) + __VTPRINT2( DEBUG_GEN, "cmdId = %d", aCommandId ) + TBool result( ETrue ); + switch( aCommandId ) + { + case EVtUiCmdZoom: + case EVtUiCmdShareObjectImage: + case EVtUiCmdSwapImagesPlaces: + //case EVtUiCmdSnapshot: + + result = EFalse; + break; + + default: + result = ValidateMenuCommand( aCommandId ); + break; + } + __VTPRINTEXITR( "PrimaryCmdPolicy.ValidateToolbarCommand %d", result ) + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::ValidateCommandState +// --------------------------------------------------------------------------- +// +TBool CVtUiPrimaryCmdPolicy::ValidateCommandState( TInt aCommandId ) const + { + __VTPRINTENTER( "PrimaryCmdPolicy.ValidateCommandState" ) + TBool handled; + TBool allowed( !ValidateCommand( aCommandId, handled ) ); + if ( !handled ) + { + switch ( aCommandId ) + { + case EVtUiCmdCapture: + case EVtUiCmdCancelCapture: + allowed = iUiStates.IsCaptureModeOn(); + break; + + case EVtUiCmdStopSharingObjectImage: + allowed = iUiStates.MediaState().IsSharing() && + !iUiStates.MediaState().IsVideoPermanentlyStopped(); + break; + + default: + allowed = ETrue; + break; + } + } + __VTPRINTEXITR( "PrimaryCmdPolicy.ValidateCommandState %d", allowed ) + return allowed; + } + +// --------------------------------------------------------------------------- +// CVtUiPrimaryCmdPolicy::ValidateCommand +// --------------------------------------------------------------------------- +// +TBool CVtUiPrimaryCmdPolicy::ValidateCommand( TInt aCommandId, + TBool& aHandled ) const + { + __VTPRINTENTER( "PrimaryCmdPolicy.ValidateCommand" ) + + __VTPRINT2( DEBUG_GEN, " cmdId = %d", aCommandId ) + + TBool result( ETrue ); + + aHandled = ETrue; + + const TVtUiMediaState& mediaState( iUiStates.MediaState() ); + const TVtUiAudioState& audioState( iUiStates.AudioState() ); + const TBool disabledVideo( !mediaState.IsVideo() || + mediaState.IsSharing() ); + const TBool disabledAudio( !audioState.IsAudio() ); + const TBool disableVideoOptions( !mediaState.HasCamera() ); + const TBool freezeSupported( mediaState.IsFreezeSupported() ); + const TBool frozen( mediaState.IsFrozen() ); + + const TBool videoPermStopped( mediaState.IsVideoPermanentlyStopped() ); + const TBool audioPermStopped( audioState.IsAudioPermanentlyStopped() ); + + switch( aCommandId ) + { + case EVtUiCmdSnapshot: + result = ( disabledVideo && !frozen ) || + disableVideoOptions || + !freezeSupported; + break; + + case EVtUiCmdUsePrimaryCamera: + result = mediaState.IsPrimaryCameraInUse() || frozen || + !mediaState.HasPrimaryCamera() || mediaState.IsSharing() || + videoPermStopped; + break; + + case EVtUiCmdUseSecondaryCamera: + result = mediaState.IsSecondaryCameraInUse() || frozen || + !mediaState.HasSecondaryCamera() || mediaState.IsSharing() || + videoPermStopped; + break; + + case EVtUiCmdDeactivateBT: + result = !audioState.CanDeactivateBtHf(); + break; + + case EVtUiCmdSwitchFromBTToIHF: + result = !audioState.CanDeactivateBtHf() || + !audioState.CanActivateLoudspeaker(); + break; + + case EVtUiCmdActivateBT: + result = !audioState.CanActivateBtHf(); + break; + + case EVtUiCmdDeactivateLoudspeaker: + result = !audioState.CanDeactivateLoudspeaker(); + break; + + case EVtUiCmdActivateLoudspeaker: + result = !audioState.CanActivateLoudspeaker(); + break; + + case EVtUiCmdSwapImagesPlaces: + // Swap image places is always shown in menu. + result = EFalse; + break; + + case EVtUiCmdAdjustVideo: + // Adjust video is always shown in menu. + result = EFalse; + break; + + case EVtUiCmdAdjustVideoVideoQuality: + result = EFalse; + break; + + case EVtUiCmdAdjustVideoWhiteBalance: + result = !iUiStates.IsWhiteBalanceSettingAvailable() || frozen; + break; + + case EVtUiCmdAdjustVideoBrightness: + result =!iUiStates.IsBrightnessSettingAvailable() || frozen; + break; + + case EVtUiCmdAdjustVideoContrast: + result =!iUiStates.IsContrastSettingAvailable() || frozen; + break; + + case EVtUiCmdAdjustVideoColourTone: + result = !iUiStates.IsColorToneSettingAvailable() || frozen; + + break; + case EVtUiCmdZoom: + result = frozen || disableVideoOptions || disabledVideo; + break; + + case EVtUiCmdCreateVoice: + // Downgrading to voice call is not possible if remote end MSISDN + // is unavailable or there is waiting call. + result = !iUiStates.IsCLIReceived() || iUiStates.IsWaitingCall(); + break; + + case EVtUiCmdGoToIdle: +#ifndef RD_BOOT_CUSTOMIZABLE_AI + result = !iAIEnabled; +#else + // When RD_BOOT_CUSTOMIZABLE_AI is defined, active idle is always + // shown in menu + // result = EFalse; + // disable the go to idle when autolock is on. + result = iUiStates.IsDeviceLockOn(); +#endif //RD_BOOT_CUSTOMIZABLE_AI + break; + + case EAknCmdHelp: + { + TVtUiHelpVariation hlpvariation; + result = !hlpvariation.IsHelpSupported(); + } + break; + + case EAknCmdExit: + // Exit option is disabled by default. Change ETrue to EFalse + // and it is in the menu. + break; + + case EVtUiCmdEndActiveCall: + // End active call always shown in menu. + result = EFalse; + break; + + case EVtUiCmdShareObjectImage: + result = frozen || mediaState.IsNotAbleToShare() || + mediaState.IsInitializingShare() || videoPermStopped || + iAppUi.IsActiveCommand( EVtUiCmdShareObjectImage ); + break; + + case EVtUiCmdEnableMain: + result = ( iAppUi.IsActiveCommand( EVtUiCmdEnableVideo ) || + iAppUi.IsActiveCommand( EVtUiCmdDisableVideo ) || + !disabledVideo || disableVideoOptions || videoPermStopped ) + && ( iAppUi.IsActiveCommand ( EVtUiCmdEnableAudio ) || + !disabledAudio || audioPermStopped ); + break; + + case EVtUiCmdEnableVideo: + result = !disabledVideo || disableVideoOptions || + videoPermStopped; + break; + + case EVtUiCmdEnableAudio: + result = !disabledAudio || audioPermStopped; + break; + + case EVtUiCmdEnableBoth: + result = !disabledVideo || !disabledAudio || disableVideoOptions || + videoPermStopped || audioPermStopped; + break; + + case EVtUiCmdDisableMain: + result = ( iAppUi.IsActiveCommand( EVtUiCmdDisableVideo ) || + iAppUi.IsActiveCommand( EVtUiCmdEnableVideo ) || + disabledVideo || disableVideoOptions || videoPermStopped ) && + ( iAppUi.IsActiveCommand( EVtUiCmdDisableAudio ) || + disabledAudio || audioPermStopped ); + break; + + case EVtUiCmdDisableVideo: + result = disabledVideo || disableVideoOptions || videoPermStopped; + break; + + case EVtUiCmdDisableAudio: + result = disabledAudio || audioPermStopped; + break; + + case EVtUiCmdDisableBoth: + result = disableVideoOptions || disabledVideo || disabledAudio || + videoPermStopped || audioPermStopped; + break; + + case EVtUiCmdSendDTMF: + if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) ) + { + result = EFalse; + } + else + { + result = ETrue; + } + break; + + default: + aHandled = EFalse; + break; + } + + __VTPRINTEXITR( "PrimaryCmdPolicy.ValidateCommand %d", result ) + + return result; + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/tVtuifeaturevariation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/tVtuifeaturevariation.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2007 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: Video Telephone feature variation class definition. +* +*/ + + +#include "tVtuifeaturevariation.h" + +// TVtUiFeatureVariationBase + +// ----------------------------------------------------------------------------- +// TVtUiFeatureVariationBase::IsFeatureSupported +// ----------------------------------------------------------------------------- +// +TBool TVtUiFeatureVariationBase::IsFeatureSupported( const TUint32 aId ) const + { + return FeatureManager::FeatureSupported( aId ); + } + +//TVtUiHelpVariation +// ----------------------------------------------------------------------------- +// TVtUiHelpVariation::FeatureId +// ----------------------------------------------------------------------------- +// +TUint32 TVtUiHelpVariation::FeatureId() const + { + return KFeatureIdHelp; + } +// ----------------------------------------------------------------------------- +// TVtUiHelpVariation::IsHelpSupported +// ----------------------------------------------------------------------------- +// +TBool TVtUiHelpVariation::IsHelpSupported() const + { + return IsFeatureSupported( FeatureId() ); + } +//TVtUiDPVariation +// ----------------------------------------------------------------------------- +// TVtUiDPVariation::FeatureId +// ----------------------------------------------------------------------------- +// +TUint32 TVtUiDPVariation::FeatureId() const + { + return KFeatureIdDisplayPost; + } +// ----------------------------------------------------------------------------- +// TVtUiDPVariation::IsDPSupported +// ----------------------------------------------------------------------------- +// +TBool TVtUiDPVariation::IsDPSupported() const + { + return IsFeatureSupported( FeatureId() ); + } +//TVtUiBTVariation +// ----------------------------------------------------------------------------- +// TVtUiBTVariation::FeatureId +// ----------------------------------------------------------------------------- +// +TUint32 TVtUiBTVariation::FeatureId() const + { + return KFeatureIdBt; + } +// ----------------------------------------------------------------------------- +// TVtUiBTVariation::IsBTSupported +// ----------------------------------------------------------------------------- +// +TBool TVtUiBTVariation::IsBTSupported() const + { + return IsFeatureSupported( FeatureId() ); + } +//TVtUiSideVolumeKeysVariation +// ----------------------------------------------------------------------------- +// TVtUiSideVolumeKeysVariation::FeatureId +// ----------------------------------------------------------------------------- +// +TUint32 TVtUiSideVolumeKeysVariation::FeatureId() const + { + return KFeatureIdSideVolumeKeys; + } +// ----------------------------------------------------------------------------- +// TVtUiSideVolumeKeysVariation::IsSideVolumeKeysSupported +// ----------------------------------------------------------------------------- +// +TBool TVtUiSideVolumeKeysVariation::IsSideVolumeKeysSupported() const + { + return IsFeatureSupported( FeatureId() ); + } +//TVtUiActiveIdleFetManVariation +// ----------------------------------------------------------------------------- +// TVtUiActiveIdleFetManVariation::FeatureId +// ----------------------------------------------------------------------------- +// +TUint32 TVtUiActiveIdleFetManVariation::FeatureId() const + { + return KFeatureIdActiveIdle; + } +// ----------------------------------------------------------------------------- +// TVtUiActiveIdleFetManVariation::IsActiveIdleFetManSupported +// ----------------------------------------------------------------------------- +// +TBool TVtUiActiveIdleFetManVariation::IsActiveIdleFetManSupported() const + { + return IsFeatureSupported( FeatureId() ); + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/tvtuiaudiostate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/tvtuiaudiostate.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2006 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: Audio state class. +* +*/ + +#include +#include + +#include "tvtuiaudiostate.h" +#include "VtUiUtility.h" + +// ----------------------------------------------------------------------------- +// TVtUiAudioState::UpdateFlags +// ----------------------------------------------------------------------------- +// +void TVtUiAudioState::UpdateFlags() + { + __VTPRINTENTER( "AudioState.UpdateFlags" ) + TInt avail( 0 ); + + VtUiUtility::GetAudioRoutingAvailability( iModel.Audio(), avail ); + + const TBool videoCallConnected ( iModel.Media().VideoCallConnected()); + //Before update AudioRouting, video call state must to be checked. + //AudioRouting can not be changed if call is not in EConnected state. + if ( videoCallConnected ) + { + __VTPRINT( DEBUG_GEN, " videoCallConnected " ) + if ( avail & VtUiUtility::EDeactivateBtHandsfree ) + { + SetFlag( ECanDeactivateBtHf ); + } + if ( avail & VtUiUtility::EActivateBtHandsfree ) + { + SetFlag( ECanActivateBtHf ); + } + if ( avail & VtUiUtility::EDeactivateLoudspeaker ) + { + SetFlag( ECanDeactivateLoudspeaker ); + } + if ( avail & VtUiUtility::EActivateLoudspeaker ) + { + SetFlag( ECanActivateLoudspeaker ); + } + } + + VtUiUtility::GetOutgoingMediaState( iModel.Media(), avail ); + + if ( avail & MVtEngMedia::EMediaAudio ) + { + SetFlag( EIsAudio ); + } + + TInt status ( 0 ); + iModel.Media().GetMediaState( MVtEngMedia::EMediaOutgoing, status ); + if ( !(status & MVtEngMedia::EMediaAudioChannelOpen ) ) + { + SetFlag( EIsAudioPermanentlyStopped ); + } + + __VTPRINTEXITR( "AudioState.UpdateFlags bits = %b", Value() ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/tvtuilocalvariation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/tvtuilocalvariation.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,181 @@ +/* +* Copyright (c) 2006 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: Video Telephone local variation class. +* +*/ + + +#include +#include +#include + +#include "VideoTelephonyInternalCRKeys.h" +#include "tvtuilocalvariation.h" +#include "tVtuifeaturevariation.h" + +// TVtUiVariationBase + +// ----------------------------------------------------------------------------- +// TVtUiVariationBase::ReadL +// ----------------------------------------------------------------------------- +// +void TVtUiVariationBase::ReadL( const TInt adefault ) + { + __VTPRINTENTER( "VtUi.LocalVariation.ReadL" ) + CRepository* repository = CRepository::NewL( Uid() ); + TInt value( 0 ); + if ( !repository->Get( Key(), value ) ) + { + SetValue( value ); + } + // incase of error + else + { + // If default is set + if ( adefault != -1 ) + { + __VTPRINT2( DEBUG_GEN, "VtUi.LocalVariation.ReadL def=%d", adefault ) + SetValue( adefault ); + } + } + delete repository; + __VTPRINTEXIT( "VtUi.LocalVariation.ReadL" ) + } +// ----------------------------------------------------------------------------- +// TVtUiVariationBase::Value +// ----------------------------------------------------------------------------- +// +TUint32 TVtUiVariationBase::ReceiveValue() const + { + __VTPRINTENTER( "VtUi.LocalVariation.ReceiveValue" ) + __VTPRINTEXIT( "VtUi.LocalVariation.ReceiveValue" ) + return Value(); + } + +// TVtUiVideoTelephonyVariation +// ----------------------------------------------------------------------------- +// TVtUiVideoTelephonyVariation::Uid +// ----------------------------------------------------------------------------- +// +const TUid& TVtUiVideoTelephonyVariation::Uid() const + { + return KCRUidVTVariation; + } + +// ----------------------------------------------------------------------------- +// TVtUiVideoTelephonyVariation::Key +// ----------------------------------------------------------------------------- +// +TUint32 TVtUiVideoTelephonyVariation::Key() const + { + return KVTLocalVariationFlags; + } + +// TVtUiActiveIdleVariation +// ----------------------------------------------------------------------------- +// TVtUiActiveIdleVariation::IsActiveIdleEnabled +// ----------------------------------------------------------------------------- +// +TBool TVtUiActiveIdleVariation::IsActiveIdleEnabled() + { + __VTPRINTENTER( "VtUi.LocalVariation.AI.IsActiveIdleEnabled" ) + #ifndef RD_BOOT_CUSTOMIZABLE_AI + TVtUiActiveIdleFetManVariation featman; + TRAP_IGNORE( ReadL() ); + __VTPRINTEXIT( "VtUi.LocalVariation.AI.IsActiveIdleEnabled" ) + return featman.IsActiveIdleFetManSupported() && Value(); + // AI 2 implementation always true + #else + __VTPRINTEXIT( "VtUi.LocalVariation.AI.IsActiveIdleEnabled" ) + return ETrue; + #endif // RD_BOOT_CUSTOMIZABLE_AI + } + +// ----------------------------------------------------------------------------- +// TVtUiActiveIdleVariation::Uid +// ----------------------------------------------------------------------------- +// +const TUid& TVtUiActiveIdleVariation::Uid() const + { + return KCRUidPersonalizationSettings; + } + +// ----------------------------------------------------------------------------- +// TVtUiActiveIdleVariation::Key +// ----------------------------------------------------------------------------- +// +TUint32 TVtUiActiveIdleVariation::Key() const + { + return KSettingsActiveIdleState; + } + +// TVtUiGsMuteVariation +// ----------------------------------------------------------------------------- +// TVtUiGsMuteVariation::GsMuteState +// ----------------------------------------------------------------------------- +// +TUint32 TVtUiGsMuteVariation::GsMuteState() + { + __VTPRINTENTER( "VtUi.LocalVariation.Gs.GsMuteState" ) + TRAP_IGNORE( ReadL( KAllwaysQuery ) ); + __VTPRINTEXIT( "VtUi.LocalVariation.Gs.GsMuteState" ) + return ReceiveValue(); + } +// ----------------------------------------------------------------------------- +// TVtUiGsMuteVariation::Uid +// ----------------------------------------------------------------------------- +// +const TUid& TVtUiGsMuteVariation::Uid() const + { + return KCRUidTelephonySettings; + } + +// ----------------------------------------------------------------------------- +// TVtUiActiveIdleVariation::Key +// ----------------------------------------------------------------------------- +// +TUint32 TVtUiGsMuteVariation::Key() const + { + return KSettingsVTVideoSending; + } +// TVtUiToolbarVariation +// ----------------------------------------------------------------------------- +// TVtUiToolbarVariation::NumberOfButtons +// ----------------------------------------------------------------------------- +// +TUint32 TVtUiToolbarVariation::NumberOfButtons() + { + __VTPRINTENTER( "VtUi.LocalVariation.Tb.NumberOfButtons" ) + TRAP_IGNORE( ReadL( KNumberOfTbButtons ) ); + __VTPRINTEXIT( "VtUi.LocalVariation.Tb.NumberOfButtons" ) + return ReceiveValue(); + } +// ----------------------------------------------------------------------------- +// TVtUiToolbarVariation::Uid +// ----------------------------------------------------------------------------- +// +const TUid& TVtUiToolbarVariation::Uid() const + { + return KCRUidVTConfiguration; + } + +// ----------------------------------------------------------------------------- +// TVtUiActiveIdleVariation::Key +// ----------------------------------------------------------------------------- +// +TUint32 TVtUiToolbarVariation::Key() const + { + return KVTToolbarCommands; + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/tvtuimediastate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/tvtuimediastate.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2006 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: Media state class. +* +*/ + + +#include +#include +#include + +#include "tvtuimediastate.h" +#include "VtUiUtility.h" + +// ----------------------------------------------------------------------------- +// TVtUiMediaState::UpdateFlags +// ----------------------------------------------------------------------------- +// +void TVtUiMediaState::UpdateFlags() + { + __VTPRINTENTER( "MediaState.UpdateFlags" ) + TInt avail( 0 ); + + VtUiUtility::GetOutgoingMediaState( iMedia, avail ); + + if ( avail & MVtEngMedia::EMediaVideo ) + { + SetFlag( EIsVideo ); + } + + if ( VtUiUtility::HasCameras( iMedia ) ) + { + SetFlag( EHasCamera ); + } + + if ( VtUiUtility::IsFreezeSupported( iMedia ) ) + { + SetFlag( EIsFreezeSupported ); + } + + if ( VtUiUtility::GetFreezeState( iMedia ) ) + { + SetFlag( EIsFrozen ); + } + + MVtEngMedia::TShareObjectState shareObjectState; + VtUiUtility::GetObjectSharingState( iMedia, shareObjectState ); + + if ( shareObjectState == MVtEngMedia::ESharingImage ) + { + SetFlag( EIsSharing ); + } + else if ( ( shareObjectState == MVtEngMedia::EInitializingShareImage ) || + ( shareObjectState == MVtEngMedia::EInitializingShareVideoClip ) ) + { + SetFlag( EIsInitializingShare ); + } + else if ( shareObjectState == MVtEngMedia::ENotAbleToShare ) + { + SetFlag( EIsNotAbleToShare ); + } + // Camera configuration + + MVtEngMedia::TCameraId cameraId; + TInt err = iMedia.GetCurrentCameraId( cameraId ); + + // Don't care if camera is not ready, just what is selected camera + if ( err == KErrNone || err == KErrNotReady ) + { + SetFlag( ( cameraId == MVtEngMedia::EPrimaryCamera ) ? + EIsPrimaryCameraInUse : EIsSecondaryCameraInUse ); + } + + TInt sourcesCaps( 0 ); + iMedia.GetSourcesCaps( sourcesCaps ); + if ( sourcesCaps & MVtEngMedia::ESourceCapsPrimaryCamera ) + { + SetFlag( EHasPrimaryCamera ); + } + if ( sourcesCaps & MVtEngMedia::ESourceCapsSecondaryCamera ) + { + SetFlag( EHasSecondaryCamera ); + } + + TInt status ( 0 ); + iMedia.GetMediaState( MVtEngMedia::EMediaOutgoing, status ); + if ( !( status & MVtEngMedia::EMediaVideoChannelOpen ) ) + { + SetFlag( EIsVideoPermanentlyStopped ); + } + + __VTPRINTEXITR( "MediaState.UpdateFlags bits = %b", Value() ) + + // Video preferences +/* + TInt caps( iCommandHandler.GetCommandCaps( KVtEngSetContrast ) ); + if ( caps & MVtEngCommandHandler::EAttribEnabled ) + { + SetFlag( EIsContrastSupported ); + } + + caps = iCommandHandler.GetCommandCaps( KVtEngSetBrightness ); + if ( caps & MVtEngCommandHandler::EAttribEnabled ) + { + SetFlag( EIsBrightnessSupported ); + } + + caps = iCommandHandler.GetCommandCaps( KVtEngSetWhiteBalance ); + if ( caps & MVtEngCommandHandler::EAttribEnabled ) + { + SetFlag( EIsWhiteBalanceSupported ); + } + + caps = iCommandHandler.GetCommandCaps( KVtEngSetColorTone ); + if ( caps & MVtEngCommandHandler::EAttribEnabled ) + { + SetFlag( EIsColorToneSupported ); + } + +*/ + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/commands/tvtuistates.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/commands/tvtuistates.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 2006 - 2008 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: Video UI states class. +* +*/ + + +#include +#include +#include + +#include "tvtuistates.h" + +// ----------------------------------------------------------------------------- +// TVtUiStates::TVtUiStates +// ----------------------------------------------------------------------------- +// +TVtUiStates::TVtUiStates( CVtEngModel& aModel ) + : iMediaState( aModel.Media(), aModel.CommandHandler() ), iAudioState( aModel ), + iModel( aModel ), iExecState( EExecStateStarting), + iCommandActivatingRefCount( 0 ) + { + // get camera preferences + iCameraPref = static_cast + ( iModel.Extension( KVtEngExtensionCameraPreferences ) ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::Update +// ----------------------------------------------------------------------------- +// +void TVtUiStates::Update() + { + iMediaState.Update(); + iAudioState.Update(); + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsColorToneSettingAvailable +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsColorToneSettingAvailable() const + { + __VTPRINTENTER( "TVtUiStates.IsColorToneSettingAvailable" ) + TUint32 supportedModes; + // Get supported whitebalance modes + if ( iCameraPref ) + { + if ( iCameraPref->GetSupportedColorTones( supportedModes ) ) + { + // error occured + __VTPRINTEXIT( "TVtUiStates.IsColorToneSettingAvailableErr" ) + return EFalse; + } + } + + // Clean the flag, flags that are possible are + // A bitfield of suported colortones + // ENormal = 0x00, + // ESepia = 0x01, + // EGrayscale = 0x02, + // ENegative = 0x04 + supportedModes &= 0x07; + + // If supported modes is 0 automatic,then return EFalse + return supportedModes; + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsWhiteBalanceSettingAvailable +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsWhiteBalanceSettingAvailable() const + { + __VTPRINTENTER( "TVtUiStates.IsWhiteBalanceSettingAvailable" ) + TUint32 supportedModes; + // Get supported whitebalance modes + if ( iCameraPref ) + { + if ( iCameraPref->GetSupportedWhiteBalanceModes( supportedModes ) ) + { + // error occured + __VTPRINTEXIT( "TVtUiStates.IsWhiteBalanceSettingAvailableErr" ) + return EFalse; + } + } + __VTPRINT2( DEBUG_GEN, "IsWhiteBalanceSettingAvailable=%d", supportedModes ) + // If supported modes is 0 ,then return EFalse + __VTPRINTEXIT( "TVtUiStates.IsWhiteBalanceSettingAvailable2" ) + return supportedModes; + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsContrastSettingAvailable +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsContrastSettingAvailable() const + { + __VTPRINTENTER( "TVtUiStates.IsContrastSettingAvailable" ) + TBool ret( ETrue ); + if ( iCameraPref ) + { + TInt temp; + ret = !iCameraPref->GetContrast( temp ); + } + return ret; + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::IsBrightnessSettingAvailable +// ----------------------------------------------------------------------------- +// +TBool TVtUiStates::IsBrightnessSettingAvailable() const + { + __VTPRINTENTER( "TVtUiStates.IsBrightnessSettingAvailable" ) + TBool ret( ETrue ); + if ( iCameraPref ) + { + TInt temp; + ret = !iCameraPref->GetBrightness( temp ); + } + return ret; + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetExecState +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetExecState( const TVtUiExecState aState ) + { + iExecState = aState; + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::SetIsCommandActivating +// ----------------------------------------------------------------------------- +// +void TVtUiStates::SetIsCommandActivating( TBool aSet ) + { + if ( aSet ) + { + iCommandActivatingRefCount++; + } + else if ( iCommandActivatingRefCount > 0 ) + { + iCommandActivatingRefCount--; + } + } + +// ----------------------------------------------------------------------------- +// TVtUiStates::ExecState +// ----------------------------------------------------------------------------- +// +TVtUiStates::TVtUiExecState TVtUiStates::ExecState() const + { + return iExecState; + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/compman/cvtuicomponentmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/compman/cvtuicomponentmanager.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,777 @@ +/* +* 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: Component manager implementation. +* +*/ + + +#include + +#include "cvtuicomponentmanager.h" +#include "mvtuiwindowservereventobserver.h" +#include "mvtuiresourcechangeobserver.h" +#include "mvtuikeyeventobserver.h" +#include "mvtuilayoutchangeobserver.h" + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CmpByPtr +// --------------------------------------------------------------------------- +// +template < class T > +TInt CmpByPtr( const T& aObj1, const T& aObj2 ) + { + return reinterpret_cast< TInt >( &aObj1 ) - + reinterpret_cast< TInt >( &aObj2 ); + } + +// --------------------------------------------------------------------------- +// FindByPtr +// --------------------------------------------------------------------------- +// +template < class T > +TInt FindByPtr( const TInt* aPtr, const T& aObj ) + { + return *aPtr - reinterpret_cast< TInt >( &aObj ); + } + +// --------------------------------------------------------------------------- +// CmpMVtUiComponent +// --------------------------------------------------------------------------- +// +TInt CmpMVtUiComponent( const MVtUiComponent& aC1, const MVtUiComponent& aC2 ) + { + return ( aC1.ComponentId() - aC2.ComponentId() ); + } + +// --------------------------------------------------------------------------- +// CmpTVtUiComponentState +// --------------------------------------------------------------------------- +// +TInt CmpTVtUiComponentState( const TVtUiComponentState& aC1, + const TVtUiComponentState& aC2 ) + { + return ( aC1.Component().ComponentId() - aC2.Component().ComponentId() ); + } + +// --------------------------------------------------------------------------- +// CmpTVtUiComponentStateByKey +// --------------------------------------------------------------------------- +// +TInt CmpTVtUiComponentStateByKey( const MVtUiComponent::TComponentId* aKey, + const TVtUiComponentState& aC ) + { + return ( *aKey - aC.Component().ComponentId() ); + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::NewL +// --------------------------------------------------------------------------- +// +CVtUiComponentManager* CVtUiComponentManager::NewL() + { + __VTPRINTENTER( "CompMgr.NewL" ) + CVtUiComponentManager* self = new ( ELeave ) CVtUiComponentManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "CompMgr.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::~CVtUiComponentManager +// --------------------------------------------------------------------------- +// +CVtUiComponentManager::~CVtUiComponentManager() + { + __VTPRINTENTER( "CompMgr.~" ) + iWsEventObservers.Close(); + iResourceChangeObservers.Close(); + iKeyEventObservers.Close(); + iLayoutChangeObservers.Close(); + iComponents.Close(); + __VTPRINTEXIT( "CompMgr.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::HandleWsEventL +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ) + { + for ( TInt i = iWsEventObservers.Count() - 1; i >= 0; i-- ) + { + iWsEventObservers[ i ]->HandleWsEventL( aEvent, aDestination ); + } + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::HandleResourceChangeL +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::HandleResourceChangeL( TInt aType ) + { + for ( TInt i = iResourceChangeObservers.Count() - 1; i >= 0; i-- ) + { + iResourceChangeObservers[ i ]->HandleResourceChangeL( aType ); + } + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager:OfferKeyEventL +// --------------------------------------------------------------------------- +// +TKeyResponse CVtUiComponentManager::OfferKeyEventL( + const TKeyEvent& aEvent, TEventCode aCode ) + { + TKeyResponse response( EKeyWasNotConsumed ); + for ( TInt i = iKeyEventObservers.Count() - 1; i >= 0; i-- ) + { + response = iKeyEventObservers[ i ]->OfferKeyEventL( aEvent, aCode ); + if ( response == EKeyWasConsumed ) + { + break; + } + } + return response; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::HandleLayoutChangeL +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::HandleLayoutChangeL() + { + for ( TInt i = iLayoutChangeObservers.Count() - 1; i >= 0; i-- ) + { + iLayoutChangeObservers[ i ]->HandleLayoutChangeL(); + } + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::ChangeWsEventRegistration +// --------------------------------------------------------------------------- +// +TInt CVtUiComponentManager::ChangeWsEventRegistration( + MVtUiWindowServerEventObserver& aObserver, TAction aAction ) + { + return AddOrRemoveComponent( iWsEventObservers, &aObserver, aAction ); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::ChangeResourceChangeRegistration +// --------------------------------------------------------------------------- +// +TInt CVtUiComponentManager::ChangeResourceChangeRegistration( + MVtUiResourceChangeObserver& aObserver, TAction aAction ) + { + return AddOrRemoveComponent( iResourceChangeObservers, &aObserver, + aAction ); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::ChangeKeyEventRegistration +// --------------------------------------------------------------------------- +// +TInt CVtUiComponentManager::ChangeKeyEventRegistration( + MVtUiKeyEventObserver& aObserver, TAction aAction ) + { + return AddOrRemoveComponent( iKeyEventObservers, &aObserver, aAction ); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::ChangeLayoutChangeRegistration +// --------------------------------------------------------------------------- +// +TInt CVtUiComponentManager::ChangeLayoutChangeRegistration( + MVtUiLayoutChangeObserver& aObserver, TAction aAction ) + { + return AddOrRemoveComponent( iLayoutChangeObservers, &aObserver, aAction ); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::ChangeComponentRegistration +// --------------------------------------------------------------------------- +// +TInt CVtUiComponentManager::ChangeComponentRegistration( + TVtUiComponentState& aComponentState, TAction aAction ) + { + __VTPRINTENTER( "CompMgr.ChangeComponentRegistrationL" ) + TInt result( KErrNone ); + if ( aAction == ERegister ) + { + result = + iComponents.InsertInOrder( &aComponentState, + ComponentStateOrder() ); + } + else + { + TInt index( iComponents.FindInOrder( + &aComponentState, ComponentStateOrder() ) ); + if ( index != KErrNotFound ) + { + iComponents.Remove( index ); + } + } + __VTPRINTEXITR( "CompMgr.ChangeComponentRegistrationL %d", result ) + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::RequestActivationL +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::RequestActivationL( + MVtUiComponent::TComponentId aId ) + { + __VTPRINTENTER( "CompMgr.RequestActivationL" ) + TInt index( iComponents.FindInOrder( aId, ::CmpTVtUiComponentStateByKey ) ); + if ( index == KErrNotFound ) + { + User::Leave( index ); + } + else + { + TVtUiComponentState& state( *iComponents[ index ] ); + if ( state.State() == TVtUiComponentState::EActive ) + { + User::Leave( KErrNotReady ); + } + else + { + DoActivationL( state, TVtUiComponentState::EActive ); + } + } + __VTPRINTEXIT( "CompMgr.RequestActivationL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::DeActivateComponentL +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::DeActivateComponentL( + MVtUiComponent::TComponentId aId ) + { + __VTPRINTENTER( "CompMgr.DeActivateComponentL" ) + TInt index( iComponents.FindInOrder( aId, ::CmpTVtUiComponentStateByKey ) ); + if ( index == KErrNotFound ) + { + User::Leave( index ); + } + else + { + TVtUiComponentState& state( *iComponents[ index ] ); + if ( state.State() == TVtUiComponentState::EInactive ) + { + User::Leave( KErrNotReady ); + } + else + { + DoDeactivationL( state, TVtUiComponentState::EInactive ); + } + } + __VTPRINTEXIT( "CompMgr.DeActivateComponentL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::DoActivationL +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::DoActivationL( + TVtUiComponentState& aComponentState, + TVtUiComponentState::TState aNewState ) + { + __VTPRINTENTER( "CompMgr.DoActivationL" ) + TStateList stateList; + ConstructStateListL( stateList ); + TInt index( stateList.FindItem( + aComponentState.Component().ComponentId() ) ); + if ( index != KErrNotFound ) + { + TStateListItem& sli( stateList.At( index ) ); + TVtUiBlockListBitField exclList; + for ( TInt i = stateList.ItemCount() - 1; i >= 0; i-- ) + { + TStateListItem& sli2( stateList.At( i ) ); + if ( sli2.ComponentId() != sli.ComponentId() ) + { + if ( sli2.State() == TVtUiComponentState::EActive && + !sli.BlockList().Contains( sli2.ComponentId() ) ) + { + exclList.Union( sli2.BlockList() ); + } + } + } + sli.SetRoot(); + sli.SetState( aNewState ); + CalculateActivationL( sli.BlockList(), exclList, stateList, EHide ); + } + CommitStateListL( stateList ); + __VTPRINTEXIT( "CompMgr.DoActivationL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::DoDeactivationL +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::DoDeactivationL( + TVtUiComponentState& aComponentState, + TVtUiComponentState::TState aNewState ) + { + __VTPRINTENTER( "CompMgr.DoDeactivationL" ) + TStateList stateList; + ConstructStateListL( stateList ); + TInt index( stateList.FindItem( + aComponentState.Component().ComponentId() ) ); + if ( index != KErrNotFound ) + { + TStateListItem& sli( stateList.At( index ) ); + TVtUiBlockListBitField exclList; + if ( sli.State() == TVtUiComponentState::EActive ) + { + for ( TInt i = stateList.ItemCount() - 1; i >= 0; i-- ) + { + TStateListItem& sli2( stateList.At( i ) ); + if ( sli2.ComponentId() != sli.ComponentId() ) + { + if ( sli2.State() == TVtUiComponentState::EActive ) + { + exclList.Union( sli2.BlockList() ); + } + } + } + } + sli.SetRoot(); + sli.SetState( aNewState ); + CalculateActivationL( sli.BlockList(), exclList, stateList, EShow ); + } + CommitStateListL( stateList ); + __VTPRINTEXIT( "CompMgr.DoDeactivationL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::CommitStateListL +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::CommitStateListL( TStateList& aList ) + { + __VTPRINTENTER( "CompMgr.CommitStateListL" ) + // Sort list by component state. Components will first deactivated, then + // blocked and finally activated. + aList.Sort( TStateListItem::StateOrder() ); + for ( TInt i = 0; i < aList.ItemCount(); i++ ) + { + const TStateListItem& sli( aList.At( i ) ); + TInt index( iComponents.FindInOrder( sli.ComponentId(), + ::CmpTVtUiComponentStateByKey ) ); + if ( index != KErrNotFound ) + { + TVtUiComponentState& cs( *iComponents[ index ] ); + if ( cs.State() != sli.State() ) + { + switch ( sli.State() ) + { + case TVtUiComponentState::EInactive: + cs.DeActivateComponentL(); + break; + + case TVtUiComponentState::EActive: + cs.ActivateComponentL(); + break; + + case TVtUiComponentState::EWaiting: + cs.BlockComponentL(); + break; + + default: + User::Leave( KErrArgument ); + break; + } + } + } + } + __VTPRINTEXIT( "CompMgr.CommitStateListL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::CalculateActivationL +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::CalculateActivationL( + const TVtUiBlockList& aBlockList, + const TVtUiBlockList& aExclList, + TStateList& aStateList, TActivationAction aAction ) + { + __VTPRINTENTER( "CompMgr.CalculateActivationL" ) + __VTPRINT2( DEBUG_GEN, "aAction = %d", (TInt)aAction ) + TVtUiBlockListBitField blockList; + CVtUiBlockListIterator* iterator = aBlockList.IteratorLC(); + while ( iterator->HasNext() ) + { + MVtUiComponent::TComponentId cid( iterator->Next() ); + if ( aExclList.Contains( cid ) ) + { + continue; + } + TInt index( aStateList.FindItem( cid ) ); + if ( index != KErrNotFound ) + { + TStateListItem& sli( aStateList.At( index ) ); + __VTPRINT3( DEBUG_GEN, "@1, Id = %d, state = %d", (TInt)sli.ComponentId(), (TInt)sli.State() ) + if ( !sli.IsRoot() ) + { + if ( aAction == EShow ) + { + // if action == EShow and component is being blocked, + // then activate component + if ( sli.State() == TVtUiComponentState::EWaiting ) + { + sli.SetState( TVtUiComponentState::EActive ); + if ( !sli.IsVisited() ) + { + blockList.Union( sli.BlockList() ); + } + sli.SetVisited(); + } + } + else // aAction == EHide + { + // if action == EHide and component is active, then + // block component + if ( sli.State() == TVtUiComponentState::EActive ) + { + sli.SetState( TVtUiComponentState::EWaiting ); + if ( !sli.IsVisited() ) + { + blockList.Union( sli.BlockList() ); + } + sli.SetVisited(); + } + } + } + __VTPRINT3( DEBUG_GEN, "@2, Id = %d, state = %d", (TInt)sli.ComponentId(), (TInt)sli.State() ) + } + } + CleanupStack::PopAndDestroy(); // iterator + if ( !blockList.IsEmpty() ) + { + CalculateActivationL( blockList, aExclList, aStateList, + ( aAction == EShow ) ? EHide : EShow ); + } + __VTPRINTEXIT( "CompMgr.CalculateActivationL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::ConstructStateListL +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::ConstructStateListL( TStateList& aList ) + { + for ( TInt i = iComponents.Count() - 1; i >= 0; i-- ) + { + TStateListItem sli( *iComponents[ i ] ); + aList.AddItemL( sli ); + } + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::CVtUiComponentManager +// --------------------------------------------------------------------------- +// +CVtUiComponentManager::CVtUiComponentManager() + : iWsEventObservers( 1 ), iResourceChangeObservers( 1 ), + iKeyEventObservers( 1 ),iLayoutChangeObservers( 1 ), iComponents( 1 ) + { + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::AddOrRemoveComponent +// --------------------------------------------------------------------------- +// +template < class T > +TInt CVtUiComponentManager::AddOrRemoveComponent( RPointerArray< T >& aArray, + T* aComponent, TAction aAction ) + { + __VTPRINTENTER( "CompMgr.AddOrRemoveComponent" ) + TInt result( KErrNone ); + if ( aAction == ERegister ) + { + result = aArray.InsertInOrder( aComponent, ::CmpByPtr ); + } + else + { + TInt index( aArray.FindInOrder( aComponent, ::CmpByPtr ) ); + if ( index != KErrNotFound ) + { + aArray.Remove( index ); + } + } + __VTPRINTEXITR( "CompMgr.AddOrRemoveComponent %d", result ) + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::ComponentOrder +// --------------------------------------------------------------------------- +// +TLinearOrder< MVtUiComponent > CVtUiComponentManager::ComponentOrder() + { + return TLinearOrder< MVtUiComponent >( ::CmpMVtUiComponent ); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::ComponentStateOrder +// --------------------------------------------------------------------------- +// +TLinearOrder< TVtUiComponentState > CVtUiComponentManager::ComponentStateOrder() + { + return TLinearOrder< TVtUiComponentState >( ::CmpTVtUiComponentState ); + } + +// Implementation of CVtUiComponentManager::TStateListItem + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::TStateListItem +// --------------------------------------------------------------------------- +// +CVtUiComponentManager::TStateListItem::TStateListItem( + const TVtUiComponentState& aState ) + : iComponentId( aState.Component().ComponentId() ), + iState( aState.State() ), iIsRoot( EFalse ), iIsVisited( EFalse ) + { + iBlockList.Union( aState.BlockList() ); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::ComponentId +// --------------------------------------------------------------------------- +// +MVtUiComponent::TComponentId +CVtUiComponentManager::TStateListItem::ComponentId() const + { + return iComponentId; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::State +// --------------------------------------------------------------------------- +// +TVtUiComponentState::TState CVtUiComponentManager::TStateListItem::State() const + { + return iState; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::SetState +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::TStateListItem::SetState( + TVtUiComponentState::TState aState ) + { + iState = aState; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::BlockList +// --------------------------------------------------------------------------- +// +const TVtUiBlockList& CVtUiComponentManager::TStateListItem::BlockList() const + { + return iBlockList; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::SetRoot +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::TStateListItem::SetRoot() + { + iIsRoot = ETrue; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::IsRoot +// --------------------------------------------------------------------------- +// +TBool CVtUiComponentManager::TStateListItem::IsRoot() const + { + return iIsRoot; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::SetVisited +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::TStateListItem::SetVisited() + { + iIsVisited = ETrue; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::IsVisited +// --------------------------------------------------------------------------- +// +TBool CVtUiComponentManager::TStateListItem::IsVisited() const + { + return iIsVisited; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::KeyOrder +// --------------------------------------------------------------------------- +// +CVtUiComponentManager::TStateListItem::TKeyCmpFunc +CVtUiComponentManager::TStateListItem::KeyOrder() + { + return KeyCmpFunc; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::LinearOrder +// --------------------------------------------------------------------------- +// +TLinearOrder< CVtUiComponentManager::TStateListItem > +CVtUiComponentManager::TStateListItem::LinearOrder() + { + return TLinearOrder< TStateListItem >( ItemCmpFunc ); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::StateOrder +// --------------------------------------------------------------------------- +// +TLinearOrder< CVtUiComponentManager::TStateListItem > +CVtUiComponentManager::TStateListItem::StateOrder() + { + return TLinearOrder< TStateListItem >( StateCmpFunc ); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::ItemCmpFunc +// --------------------------------------------------------------------------- +// +TInt CVtUiComponentManager::TStateListItem::ItemCmpFunc( + const TStateListItem& aItem1, const TStateListItem& aItem2 ) + { + return ( aItem1.ComponentId() - aItem2.ComponentId() ); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::KeyCmpFunc +// --------------------------------------------------------------------------- +// +TInt CVtUiComponentManager::TStateListItem::KeyCmpFunc( + const MVtUiComponent::TComponentId* aKey, const TStateListItem& aItem ) + { + return ( *aKey - aItem.ComponentId() ); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateListItem::StateCmpFunc +// --------------------------------------------------------------------------- +// +TInt CVtUiComponentManager::TStateListItem::StateCmpFunc( + const TStateListItem& aItem1, const TStateListItem& aItem2 ) + { + return ( aItem1.State() - aItem2.State() ); + } +// Implementation of CVtUiComponentManager::TStateList + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateList::TStateList +// --------------------------------------------------------------------------- +// +CVtUiComponentManager::TStateList::TStateList() : iItems( 1 ) + { + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateList::~TStateList +// --------------------------------------------------------------------------- +// +CVtUiComponentManager::TStateList::~TStateList() + { + iItems.Close(); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateList::AddItemL +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::TStateList::AddItemL( TStateListItem& aItem ) + { + iItems.InsertInOrderL( aItem, TStateListItem::LinearOrder() ); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateList::ItemCount +// --------------------------------------------------------------------------- +// +TInt CVtUiComponentManager::TStateList::ItemCount() const + { + return iItems.Count(); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateList::FindItem +// --------------------------------------------------------------------------- +// +TInt CVtUiComponentManager::TStateList::FindItem( + MVtUiComponent::TComponentId aComponentId ) const + { + return iItems.FindInOrder( aComponentId, TStateListItem::KeyOrder() ); + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateList::At +// --------------------------------------------------------------------------- +// +CVtUiComponentManager::TStateListItem& +CVtUiComponentManager::TStateList::At( TInt aIndex ) + { + return iItems[ aIndex ]; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateList::At +// --------------------------------------------------------------------------- +// +const CVtUiComponentManager::TStateListItem& +CVtUiComponentManager::TStateList::At( TInt aIndex ) const + { + return iItems[ aIndex ]; + } + +// --------------------------------------------------------------------------- +// CVtUiComponentManager::TStateList::Sort +// --------------------------------------------------------------------------- +// +void CVtUiComponentManager::TStateList::Sort( + TLinearOrder< CVtUiComponentManager::TStateListItem > aOrder ) + { + iItems.Sort( aOrder ); + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/compman/tvtuiblocklists.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/compman/tvtuiblocklists.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2006 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: Component ID block lists implementation. +* +*/ + + +#include "tvtuiblocklists.h" + +const static TUint KNullBlockMask = 0; + +// Implementation for TVtUiBlockList + +// ----------------------------------------------------------------------------- +// TVtUiBlockList::~TVtUiBlockList +// ----------------------------------------------------------------------------- +// +TVtUiBlockList::~TVtUiBlockList() + { + } + +// ----------------------------------------------------------------------------- +// TVtUiBlockList::TVtUiBlockList +// ----------------------------------------------------------------------------- +// +TVtUiBlockList::TVtUiBlockList() + { + } + +// Implementation for TVtUiBlockListBitField + +// ----------------------------------------------------------------------------- +// TVtUiBlockListBitField::TVtUiBlockListBitField +// ----------------------------------------------------------------------------- +// +TVtUiBlockListBitField::TVtUiBlockListBitField() : iBlockMask( KNullBlockMask ) + { + } + +// ----------------------------------------------------------------------------- +// TVtUiBlockListBitField::TVtUiBlockListBitField +// ----------------------------------------------------------------------------- +// +TVtUiBlockListBitField::TVtUiBlockListBitField( TUint aBlockMask ) + : iBlockMask( aBlockMask ) + { + } + +// ----------------------------------------------------------------------------- +// TVtUiBlockListBitField::IsEmpty +// ----------------------------------------------------------------------------- +// +TBool TVtUiBlockListBitField::IsEmpty() const + { + return !iBlockMask; + } + +// ----------------------------------------------------------------------------- +// TVtUiBlockListBitField::Contains +// ----------------------------------------------------------------------------- +// +TBool TVtUiBlockListBitField::Contains( MVtUiComponent::TComponentId aId ) const + { + return ( iBlockMask & aId ) && ( aId != MVtUiComponent::EComponentIdNull ); + } + +// ----------------------------------------------------------------------------- +// TVtUiBlockListBitField::Union +// ----------------------------------------------------------------------------- +// +void TVtUiBlockListBitField::Union( const TVtUiBlockList& aBlockList ) + { + iBlockMask |= + static_cast< const TVtUiBlockListBitField& >( aBlockList ).iBlockMask; + } + +// ----------------------------------------------------------------------------- +// TVtUiBlockListBitField::IteratorLC +// ----------------------------------------------------------------------------- +// +CVtUiBlockListIterator* TVtUiBlockListBitField::IteratorLC() const + { + return TVtUiBlockListBitField::CVtUiBListIteratorBF::NewLC( iBlockMask ); + } + +// Implementation for TVtUiBlockListBitField::CVtUiBListIteratorBF + +// ----------------------------------------------------------------------------- +// TVtUiBlockListBitField::CVtUiBListIteratorBF::NewLC +// ----------------------------------------------------------------------------- +// +TVtUiBlockListBitField::CVtUiBListIteratorBF* +TVtUiBlockListBitField::CVtUiBListIteratorBF::NewLC( + const TUint& aBlockMask ) + { + CVtUiBListIteratorBF* self = new ( ELeave ) + CVtUiBListIteratorBF( aBlockMask ); + CleanupStack::PushL( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// TVtUiBlockListBitField::CVtUiBListIteratorBF::CVtUiBListIteratorBF +// ----------------------------------------------------------------------------- +// +TVtUiBlockListBitField::CVtUiBListIteratorBF::CVtUiBListIteratorBF( + const TUint& aBlockMask ) : iBlockMask( aBlockMask ), iCurrent( 1 ) + { + } + +// ----------------------------------------------------------------------------- +// TVtUiBlockListBitField::CVtUiBListIteratorBF::HasNext +// ----------------------------------------------------------------------------- +// +TBool TVtUiBlockListBitField::CVtUiBListIteratorBF::HasNext() const + { + return ( iCurrent && ( iCurrent <= iBlockMask ) ); + } + +// ----------------------------------------------------------------------------- +// TVtUiBlockListBitField::CVtUiBListIteratorBF::Next +// ----------------------------------------------------------------------------- +// +MVtUiComponent::TComponentId +TVtUiBlockListBitField::CVtUiBListIteratorBF::Next() + { + MVtUiComponent::TComponentId id( MVtUiComponent::EComponentIdNull ); + + while ( HasNext() && !( iCurrent & iBlockMask ) ) + { + iCurrent <<= 1; + } + + if ( iCurrent ) + { + id = static_cast< MVtUiComponent::TComponentId >( iCurrent ); + } + + iCurrent <<= 1; + + return id; + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/compman/tvtuicomponentstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/compman/tvtuicomponentstate.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2006 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: Component state base class. +* +*/ + + +#include + +#include "tvtuicomponentstate.h" + +// ----------------------------------------------------------------------------- +// TVtUiComponentState::ActivateComponentL +// ----------------------------------------------------------------------------- +// +void TVtUiComponentState::ActivateComponentL() + { + __VTPRINTENTER( "CompState.ActivateComponentL" ) + iComponent.DoActivateL(); + iState = EActive; + __VTPRINTEXITR( "CompState.ActivateComponentL %d", iState ) + } + +// ----------------------------------------------------------------------------- +// TVtUiComponentState::BlockComponentL +// ----------------------------------------------------------------------------- +// +void TVtUiComponentState::BlockComponentL() + { + __VTPRINTENTER( "CompState.BlockComponentL" ) + iComponent.DoDeactivateL(); + iState = EWaiting; + __VTPRINTEXITR( "CompState.BlockComponentL %d", iState ) + } + +// ----------------------------------------------------------------------------- +// TVtUiComponentState::DeActivateComponentL +// ----------------------------------------------------------------------------- +// +void TVtUiComponentState::DeActivateComponentL() + { + __VTPRINTENTER( "CompState.DeActivateComponentL" ) + iComponent.DoDeactivateL(); + iState = EInactive; + __VTPRINTEXITR( "CompState.DeActivateComponentL %d", iState ) + } + +// ----------------------------------------------------------------------------- +// TVtUiComponentState::State +// ----------------------------------------------------------------------------- +// +TVtUiComponentState::TState TVtUiComponentState::State() const + { + return iState; + } + +// ----------------------------------------------------------------------------- +// TVtUiComponentState::Component +// ----------------------------------------------------------------------------- +// +const MVtUiComponent& TVtUiComponentState::Component() const + { + return iComponent; + } + +// ----------------------------------------------------------------------------- +// TVtUiComponentState::BlockMask +// ----------------------------------------------------------------------------- +// +const TVtUiBlockList& TVtUiComponentState::BlockList() const + { + return iBlockList; + } + +// ----------------------------------------------------------------------------- +// TVtUiComponentState::BlockMask +// ----------------------------------------------------------------------------- +// +TVtUiBlockList& TVtUiComponentState::BlockList() + { + return iBlockList; + } + +// ----------------------------------------------------------------------------- +// TVtUiComponentState::InformDeactivation +// ----------------------------------------------------------------------------- +// +TVtUiComponentState::TVtUiComponentState( MVtUiComponent& aComponent, + const TVtUiBlockList& aBlockList ) + : iComponent( aComponent ), iState( EInactive ) + { + __VTPRINTENTER( "CompState.ctor" ) + + if( MVtUiComponent::EComponentIdToolbar == iComponent.ComponentId() ) + return; + + iBlockList.Union( aBlockList ); + __VTPRINTEXIT( "CompState.ctor" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/cvtuiappshutter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/cvtuiappshutter.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,257 @@ +/* +* Copyright (c) 2007 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: Class responsible for application exit. +* +*/ + + +#include "cvtuiappshutter.h" +#include "mvtuishutterobserver.h" +#include "mvtuistatecontext.h" +#include "mvtuinumbersource.h" +#include "tvtuilocalvariation.h" +#include +#include +#include +#include +#include + +// singleton instance +static CVtUiAppShutter* iAppShutter = NULL; + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::InstanceL +// ----------------------------------------------------------------------------- +// +CVtUiAppShutter* CVtUiAppShutter::InstanceL( + MVtUiShutterObserver& aObserver ) + { + __VTPRINTENTER( "CVtUiAppShutter.InstanceL" ) + if ( iAppShutter == NULL ) + { + iAppShutter = new ( ELeave ) + CVtUiAppShutter( aObserver ); + } + __VTPRINTEXIT( "CVtUiAppShutter.InstanceL" ) + return iAppShutter; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::CVtUiAppShutter +// ----------------------------------------------------------------------------- +// +CVtUiAppShutter::CVtUiAppShutter( + MVtUiShutterObserver& aObserver ) : + iPendingStateFlags( 0 ), + iObserver( aObserver ) + { + iPendingStateFlags.Set( EShutterWaitingStart ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::~CVtUiAppShutter +// ----------------------------------------------------------------------------- +// +CVtUiAppShutter::~CVtUiAppShutter() + { + __VTPRINTENTER( "CVtUiAppShutter.~" ) + // mark singleton null + iAppShutter = NULL; + delete iCallback; + __VTPRINTEXIT( "CVtUiAppShutter.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::StartShutdown +// Called when application may exit, i.e TVtUiStateResetting state receives +// ShutdownDoneL message. +// ----------------------------------------------------------------------------- +// +void CVtUiAppShutter::StartShutdown() + { + __VTPRINTENTER( "CVtUiAppShutter.StartShutdown" ) + iPendingStateFlags.Clear( EShutterWaitingStart ); + ShutdownIfReadyAndDestroy(); + __VTPRINTEXITR( "CVtUiAppShutter.StartShutdown flags %d", + iPendingStateFlags.Value() ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::ShutdownWithEmergencyCallL +// ----------------------------------------------------------------------------- +// +void CVtUiAppShutter::ShutdownWithEmergencyCallL( + MVtUiStateContext& aStateContext ) + { + // Leaves if other than emergency number is supplied... + CEmergencyCaller* emergency = CEmergencyCaller::DialEmergencyL( *this, + aStateContext ); + // therefore the flag and member variable must not be set before above call. + iPendingStateFlags.Set( EShutterWaitingEmergencyCallback ); + iEmergencyCaller = emergency; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::EmergencyCallDoneL +// ----------------------------------------------------------------------------- +// +void CVtUiAppShutter::EmergencyCallDoneL() + { + // Destruction of emergency handler is done asynchrounously to avoid + // problems that might + iPendingStateFlags.Clear( EShutterWaitingEmergencyCallback ); + TCallBack cb( EmergencyResponseCallback, this ); + EnqueCallbackL( cb ); + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::EmergencyResponseCallback +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppShutter::EmergencyResponseCallback( TAny* aAny ) + { + CVtUiAppShutter* shutter = + reinterpret_cast( aAny ); + // delete callback + delete shutter->iCallback; + shutter->iCallback = NULL; + // delete emergency caller + delete shutter->iEmergencyCaller; + shutter->iEmergencyCaller = NULL; + + shutter->ShutdownIfReadyAndDestroy(); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::EnqueCallbackL +// ----------------------------------------------------------------------------- +// +void CVtUiAppShutter::EnqueCallbackL( TCallBack& aCallback ) + { + __VTPRINTENTER( "CVtUiAppShutter.EnqueAsyncCommsCommandL" ) + if ( !iCallback ) + { + iCallback = new ( ELeave ) CAsyncCallBack( aCallback, EPriorityHigh ); + } + iCallback->Call(); + __VTPRINTEXIT( "CVtUiAppShutter.EnqueAsyncCommsCommandL" ) + __VTPRINTEXIT( "CVtUiAppShutter.EnqueCallbackL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::ShutdownIfReadyAndDestroy +// ----------------------------------------------------------------------------- +// +void CVtUiAppShutter::ShutdownIfReadyAndDestroy() + { + __VTPRINTENTER( "CVtUiAppShutter.ShutdownIfReadyAndDestroy" ) + __VTPRINT2( DEBUG_GEN, " shutter flags %d", + iPendingStateFlags.Value() ); + if ( !iPendingStateFlags.Value() ) + { + iObserver.HandleShutdownReady(); + delete this; + } + __VTPRINTEXIT( "CVtUiAppShutter.ShutdownIfReadyAndDestroy" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::CEmergencyCaller::DialEmergencyL +// ----------------------------------------------------------------------------- +// +CVtUiAppShutter::CEmergencyCaller* CVtUiAppShutter::CEmergencyCaller:: + DialEmergencyL( + CVtUiAppShutter& aObserver, + MVtUiStateContext& aStateContext ) + { + __VTPRINTENTER( "CEmergencyCaller.DialEmergencyL" ) + CVtUiAppShutter::CEmergencyCaller* self = new ( ELeave ) + CVtUiAppShutter::CEmergencyCaller( aObserver, aStateContext ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + __VTPRINTEXIT( "CEmergencyCaller.DialEmergencyL" ) + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::CEmergencyCaller::ConstructL +// ----------------------------------------------------------------------------- +// +void CVtUiAppShutter::CEmergencyCaller::ConstructL() + { + __VTPRINTENTER( "CEmergencyCaller.ConstructL" ) + const MVtUiNumberSource* source = iStateContext.NumberSource(); + if ( source ) + { + source->GetContents( iNumber ); + AknTextUtils::ConvertDigitsTo( iNumber, EDigitTypeWestern ); + User::LeaveIfError( iServer.Connect() ); + iEmergency = CPhCltEmergencyCall::NewL( this ); + TBool isEmergenyNumber = EFalse; + const TInt err = + iEmergency->FindEmergencyPhoneNumber( iNumber, isEmergenyNumber ); + + if ( err == KErrNone && isEmergenyNumber ) + { + __VTPRINT( DEBUG_GEN, "iEmergency->DialEmergencyCallL") + iEmergency->DialEmergencyCallL( iNumber ); + } + if ( !isEmergenyNumber || err ) + { + __VTPRINT( DEBUG_GEN, " not EC number => leave" ) + // Not an emergency call number. Abort emergency call process. + User::Leave( KErrArgument ); + } + } + __VTPRINTEXIT( "CEmergencyCaller.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::CEmergencyCaller::CEmergencyCaller +// ----------------------------------------------------------------------------- +// +CVtUiAppShutter::CEmergencyCaller::CEmergencyCaller( + CVtUiAppShutter& aObserver, + MVtUiStateContext& aStateContext ) : + iObserver( aObserver ), + iStateContext( aStateContext ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::CEmergencyCaller::~CEmergencyCaller +// ----------------------------------------------------------------------------- +// +CVtUiAppShutter::CEmergencyCaller::~CEmergencyCaller() + { + __VTPRINTENTER( "CEmergencyCaller.~" ) + delete iEmergency; + iServer.Close(); + __VTPRINTEXIT( "CEmergencyCaller.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiAppShutter::CEmergencyCaller::HandleEmergencyDialL +// ----------------------------------------------------------------------------- +// +void CVtUiAppShutter::CEmergencyCaller::HandleEmergencyDialL( + const TInt ) + { + __VTPRINTENTER( "CEmergencyCaller.HandleEmergencyDialL" ) + iObserver.EmergencyCallDoneL(); + __VTPRINTEXIT( "CEmergencyCaller.HandleEmergencyDialL" ) + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/cvtuidtmfbuffer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/cvtuidtmfbuffer.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,218 @@ +/* +* Copyright (c) 2007 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: Implementation of DTMF buffer class +* +*/ + + +#include +#include +#include "cvtuidtmfbuffer.h" +#include "tvtuiwsevent.h" +#include "VtUiUtility.h" + +// Time after which buffer will be automatically reset (4 seconds). +const TInt KBufferResetInterval = 4 * 1000000; + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::NewL +// --------------------------------------------------------------------------- +// +CVtUiDTMFBuffer* CVtUiDTMFBuffer::NewL( const CCoeEnv& aCoeEnv ) + { + __VTPRINTENTER( "CVtUiDTMFBuffer.NewL" ) + CVtUiDTMFBuffer* self = new ( ELeave ) CVtUiDTMFBuffer( aCoeEnv ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "CVtUiDTMFBuffer.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::~CVtUiDTMFBuffer +// --------------------------------------------------------------------------- +// +CVtUiDTMFBuffer::~CVtUiDTMFBuffer() + { + __VTPRINTENTER( "CVtUiDTMFBuffer.~" ) + Cancel(); + iTimer.Close(); + __VTPRINTEXIT( "CVtUiDTMFBuffer.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::Append +// --------------------------------------------------------------------------- +// +TBool CVtUiDTMFBuffer::Append( TChar aChar ) + { + __VTPRINTENTER( "CVtUiDTMFBuffer.Append" ) + TBool result( EFalse ); + if ( VtUiUtility::IsDTMFCharacter( aChar ) ) + { + if ( iBuffer.Length() == iBuffer.MaxLength() ) + { + iBuffer = iBuffer.Right( 1 ); + } + iBuffer.Append( aChar ); + StartTimer(); + result = ETrue; + } + __VTPRINTEXITR( "CVtUiDTMFBuffer.Append %d", result ) + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::Reset +// --------------------------------------------------------------------------- +// +void CVtUiDTMFBuffer::Reset() + { + __VTPRINTENTER( "CVtUiDTMFBuffer.Reset" ) + Cancel(); + ResetBuffer(); + __VTPRINTEXIT( "CVtUiDTMFBuffer.Reset" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::Activate +// --------------------------------------------------------------------------- +// +void CVtUiDTMFBuffer::Activate() + { + __VTPRINTENTER( "CVtUiDTMFBuffer.Activate" ) + TVtUiWsEvent< MVtUiNumberSource > event( + EVtUiWsEventNumberSourceActivate, this ); + iCoeEnv.WsSession().SendEventToWindowGroup( + iCoeEnv.RootWin().WindowGroupId(), event ); + __VTPRINTEXIT( "CVtUiDTMFBuffer.Activate" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::Deactivate +// --------------------------------------------------------------------------- +// +void CVtUiDTMFBuffer::Deactivate() + { + __VTPRINTENTER( "CVtUiDTMFBuffer.Deactivate" ) + TVtUiWsEvent< MVtUiNumberSource > event( + EVtUiWsEventNumberSourceDeactivate, this ); + iCoeEnv.WsSession().SendEventToWindowGroup( + iCoeEnv.RootWin().WindowGroupId(), event ); + __VTPRINTEXIT( "CVtUiDTMFBuffer.Deactivate" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::GetContents +// --------------------------------------------------------------------------- +// +void CVtUiDTMFBuffer::GetContents( TDes& aContents ) const + { + __VTPRINTENTER( "CVtUiDTMFBuffer.GetContents" ) + const TInt length( aContents.MaxLength() < iBuffer.Length() ? + aContents.MaxLength() : iBuffer.Length() ); + if ( length ) + { + aContents = iBuffer.Mid( 0, length ); + } + else + { + aContents.Zero(); + } + __VTPRINTEXIT( "CVtUiDTMFBuffer.GetContents" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::DoCancel +// --------------------------------------------------------------------------- +// +void CVtUiDTMFBuffer::DoCancel() + { + __VTPRINTENTER( "CVtUiDTMFBuffer.DoCancel" ) + iTimer.Cancel(); + __VTPRINTEXIT( "CVtUiDTMFBuffer.DoCancel" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::RunL +// --------------------------------------------------------------------------- +// +void CVtUiDTMFBuffer::RunL() + { + __VTPRINTENTER( "CVtUiDTMFBuffer.RunL" ) + TimerExpired( iStatus.Int() ); + __VTPRINTEXIT( "CVtUiDTMFBuffer.RunL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::CVtUiDTMFBuffer +// --------------------------------------------------------------------------- +// +CVtUiDTMFBuffer::CVtUiDTMFBuffer( const CCoeEnv& aCoeEnv ) : + CActive( EPriorityStandard ), iCoeEnv( aCoeEnv ) + { + __VTPRINTENTER( "CVtUiDTMFBuffer.ctor" ) + CActiveScheduler::Add( this ); + __VTPRINTEXIT( "CVtUiDTMFBuffer.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiDTMFBuffer::ConstructL() + { + __VTPRINTENTER( "CVtUiDTMFBuffer.ConstructL" ) + User::LeaveIfError( iTimer.CreateLocal() ); + __VTPRINTEXIT( "CVtUiDTMFBuffer.ConstructL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::StartTimer +// --------------------------------------------------------------------------- +// +void CVtUiDTMFBuffer::StartTimer() + { + __VTPRINTENTER( "CVtUiDTMFBuffer.StartTimer" ) + Cancel(); + SetActive(); + iTimer.After( iStatus, KBufferResetInterval ); + __VTPRINTEXIT( "CVtUiDTMFBuffer.StartTimer" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::TimerExpired +// --------------------------------------------------------------------------- +// +void CVtUiDTMFBuffer::TimerExpired( TInt aError ) + { + __VTPRINTENTER( "CVtUiDTMFBuffer.TimerExpired" ) + if ( aError != KErrCancel ) + { + ResetBuffer(); + } + __VTPRINTEXIT( "CVtUiDTMFBuffer.TimerExpired" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDTMFBuffer::ResetBuffer +// --------------------------------------------------------------------------- +// +void CVtUiDTMFBuffer::ResetBuffer() + { + __VTPRINTENTER( "CVtUiDTMFBuffer.ResetBuffer" ) + iBuffer.Zero(); + __VTPRINTEXIT( "CVtUiDTMFBuffer.ResetBuffer" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/cvtuivideocontrolbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/cvtuivideocontrolbase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,777 @@ +/* +* Copyright (c) 2006 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: Video control base class implementation. +* +*/ + + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "cvtuivideocontrolbase.h" +#include "mvtuicomponentmanager.h" +#include "VtUiLayout.h" + +// CONSTANTS + +// Index of white color. +const TInt KVtUiColorWhite = 0; + +// Amount of characters reserved per line. +const TInt KVtUiWaitingExtraSpacePerLine = KAknBidiExtraSpacePerLine + 1; + +// Amount of lines used for 'waiting text' +const TInt KVtUiWaitingLineCount = 2; + +// Implementation of CVtUiVideoControlBase + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::~CVtUiVideoControlBase +// --------------------------------------------------------------------------- +// +CVtUiVideoControlBase::~CVtUiVideoControlBase() + { + __VTPRINTENTER( "VidCtrlBase.~" ) + AknsUtils::DeregisterControlPosition( this ); + iStreamBitmap = NULL; // not owned. + delete iWaitingTextWrappedArray; + delete iWaitingTextWrapped; + delete iBgContext; + __VTPRINTEXIT( "VidCtrlBase.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::CVtUiVideoControlBase +// --------------------------------------------------------------------------- +// +CVtUiVideoControlBase::CVtUiVideoControlBase( + CVtUiBitmapManager& aBitmapManager ) : + iBitmapManager( &aBitmapManager ) + { + __VTPRINTENTER( "VidCtrlBase.ctor" ) + __VTPRINTEXIT( "VidCtrlBase.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::BaseConstructL +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::BaseConstructL() + { + __VTPRINTENTER( "VidCtrlBase.BaseConstructL" ) + iBgContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDQsnBgAreaMain, Rect(), ETrue ); + CreateWindowL(); + SetExtent( TPoint(), TSize() ); + ActivateL(); + WrapOnDemand(); + __VTPRINTEXIT( "VidCtrlBase.BaseConstructL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::SetRenderingHint +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::SetRenderingHint( TRenderingHint aHint ) + { + __VTPRINTENTER( "VidCtrlBase.SetRenderingHint" ) + __VTPRINT2( DEBUG_GEN, "VidCtrlBase.SetRenderingHint aHint = %d", aHint ) + iHints.Set( aHint ); + __VTPRINTEXIT( "VidCtrlBase.SetRenderingHint" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::ClearRenderingHint +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::ClearRenderingHint( TRenderingHint aHint ) + { + __VTPRINTENTER( "VidCtrlBase.ClearRenderingHint" ) + __VTPRINT2( DEBUG_GEN, "VidCtrlBase.ClearRenderingHint aHint = %d", aHint ) + iHints.Clear( aHint ); + __VTPRINTEXIT( "VidCtrlBase.ClearRenderingHint" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::BitmapManager +// --------------------------------------------------------------------------- +// +CVtUiBitmapManager& CVtUiVideoControlBase::BitmapManager() const + { + return *iBitmapManager; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::Bitmap +// --------------------------------------------------------------------------- +// +CFbsBitmap* CVtUiVideoControlBase::Bitmap( TVtUiBitmapPoolId aId ) const + { + __VTPRINTENTER( "VidCtrlBase.Bitmap" ) + CFbsBitmap* bitmap = NULL; + iBitmapManager->GetBitmap( aId, bitmap ); + __VTPRINTEXITR( "VidCtrlBase.Bitmap %d", TInt( bitmap ) ) + return bitmap; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::AdjustPointForDP +// --------------------------------------------------------------------------- +// +TPoint CVtUiVideoControlBase::AdjustPointForDP( const TPoint aPoint ) const + { + __VTPRINTENTER( "VidCtrlBase.AdjustPointForDP" ) + TPoint result( aPoint ); + if ( FeatureManager::FeatureSupported( KFeatureIdDisplayPost ) ) + { + if ( result.iX & 1 ) + { + result.iX++; + } + } + __VTPRINTEXIT( "VidCtrlBase.AdjustPointForDP" ) + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::AdjustRectForDP +// --------------------------------------------------------------------------- +// +TRect CVtUiVideoControlBase::AdjustRectForDP( const TRect aRect ) const + { + __VTPRINTENTER( "VidCtrlBase.AdjustRectForDP" ) + TRect result( aRect ); + if ( FeatureManager::FeatureSupported( KFeatureIdDisplayPost ) ) + { + if ( result.iTl.iX & 1 ) + { + result.Move( 1, 0 ); + result.SetWidth( Max( 0, result.Width() - 1 ) ); + } + if ( result.Width() & 1 ) + { + result.SetWidth( result.Width() - 1 ); + } + } + __VTPRINTEXIT( "VidCtrlBase.AdjustRectForDP" ) + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::WaitingTextLayout +// --------------------------------------------------------------------------- +// +TAknTextLineLayout CVtUiVideoControlBase::WaitingTextLayout( TInt ) + { + return TAknTextLineLayout(); + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::HandleSizeChanged +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::HandleSizeChanged() + { + __VTPRINTENTER( "VidCtrlBase.HandleSizeChanged" ) + __VTPRINTEXIT( "VidCtrlBase.HandleSizeChanged" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::DrawSkinnedBackground +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::DrawSkinnedBackground( CWindowGc& aGc ) const + { + __VTPRINTENTER( "VidCtrlBase.DrawSkinnedBackground" ) + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, this, aGc, Rect() ); + __VTPRINTEXIT( "VidCtrlBase.DrawSkinnedBackground" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiVideoControlBase::MopSupplyObject +// ----------------------------------------------------------------------------- +// + +TTypeUid::Ptr CVtUiVideoControlBase::MopSupplyObject( TTypeUid aId ) + { + __VTPRINTENTER( "VidCtrlBase.MopSupplyObject" ) + // Required during rendering of the background skin in Draw() + if (aId.iUid == MAknsControlContext::ETypeId) + { + __VTPRINTEXIT( "VidCtrlBase.MopSupplyObject.1" ) + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); + } + __VTPRINTEXIT( "VidCtrlBase.MopSupplyObject.2" ) + return CCoeControl::MopSupplyObject( aId ); + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::DrawColoredBackground +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::DrawColoredBackground( CWindowGc& aGc ) const + { + __VTPRINTENTER( "VidCtrlBase.DrawColoredBackground" ) + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetPenStyle( CGraphicsContext::ENullPen ); + aGc.SetBrushColor( AKN_LAF_COLOR( KVtUiColorWhite ) ); + aGc.DrawRect( Rect() ); + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + __VTPRINTEXIT( "VidCtrlBase.DrawColoredBackground" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::DrawWaitingText +// --------------------------------------------------------------------------- +// +TBool CVtUiVideoControlBase::DrawWaitingText( CWindowGc& aGc ) const + { + __VTPRINTENTER( "VidCtrlBase.DrawWaitingText" ) + const TInt count( iWaitingTextWrappedArray->Count() ); + if ( count > 0 ) + { + aGc.SetClippingRect( StreamClippingRect() ); + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + TRgb color( iWaitingTextLine1Layout.Color() ); + AknsUtils::GetCachedColor( + skin, + color, + KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + iWaitingTextLine1Layout.DrawText( + aGc, + iWaitingTextWrappedArray->At( 0 ), // first line + EFalse, + color ); + if ( count > 1 ) // two lines + { + iWaitingTextLine2Layout.DrawText( + aGc, + iWaitingTextWrappedArray->At( 1 ), // second line + EFalse, + color ); + } + } + __VTPRINTEXITR( "VidCtrlBase.DrawWaitingText %d", ETrue ) + return ETrue; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::DrawBlind +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::DrawBlind( CWindowGc& aGc ) const + { + __VTPRINTENTER( "VidCtrlBase.DrawBlind" ) + CFbsBitmap* icon = BlindImage(); + if ( icon ) + { + CFbsBitmap* mask = BlindMask(); + if ( mask ) + { + aGc.BitBltMasked( + BlindBlitPosition(), + icon, + TRect( icon->SizeInPixels() ), + mask, + ETrue ); + } + else + { + aGc.BitBlt( + BlindBlitPosition(), + icon ); + } + } + __VTPRINTEXIT( "VidCtrlBase.DrawBlind" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::DrawStream +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::DrawStream( CWindowGc& aGc ) const + { + __VTPRINTENTER( "VidCtrlBase.DrawStream" ) + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + aGc.SetClippingRect( StreamClippingRect() ); + aGc.BitBlt( StreamBlitPosition(), iStreamBitmap ); + aGc.CancelClippingRect(); + __VTPRINTEXIT( "VidCtrlBase.DrawStream" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::StreamBlitPosition +// --------------------------------------------------------------------------- +// +TPoint CVtUiVideoControlBase::StreamBlitPosition() const + { + __VTPRINTENTER( "VidCtrlBase.StreamBlitPosition" ) + __VTPRINTEXIT( "VidCtrlBase.StreamBlitPosition" ) + return Rect().iTl; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::StreamClippingRect +// --------------------------------------------------------------------------- +// +TRect CVtUiVideoControlBase::StreamClippingRect() const + { + __VTPRINTENTER( "VidCtrlBase.StreamClippingRect" ) + __VTPRINTEXIT( "VidCtrlBase.StreamClippingRect" ) + return Rect(); + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::BlindImage +// --------------------------------------------------------------------------- +// +CFbsBitmap* CVtUiVideoControlBase::BlindImage() const + { + __VTPRINTENTER( "VidCtrlBase.BlindImage" ) + __VTPRINTEXIT( "VidCtrlBase.BlindImage" ) + return NULL; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::BlindMask +// --------------------------------------------------------------------------- +// +CFbsBitmap* CVtUiVideoControlBase::BlindMask() const + { + __VTPRINTENTER( "VidCtrlBase.BlindMask" ) + __VTPRINTEXIT( "VidCtrlBase.BlindMask" ) + return NULL; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::BlindBlitPosition +// --------------------------------------------------------------------------- +// +TPoint CVtUiVideoControlBase::BlindBlitPosition() const + { + __VTPRINTENTER( "VidCtrlBase.BlindBlitPosition" ) + __VTPRINTEXIT( "VidCtrlBase.BlindBlitPosition" ) + return TPoint(); + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::Reset +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::Reset() + { + __VTPRINTENTER( "VidCtrlBase.Reset" ) + iBlindStatus = EFalse; + iStreamBitmap = NULL; + iWaitingTextShow = EFalse; + __VTPRINTEXIT( "VidCtrlBase.Reset" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::SetBlind +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::SetBlind( TBool aBlindStatus ) + { + __VTPRINTENTER( "VidCtrlBase.SetBlind" ) + /* Once SetBlind called, re-draw the control anyway */ +// if ( iBlindStatus != aBlindStatus ) +// { + iBlindStatus = aBlindStatus; + DrawNow(); +// } + __VTPRINTEXITR( "VidCtrlBase.SetBlind %d", iBlindStatus ) + } + +// ----------------------------------------------------------------------------- +// CVtUiVideoControlBase::IsAlphaZero +// Checks if the alpha has been set to zero. +// ----------------------------------------------------------------------------- +// +TBool CVtUiVideoControlBase::IsAlphaZero() const + { + __VTPRINTENTER( "VidCtrlBase.IsAlphaZero" ) + TBool isZero( EFalse ); + const CWsScreenDevice& sdev( + *static_cast< CWsScreenDevice*>( SystemGc().Device() ) ); + if ( sdev.DisplayMode() == EColor16MA ) + { + TRgb color; + TPoint point( Rect().Center() ); + sdev.GetPixel( color, point ); + isZero = ( color.Alpha() == 0 ); + } + __VTPRINTEXITR( "VidCtrlBase.IsAlphaZero %d", isZero ) + return isZero; + } + +// ----------------------------------------------------------------------------- +// CVtUiVideoControlBase::SetAlpha +// Sets alpha. +// ----------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::SetAlpha( CWindowGc& aGc ) const + { + __VTPRINTENTER( "VidCtrlBase.SetAlpha" ) + aGc.SetDrawMode( CGraphicsContext::EDrawModeOR ); + aGc.SetBrushColor( TRgb( 0, 0, 0, 255 ) ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.Clear(); + aGc.Reset(); + __VTPRINTEXIT( "VidCtrlBase.SetAlpha" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::SetStreamBitmap +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::SetStreamBitmap( CFbsBitmap* aStreamBitmap ) + { + __VTPRINTENTER( "VidCtrlBase.SetStreamBitmap" ) + __VTPRINT2( DEBUG_GEN, "VidCtrlBase.SetStreamBitmap %d", + (TInt) aStreamBitmap ) + const CFbsBitmap* oldBitmap( iStreamBitmap ); + iStreamBitmap = aStreamBitmap; + iSetAlpha = IsAlphaZero(); + if ( iStreamBitmap ) + { + RedrawStream(); + } + else if ( oldBitmap ) + { + DrawNow(); + } + __VTPRINTEXIT( "VidCtrlBase.SetStreamBitmap" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::SetStreamBitmapReserve +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::SetStreamBitmapReserve( + CFbsBitmap* aStreamBitmap ) + { + __VTPRINTENTER( "VidCtrlBase.SetStreamBitmapReserve" ) + __VTPRINT2( DEBUG_GEN, "VidCtrlBase.SetStreamBitmapReserve %d", + (TInt) aStreamBitmap ) + const CFbsBitmap* oldBitmap( iStreamBitmap ); + iStreamBitmap = aStreamBitmap; + if ( iStreamBitmap ) + { + RedrawStream(); + } + else if ( oldBitmap ) + { + DrawNow(); + } + __VTPRINTEXIT( "VidCtrlBase.SetStreamBitmapReserve" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::SetWaiting +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::SetWaiting( TBool aShowWaitingText ) + { + __VTPRINTENTER( "VidCtrlBase.SetWaiting" ) + if ( iWaitingTextShow != aShowWaitingText ) + { + iWaitingTextShow = aShowWaitingText; + WrapOnDemand(); + DrawNow(); + } + __VTPRINTEXITR( "VidCtrlBase.SetWaiting %d", iWaitingTextShow ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::Redraw +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::Redraw() + { + __VTPRINTENTER( "VidCtrlBase.Redraw" ) + if ( iStreamBitmap ) + { + __VTPRINT( DEBUG_GEN, "VidCtrlBase.Redraw drawing" ); + DrawNow(); + } + __VTPRINTEXIT( "VidCtrlBase.Redraw" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::Draw +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::Draw( const TRect& ) const + { + __VTPRINTENTER( "VidCtrlBase.Draw" ) + DoDraw( SystemGc() ); + __VTPRINTEXIT( "VidCtrlBase.Draw" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiVideoControlBase::SizeChanged +// ----------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::SizeChanged() + { + __VTPRINTENTER( "VidCtrlBase.SizeChanged" ) + AknsUtils::RegisterControlPosition( this ); + + TRect bgRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, bgRect ); + iBgContext->SetRect( bgRect ); + + HandleSizeChanged(); + TRect parent( Rect() ); + if ( !parent.IsEmpty() ) + { + TAknTextLineLayout text( WaitingTextLayout( 0 ) ); + iWaitingTextLine1Layout.LayoutText( parent, text ); + text = WaitingTextLayout( 1 ); + iWaitingTextLine2Layout.LayoutText( parent, text ); + delete iWaitingTextWrapped; + iWaitingTextWrapped = NULL; + delete iWaitingTextWrappedArray; + iWaitingTextWrappedArray = NULL; + WrapOnDemand(); + } + __VTPRINTEXIT( "VidCtrlBase.SizeChanged" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiVideoControlBase::PositionChanged +// ----------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::PositionChanged() + { + __VTPRINTENTER( "VidCtrlBase.SizeChanged" ) + AknsUtils::RegisterControlPosition( this ); + __VTPRINTEXIT( "VidCtrlBase.SizeChanged" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::RedrawStream +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::RedrawStream() + { + __VTPRINTENTER( "VidCtrlBase.RedrawStream" ) + const TRect clippingRect( StreamClippingRect() ); + Window().Invalidate( clippingRect ); + Window().BeginRedraw( clippingRect ); + ActivateGc(); + CWindowGc& gc = SystemGc(); + if ( iSetAlpha ) + { + SetAlpha( gc ); + iSetAlpha = EFalse; + } + DoDrawStream( gc ); + DoDrawBlind( gc ); + DeactivateGc(); + Window().EndRedraw(); + __VTPRINTEXIT( "VidCtrlBase.RedrawStream" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiVideoControlBase::WrapOnDemand +// ----------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::WrapOnDemand() + { + __VTPRINTENTER( "VidCtrlBase.WrapOnDemand" ) + if ( iWaitingTextShow && !iWaitingTextWrapped ) + { + TRAP_IGNORE( WrapWaitingTextL() ); + } + __VTPRINTEXIT( "VidCtrlBase.WrapOnDemand" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiVideoControlBase::WrapWaitingTextL +// ----------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::WrapWaitingTextL() + { + __VTPRINTENTER( "VidCtrlBase.WrapWaitingTextL" ) + HBufC* waitingText = + StringLoader::LoadLC( R_VIDEOTELUI_QTN_INCAL_WAITING_IMAGE ); + + CArrayFix< TInt >* lines = + new ( ELeave ) CArrayFixFlat< TInt >( KVtUiWaitingLineCount ); + CleanupStack::PushL( lines ); + lines->AppendL( iWaitingTextLine1Layout.TextRect().Width() ); + lines->AppendL( iWaitingTextLine2Layout.TextRect().Width() ); + + CArrayFix* wrap = + new ( ELeave ) CArrayFixFlat< TPtrC >( KVtUiWaitingLineCount ); + CleanupStack::PushL( wrap ); + wrap->AppendL( TPtrC() ); + wrap->AppendL( TPtrC() ); + + HBufC* waitingTextWrapped = + HBufC::NewLC( + waitingText->Length() + + lines->Count() * KVtUiWaitingExtraSpacePerLine ); + + TPtr textBuf = waitingTextWrapped->Des(); + textBuf.Zero(); + textBuf.Append( *waitingText ); + + AknBidiTextUtils::ConvertToVisualAndWrapToArrayL( + textBuf, + *lines, + *iWaitingTextLine1Layout.Font(), + *wrap, + ETrue ); + + CleanupStack::Pop( waitingTextWrapped ); + iWaitingTextWrapped = waitingTextWrapped; + + CleanupStack::Pop( wrap ); + iWaitingTextWrappedArray = wrap; + + CleanupStack::PopAndDestroy( lines ); + CleanupStack::PopAndDestroy( waitingText ); + __VTPRINTEXIT( "VidCtrlBase.WrapWaitingTextL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::DoDraw +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::DoDraw( CWindowGc& aGc ) const + { + __VTPRINTENTER( "VidCtrlBase.Draw(gc)" ) + if ( iSetAlpha ) + { + SetAlpha( aGc ); + iSetAlpha = EFalse; + } + DoDrawBackground( aGc ); + if ( !DoDrawWaitingText( aGc ) ) + { + DoDrawStream( aGc ); + DoDrawBlind( aGc ); + } + __VTPRINTEXIT( "VidCtrlBase.Draw(gc)" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::DoDrawBackground +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::DoDrawBackground( CWindowGc& aGc ) const + { + __VTPRINTENTER( "VidCtrlBase.DoDrawBackground" ) + if ( iHints.IsSet( ESkinnedBackground ) ) + { + DrawSkinnedBackground( aGc ); + } + else if ( iHints.IsSet( EColoredBackground ) ) + { + DrawColoredBackground( aGc ); + } + __VTPRINTEXIT( "VidCtrlBase.DoDrawBackground" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::DoDrawWaitingText +// --------------------------------------------------------------------------- +// +TBool CVtUiVideoControlBase::DoDrawWaitingText( CWindowGc& aGc ) const + { + __VTPRINTENTER( "VidCtrlBase.DoDrawWaitingText" ) + TBool wasDrawn( EFalse ); + if ( iHints.IsClear( ENoWaitingText ) && iWaitingTextShow && + iWaitingTextWrapped && iWaitingTextWrappedArray ) + { + wasDrawn = DrawWaitingText( aGc ); + } + __VTPRINTEXITR( "VidCtrlBase.DoDrawWaitingText %d", wasDrawn ) + return wasDrawn; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::DoDrawBlind +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::DoDrawBlind( CWindowGc& aGc ) const + { + __VTPRINTENTER( "VidCtrlBase.DoDrawBlind" ) + if ( iBlindStatus && iHints.IsClear( ENoBlindIcon ) ) + { + DrawBlind( aGc ); + } + __VTPRINTEXIT( "VidCtrlBase.DoDrawBlind" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::DoDrawStream +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::DoDrawStream( CWindowGc& aGc ) const + { + __VTPRINTENTER( "VidCtrlBase.DoDrawStream" ) + if ( iStreamBitmap ) + { + DrawStream( aGc ); + } + __VTPRINTEXIT( "VidCtrlBase.DoDrawStream" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::SetRemoteVideoControl +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase::SetRemoteVideoControl( CCoeControl* aRemoteControl ) + { + __VTPRINTENTER( "VidCtrlBase.SetRemoteVideoControl" ) + iRemoteVideoControl = aRemoteControl; + __VTPRINTEXIT( "VidCtrlBase.SetRemoteVideoControl" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::LayoutRemoteVideo +// --------------------------------------------------------------------------- +// +void CVtUiVideoControlBase:: LayoutRemoteVideo() + { + __VTPRINTENTER( "VidCtrlBase.LayoutRemoteVideo" ) + __VTPRINTEXIT( "VidCtrlBase.LayoutRemoteVideo" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoControlBase::RemoteVideoControl +// --------------------------------------------------------------------------- +// +CCoeControl * CVtUiVideoControlBase::RemoteVideoControl() + { + __VTPRINTENTER( "VidCtrlBase.RemoteVideoControl" ) + __VTPRINTEXIT( "VidCtrlBase.RemoteVideoControl" ) + return iRemoteVideoControl; + + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/cvtuifeaturebase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/cvtuifeaturebase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2006 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: CVtUiFeatureBase implementation. +* +*/ + + +// INCLUDE FILES + +#include "cvtuifeaturebase.h" +#include "mvtuifeature.h" +#include "cvtuicommandpolicymanager.h" +#include +#include "cvtuifeaturemanager.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiFeatureBase::CVtUiFeatureBase +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiFeatureBase::CVtUiFeatureBase( TVtUiFeatureId aId, + CVtUiFeatureManager& aFeatureManager ) : iId( aId ), + iFeatureManager ( aFeatureManager ), + iFeatureState ( EUnprepared ) + { + __VTPRINTENTER( "CVtUiFeatureBase.CVtUiFeatureBase" ) + __VTPRINTEXIT( "CVtUiFeatureBase.CVtUiFeatureBase" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureBase::BaseConstructL +// ----------------------------------------------------------------------------- +// +void CVtUiFeatureBase::StartL() + { + if ( iFeatureState == EUnprepared ) + { + iAsyncCallback->Cancel(); + InitFeatureL(); + } + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureBase::BaseConstructL +// ----------------------------------------------------------------------------- +// +void CVtUiFeatureBase::BaseConstructL() + { + __VTPRINTENTER( "CVtUiFeatureBase.BaseConstructL" ) + iAsyncCallback = + new ( ELeave ) CAsyncCallBack ( CActive::EPriorityLow ); + iAsyncCallback->Set( TCallBack( &DoInitFeaturesL, this ) ); + iAsyncCallback->CallBack(); + __VTPRINTEXIT( "CVtUiFeatureBase.BaseConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureBase::~CVtUiFeatureBase +// Destructor. +// ----------------------------------------------------------------------------- +// +CVtUiFeatureBase::~CVtUiFeatureBase() + { + __VTPRINTENTER( "CVtUiFeatureBase.~" ) + delete iAsyncCallback; + __VTPRINTEXIT( "CVtUiFeatureBase.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureBase::State +// ----------------------------------------------------------------------------- +// +MVtUiFeature::TVtUiFeatureState CVtUiFeatureBase::State() const + { + __VTPRINTENTER( "CVtUiFeatureBase.State" ) + __VTPRINTEXITR( "CVtUiFeatureBase.State. %d", (TInt)iFeatureState ) + return iFeatureState; + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureBase::Id +// ----------------------------------------------------------------------------- +// +TVtUiFeatureId CVtUiFeatureBase::Id() const + { + __VTPRINTENTER( "CVtUiFeatureBase.Id" ) + __VTPRINTEXITR( "CVtUiFeatureBase.Id %d", iId ) + return iId; + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureBase::DoInitFeaturesL +// ----------------------------------------------------------------------------- +// +TInt CVtUiFeatureBase::DoInitFeaturesL( TAny* aAny ) + { + __VTPRINTENTER( "CVtUiFeatureBase.DoInitFeaturesL" ) + CVtUiFeatureBase* self = static_cast< CVtUiFeatureBase* >( aAny ); + self->InitFeatureL(); + __VTPRINTEXIT( "CVtUiFeatureBase.DoInitFeaturesL" ) + return KErrNone; + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/cvtuifeaturemanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/cvtuifeaturemanager.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,280 @@ +/* +* Copyright (c) 2006 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: Feature manager for Video Telephone application. +* +*/ + + + +// INCLUDE FILES +#include "cvtuifeaturemanager.h" +#include "CVtUiAppUi.h" +#include "cvtuifixedtoolbar.h" +#include "cvtuifloatingtoolbar.h" +#include "cvtuimenus.h" +#include "cvtuifeaturebase.h" +#include "tvtuistates.h" +#include +#include "cvtuicommandpolicymanager.h" +#include "cvtuisoftkeys.h" +#include "cvtuinumberentry.h" +#include "cvtuivideoquality.h" +#include "cvtuiwhitebalance.h" +#include "cvtuicolortone.h" +#include "cvtuidialer.h" +#include "cvtuibrightness.h" +#include "cvtuicontrast.h" +#include "cvtuivolume.h" +#include "cvtuizoom.h" + +#include + +// CONSTANTS +const TInt KFeatureCount = 9; + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Used in Attach() method to compare two instances of MVtUiFeature. +// --------------------------------------------------------------------------- +// +TInt FeatureCmpFunc( const CVtUiFeatureBase& aV1, const CVtUiFeatureBase& aV2 ) + { + return ( aV1.Id() - aV2.Id() ); + } + +// --------------------------------------------------------------------------- +// Used in GetFeature() method to search feature by id. +// --------------------------------------------------------------------------- +// +TInt FeatureIdCmpFunc( const TInt* aId, const CVtUiFeatureBase& aFeature ) + { + return ( *aId - aFeature.Id() ); + } + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiFeatureManager::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CVtUiFeatureManager* CVtUiFeatureManager::NewL( CVtUiAppUi& aAppUi, + TVtUiStates& aUiStates, MVtUiCommandManager& aCommandManager, + MVtUiComponentManager& aComponentManager ) + { + CVtUiFeatureManager* self = new( ELeave ) CVtUiFeatureManager( aAppUi, + aUiStates, aCommandManager, aComponentManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureManager::CVtUiFeatureManager +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiFeatureManager::CVtUiFeatureManager( CVtUiAppUi& aAppUi, + TVtUiStates& aUiStates, MVtUiCommandManager& aCommandManager, + MVtUiComponentManager& aComponentManager ) + : iAppUi( aAppUi ), iUiStates( aUiStates ), + iCommandManager( aCommandManager ), iComponentManager( aComponentManager ) + { + __VTPRINTENTER( "CVtUiFeatureManager.CVtUiFeatureManager" ) + __VTPRINTEXIT( "CVtUiFeatureManager.CVtUiFeatureManager" ) + } + + +// ----------------------------------------------------------------------------- +//CVtUiFeatureManager::~CVtUiFeatureManager() +// ----------------------------------------------------------------------------- +// +CVtUiFeatureManager::~CVtUiFeatureManager() + { + __VTPRINTENTER( "CVtUiFeatureManager.~" ) + iFeatures.ResetAndDestroy(); + __VTPRINTEXIT( "CVtUiFeatureManager.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureManager::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CVtUiFeatureManager::ConstructL() + { + __VTPRINTENTER( "CVtUiFeatureManager.ConstructL" ) + iFeatures.ReserveL( KFeatureCount ); + CreateFeaturesL(); + __VTPRINTEXIT( "CVtUiFeatureManager.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureManager::CreateFeaturesL +// ----------------------------------------------------------------------------- +// +void CVtUiFeatureManager::CreateFeaturesL() + { + __VTPRINTENTER( "CVtUiFeatureManager.CreateFeaturesL" ) + CVtUiFeatureBase* feature = NULL; + TLinearOrder< CVtUiFeatureBase > + linOrder( ::FeatureCmpFunc ); + + if ( AknLayoutUtils::PenEnabled() ) + { + feature = CVtUiFixedToolbar::NewL( *this ); + } + else + { + feature = CVtUiFloatingToolbar::NewL( *this ); + } + + if ( feature ) + { + iFeatures.InsertInOrderL( feature, linOrder ); + } + + feature = CVtUiMenus::NewL( *this ); + iFeatures.InsertInOrderL( feature, linOrder ); + + feature = CVtUiSoftkeys::NewL( *this, *iAppUi.GetCba() ); + iFeatures.InsertInOrderL( feature, linOrder ); + + feature = CVtUiNumberEntry::NewL( *this ); + iFeatures.InsertInOrderL( feature, linOrder ); + + if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) ) + { + feature = CVtUiDialer::NewL( *this ); + if ( feature ) + { + iFeatures.InsertInOrderL( feature, linOrder ); + } + } + + feature = CVtUiVideoQuality::NewL( *this ); + if ( feature ) + { + iFeatures.InsertInOrderL( feature, linOrder ); + } + + feature = CVtUiWhiteBalance::NewL( *this ); + if ( feature ) + { + iFeatures.InsertInOrderL( feature, linOrder ); + } + + feature = CVtUiColorTone::NewL( *this ); + if ( feature ) + { + iFeatures.InsertInOrderL( feature, linOrder ); + } + + feature = CVtUiBrightness::NewL( *this ); + if ( feature ) + { + iFeatures.InsertInOrderL( feature, linOrder ); + } + + feature = CVtUiContrast::NewL( *this ); + if ( feature ) + { + iFeatures.InsertInOrderL( feature, linOrder ); + } + + feature = CVtUiVolume::NewL( *this ); + if ( feature ) + { + iFeatures.InsertInOrderL( feature, linOrder ); + } + + feature = CVtUiZoom::NewL( *this ); + if ( feature ) + { + iFeatures.InsertInOrderL( feature, linOrder ); + } + + __VTPRINTEXIT( "CVtUiFeatureManager.CreateFeaturesL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureManager::AppUi +// ----------------------------------------------------------------------------- +// +CVtUiAppUi& CVtUiFeatureManager::AppUi() + { + __VTPRINTENTER( "CVtUiFeatureManager.AppUi" ) + __VTPRINTEXIT( "CVtUiFeatureManager.AppUi" ) + return iAppUi; + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureManager::GetFeatureById +// ----------------------------------------------------------------------------- +// +MVtUiFeature* CVtUiFeatureManager::GetFeatureById( TInt aId ) + { + __VTPRINTENTER( "CVtUiFeatureManager.GetFeatureById" ) + CVtUiFeatureBase* result = NULL; + + TInt index( iFeatures.FindInOrder( aId, ::FeatureIdCmpFunc ) ); + if ( index != KErrNotFound ) + { + result = iFeatures[ index ]; + } + __VTPRINTEXITR( "CVtUiFeatureManager.GetFeatureById %d", (TInt)result ) + return result; + + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureManager::UiStates +// ----------------------------------------------------------------------------- +// + +TVtUiStates& CVtUiFeatureManager::UiStates() + { + return iUiStates; + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureManager::CommandManager +// ----------------------------------------------------------------------------- +// +MVtUiCommandManager& CVtUiFeatureManager::CommandManager() + { + return iCommandManager; + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureManager::ComponentManager +// ----------------------------------------------------------------------------- +// +MVtUiComponentManager& CVtUiFeatureManager::ComponentManager() + { + return iComponentManager; + } + +// ----------------------------------------------------------------------------- +// CVtUiFeatureManager::Model +// ----------------------------------------------------------------------------- +// +CVtEngModel& CVtUiFeatureManager::Model() + { + return iAppUi.Model(); + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/dialer/cvtuicmdclosedialer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/dialer/cvtuicmdclosedialer.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2006 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: Mini dialer open command implementation. +* +*/ + + +#include + +#include "cvtuicmdclosedialer.h" +#include "mvtuicommandmanager.h" +#include "mvtuifeature.h" +#include "videotelui.hrh" + +// --------------------------------------------------------------------------- +// CVtUiCmdCloseDialer::NewL +// --------------------------------------------------------------------------- +// +CVtUiCmdCloseDialer* CVtUiCmdCloseDialer::NewL( + MVtUiCommandManager& aCommandManager, MVtUiFeature& aFeature ) + { + __VTPRINTENTER( "CmdCloseDial.NewL" ) + CVtUiCmdCloseDialer* self = + new ( ELeave ) CVtUiCmdCloseDialer( aCommandManager, aFeature ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "CmdCloseDial.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiCmdCloseDialer::~CVtUiCmdCloseDialer +// --------------------------------------------------------------------------- +// +CVtUiCmdCloseDialer::~CVtUiCmdCloseDialer() + { + __VTPRINTENTER( "CmdCloseDial.~" ) + iCommandManager.UnregisterCommand( *this ); + __VTPRINTEXIT( "CmdCloseDial.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdCloseDialer::HandleL +// --------------------------------------------------------------------------- +// +void CVtUiCmdCloseDialer::HandleL() + { + __VTPRINTENTER( "CmdCloseDial.HandleL" ) + iFeature.Stop(); + __VTPRINTEXIT( "CmdCloseDial.HandleL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdCloseDialer::IsEnabled +// --------------------------------------------------------------------------- +// +TBool CVtUiCmdCloseDialer::IsEnabled() const + { + __VTPRINTENTER( "CmdCloseDial.IsEnabled" ) + const TBool enabled( iFeature.State() == MVtUiFeature::EActive ); + __VTPRINTEXITR( "CmdCloseDial.IsEnabled %d", enabled ) + return enabled; + } + +// --------------------------------------------------------------------------- +// CVtUiCmdCloseDialer::CVtUiCmdCloseDialer +// --------------------------------------------------------------------------- +// +CVtUiCmdCloseDialer::CVtUiCmdCloseDialer( + MVtUiCommandManager& aCommandManager, MVtUiFeature& aFeature ) + : CVtUiFeatureCmdBase( aFeature, EVtUiDialerExit ), + iCommandManager( aCommandManager ) + { + __VTPRINTENTER( "CmdCloseDial.ctor" ) + __VTPRINTEXIT( "CmdCloseDial.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdCloseDialer::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiCmdCloseDialer::ConstructL() + { + __VTPRINTENTER( "CmdCloseDial.ConstructL" ) + iCommandManager.RegisterCommandL( *this ); + __VTPRINTEXIT( "CmdCloseDial.ConstructL" ) + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/dialer/cvtuicmdopendialer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/dialer/cvtuicmdopendialer.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2006 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: Mini dialer open command implementation. +* +*/ + + +#include + +#include "cvtuicmdopendialer.h" +#include "mvtuicommandmanager.h" +#include "videotelui.hrh" + +// --------------------------------------------------------------------------- +// CVtUiCmdOpenDialer::NewL +// --------------------------------------------------------------------------- +// +CVtUiCmdOpenDialer* CVtUiCmdOpenDialer::NewL( + MVtUiCommandManager& aCommandManager, MVtUiFeature& aFeature ) + { + __VTPRINTENTER( "CmdOpenDial.NewL" ) + CVtUiCmdOpenDialer* self = + new ( ELeave ) CVtUiCmdOpenDialer( aCommandManager, aFeature ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "CmdOpenDial.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiCmdOpenDialer::~CVtUiCmdOpenDialer +// --------------------------------------------------------------------------- +// +CVtUiCmdOpenDialer::~CVtUiCmdOpenDialer() + { + __VTPRINTENTER( "CmdOpenDial.~" ) + iCommandManager.UnregisterCommand( *this ); + __VTPRINTEXIT( "CmdOpenDial.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdOpenDialer::CVtUiCmdOpenDialer +// --------------------------------------------------------------------------- +// +CVtUiCmdOpenDialer::CVtUiCmdOpenDialer( + MVtUiCommandManager& aCommandManager, MVtUiFeature& aFeature ) + : CVtUiFeatureCmdBase( aFeature, EVtUiCmdSendDTMF ), + iCommandManager( aCommandManager ) + { + __VTPRINTENTER( "CmdOpenDial.ctor" ) + __VTPRINTEXIT( "CmdOpenDial.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiCmdOpenDialer::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiCmdOpenDialer::ConstructL() + { + __VTPRINTENTER( "CmdOpenDial.ConstructL" ) + iCommandManager.RegisterCommandL( *this ); + __VTPRINTEXIT( "CmdOpenDial.ConstructL" ) + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/dialer/cvtuidialer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/dialer/cvtuidialer.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,229 @@ +/* +* Copyright (c) 2006 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: Mini dialer feature +* +*/ + + +#include +#include +#include +#include + +#include "cvtuidialer.h" +#include "cvtuifeaturemanager.h" +#include "mvtuicommandmanager.h" +#include "mvtuicomponentmanager.h" +#include "cvtuicmdopendialer.h" +#include "cvtuicmdclosedialer.h" +#include "cvtuidialercontainer.h" +#include "cvtuidialervideocontrol.h" +#include "CVtUiAppUi.h" +#include "tvtuistates.h" +#include "CVtUiContextControl.h" +#include "CVtUiEndCallButtonPane.h" +#include "CVtUiMainControl.h" +#include "CVtUiRemoteVideoControl.h" +#include "VtUiLayout.h" + +// Index of white color. +const TInt KVtDialerRVCPriLow = -1; + +// ======== LOCAL FUNCTIONS ======== + +// Implementation of CVtUiDialer + +// --------------------------------------------------------------------------- +// CVtUiDialer::NewL +// --------------------------------------------------------------------------- +// +CVtUiDialer* CVtUiDialer::NewL( CVtUiFeatureManager& aFeatureManager ) + { + __VTPRINTENTER( "Dial.NewL" ) + CVtUiDialer* self = NULL; + self = new ( ELeave ) CVtUiDialer( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "Dial.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiDialer::~CVtUiDialer +// --------------------------------------------------------------------------- +// +CVtUiDialer::~CVtUiDialer() + { + __VTPRINTENTER( "Dial.~" ) + delete iCmdOpen; + delete iCmdClose; + delete iDialerContainer; + __VTPRINTEXIT( "Dial.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialer::VideoWindow +// --------------------------------------------------------------------------- +// +MVtUiVideoWindow& CVtUiDialer::VideoWindow() const + { + __VTPRINTENTER( "Dial.VideoWindow" ) + __VTPRINTEXIT( "Dial.VideoWindow" ) + return *iDialerContainer->ComponentAsVideoWindow(); + } + +// --------------------------------------------------------------------------- +// CVtUiDialer::VideoControl +// --------------------------------------------------------------------------- +// +CCoeControl& CVtUiDialer::VideoControl() const + { + __VTPRINTENTER( "Dial.VideoControl" ) + __VTPRINTEXIT( "Dial.VideoControl" ) + return *static_cast< MVtUiComponent* > + ( iDialerContainer )->ComponentAsControl(); + } + +// --------------------------------------------------------------------------- +// CVtUiDialer::StartL +// --------------------------------------------------------------------------- +// +void CVtUiDialer::StartL() + { + __VTPRINTENTER( "Dial.StartL" ) + if ( State() == MVtUiFeature::EUnprepared ) + { + // Lower remote video control window priority + TInt pos = + iFeatureManager.AppUi().RemoteVideoControl().DrawableWindow()->OrdinalPosition(); + iFeatureManager.AppUi().RemoteVideoControl().DrawableWindow()-> + SetOrdinalPosition( pos, KVtDialerRVCPriLow ); + // Make context control and end call button invisible + iFeatureManager.AppUi().ContextControl().MakeVisible( EFalse ); + iFeatureManager.AppUi().EndCallButtonPane().MakeVisible( EFalse ); + iFeatureManager.UiStates().SetIsDialerActivating( ETrue ); + // fixed toolbar is set to be hidden + iFeatureManager.UiStates().SetIsFixedToolbarVisible( EFalse ); + if ( !VtUiLayout::IsLandscapeOrientation() ) + { + iFeatureManager.AppUi().CurrentFixedToolbar()->MakeVisible( EFalse ); + } + iFeatureManager.CommandManager().RefreshL(); + PrepareL(); + iFeatureManager.ComponentManager().RequestActivationL( + MVtUiComponent::EComponentIdDialer ); + iFeatureState = EActive; + iFeatureManager.AppUi().SwitchLayoutToFlatStatusPaneL( ETrue ); + } + __VTPRINTEXIT( "Dial.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialer::Stop +// --------------------------------------------------------------------------- +// +void CVtUiDialer::Stop() + { + __VTPRINTENTER( "Dial.Stop" ) + if ( State() == MVtUiFeature::EActive ) + { + // Lower remote video control window priority + TInt pos = + iFeatureManager.AppUi().RemoteVideoControl().DrawableWindow()->OrdinalPosition(); + iFeatureManager.AppUi().RemoteVideoControl().DrawableWindow()-> + SetOrdinalPosition( pos, KVtDialerRVCPriLow ); + + TInt error; + TRAP( error, + { + iFeatureManager.AppUi().SwitchLayoutToFlatStatusPaneL( EFalse ); + iFeatureManager.ComponentManager().DeActivateComponentL( + MVtUiComponent::EComponentIdDialer ); + } ); + Unprepare(); + iFeatureManager.AppUi().CurrentFixedToolbar()->MakeVisible( ETrue ); + // Make these two control back to visible + iFeatureManager.AppUi().EndCallButtonPane().MakeVisible( ETrue ); + iFeatureManager.AppUi().ContextControl().MakeVisible( ETrue ); + // Force a skin change event to appui then redraw main control + // and end call button + iFeatureManager.AppUi().HandleResourceChangeL( KAknsMessageSkinChange ); + iFeatureManager.AppUi().MainControl().DrawNow(); + iFeatureManager.AppUi().EndCallButtonPane().DrawNow(); + } + __VTPRINTEXIT( "Dial.Stop" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialer::InitFeatureL +// --------------------------------------------------------------------------- +// +void CVtUiDialer::InitFeatureL() + { + __VTPRINTENTER( "Dial.InitFeatureL" ) + iDialerContainer = + CVtUiDialerContainer::NewL( iFeatureManager ); + iCmdOpen = CVtUiCmdOpenDialer::NewL( iFeatureManager.CommandManager(), + *this ); + iCmdClose = CVtUiCmdCloseDialer::NewL( iFeatureManager.CommandManager(), + *this ); + __VTPRINTEXIT( "Dial.InitFeatureL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialer::CVtUiDialer +// --------------------------------------------------------------------------- +// +CVtUiDialer::CVtUiDialer( CVtUiFeatureManager& aFeatureManager ) + : CVtUiFeatureBase( EVtUiFeatureIdDialer, aFeatureManager ) + { + __VTPRINTENTER( "Dial.ctor" ) + __VTPRINTEXIT( "Dial.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialer::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiDialer::ConstructL() + { + __VTPRINTENTER( "Dial.ConstructL" ) + BaseConstructL(); + __VTPRINTEXIT( "Dial.ConstructL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialer::PrepareL +// --------------------------------------------------------------------------- +// +void CVtUiDialer::PrepareL() + { + __VTPRINTENTER( "Dial.PrepareL" ) + iDialerContainer->RegisterComponentL(); + iFeatureState = EReady; + __VTPRINTEXIT( "Dial.PrepareL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialer::Unprepare +// --------------------------------------------------------------------------- +// +void CVtUiDialer::Unprepare() + { + __VTPRINTENTER( "Dial.Unprepare" ) + iDialerContainer->UnregisterComponent(); + iFeatureState = EUnprepared; + __VTPRINTEXIT( "Dial.Unprepare" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/dialer/cvtuidialercontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/dialer/cvtuidialercontainer.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,535 @@ +/* +* Copyright (c) 2006 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: Dialer feature +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "VtUiUtility.h" +#include "VtUiLayout.h" +#include "mvtuicomponentmanager.h" +#include "cvtuidialercontainer.h" +#include "cvtuidialervideocontrol.h" +#include "tvtuiwsevent.h" +#include "tvtuistates.h" +#include "cvtuidialerskmodifier.h" +#include "cvtuifeaturemanager.h" +#include "CVtUiAppUi.h" +#include "mvtuicommandmanager.h" +#include "cvtuidtmfbuffer.h" +#include "CVtUiMainControl.h" +#include "CVtUiContextControl.h" +#include "CVtUiRemoteVideoControl.h" +#include "CVtUiEndCallButtonPane.h" +// Index of white color. +const TInt KVtUiColorWhite = 0; + +const TInt KVtUiActOrdinalPos = 2; +const TInt KVtUiDeactOrdinalPos = 4; + +// Implementation of TVtUiMiniDialerComponentState + +// --------------------------------------------------------------------------- +// TVtUiDialerComponentState::TVtUiDialerComponentState +// --------------------------------------------------------------------------- +// +TVtUiDialerComponentState::TVtUiDialerComponentState( + MVtUiComponent& aComponent ) : + TVtUiComponentState( aComponent, + TVtUiBlockListBitField( + MVtUiComponent::EComponentIdToolbar | + MVtUiComponent::EComponentIdNumberEntry ) ) + { + } + +// Implementation of CVtUiDialerContainer + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::NewL +// --------------------------------------------------------------------------- +// +CVtUiDialerContainer* CVtUiDialerContainer::NewL( + CVtUiFeatureManager& aFeatureManager ) + { + __VTPRINTENTER( "DialContainer.NewL" ) + CVtUiDialerContainer* self = + new ( ELeave ) CVtUiDialerContainer( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL( aFeatureManager.AppUi().BitmapManager() ); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "DialContainer.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::~CVtUiDialerContainer +// --------------------------------------------------------------------------- +// +CVtUiDialerContainer::~CVtUiDialerContainer() + { + __VTPRINTENTER( "DialContainer.~" ) + delete iAsyncDeactivate; + delete iVideoControl; + delete iDialer; + delete iSKModifier; + delete iInputBuffer; + delete iBgContext; + AknsUtils::DeregisterControlPosition( this ); + __VTPRINTEXIT( "DialContainer.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::HandleResourceChangeL +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::HandleResourceChangeL( TInt aType ) + { + __VTPRINTENTER( "DialContainer.HandleResourceChangeL" ) + switch ( aType ) + { + case KEikDynamicLayoutVariantSwitch: + case KAknsMessageSkinChange: + LayoutDialerContainer(); + break; + default: + break; + } + + CCoeControl::HandleResourceChange( aType ); + + __VTPRINTEXIT( "DialContainer.HandleResourceChangeL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::ComponentId +// --------------------------------------------------------------------------- +// +MVtUiComponent::TComponentId CVtUiDialerContainer::ComponentId() const + { + return EComponentIdDialer; + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::ComponentAsControl +// --------------------------------------------------------------------------- +// +CCoeControl* CVtUiDialerContainer::ComponentAsControl() + { + return iVideoControl; + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::DoActivateL +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::DoActivateL() + { + __VTPRINTENTER( "DialContainer.DoActivateL" ) + iUiStates.SetIsDialerActivating( EFalse ); + LayoutDialerContainer(); + Reset(); + + // Sort control windows' ordinal pos + TInt ordinalPos = KVtUiActOrdinalPos; + CVtUiAppUi& appUi = iFeatureManager->AppUi(); + appUi.MainControl().DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + appUi.MainControl().DrawableWindow()->OrdinalPriority() ); + + appUi.CurrentFixedToolbar()->DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + appUi.CurrentFixedToolbar()->DrawableWindow()->OrdinalPriority() ); + + iDialer->DrawableWindow()->SetOrdinalPosition( + ordinalPos--, iDialer->DrawableWindow()->OrdinalPriority() ); + + iVideoControl->MakeVisible( ETrue ); + iDialer->MakeVisible( ETrue ); + MakeVisible( ETrue ); + // Force a resource change and draw for the dialer + HandleResourceChange( KAknsMessageSkinChange ); + DrawNow(); + User::LeaveIfError( iFeatureManager-> + CommandManager().AddCommandModifier( *iSKModifier ) ); + iInputBuffer->Activate(); + iMode = CVtUiAppUi::ERenderingModeDialer; + TVtUiWsEvent< CVtUiAppUi::TRenderingMode > renderingEvent( + EVtUiWsEventBeginRenderingMode, &iMode ); + iCoeEnv->WsSession().SendEventToWindowGroup( + Window().WindowGroupId(), renderingEvent ); + iUiStates.SetIsDialerOpen( ETrue ); + iAsyncDeactivate->Cancel(); + __VTPRINTEXIT( "DialContainer.DoActivateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::DoDeactivateL +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::DoDeactivateL() + { + __VTPRINTENTER( "DialContainer.DoDeactivateL" ) + iFeatureManager->CommandManager(). + RemoveCommandModifier( *iSKModifier ); + iUiStates.SetIsDialerOpen( EFalse ); + + // Sort control windows' ordinal pos + TInt ordinalPos = KVtUiDeactOrdinalPos; + CVtUiAppUi& appUi = iFeatureManager->AppUi(); + appUi.MainControl().DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + appUi.MainControl().DrawableWindow()->OrdinalPriority() ); + + appUi.CurrentFixedToolbar()->DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + appUi.CurrentFixedToolbar()->DrawableWindow()->OrdinalPriority() ); + + appUi.EndCallButtonPane().DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + appUi.EndCallButtonPane().DrawableWindow()->OrdinalPriority() ); + + appUi.ContextControl().DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + appUi.ContextControl().DrawableWindow()->OrdinalPriority() ); + + appUi.RemoteVideoControl().DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + appUi.RemoteVideoControl().DrawableWindow()->OrdinalPriority() ); + + iVideoControl->MakeVisible( EFalse ); + iDialer->MakeVisible( EFalse ); + MakeVisible( EFalse ); + Reset(); + iInputBuffer->Deactivate(); + iAsyncDeactivate->CallBack(); + __VTPRINTEXIT( "DialContainer.DoDeactivateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::GetContents +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::GetContents( TDes& aContents ) const + { + __VTPRINTENTER( "DialContainer.GetContents" ) + iInputBuffer->GetContents( aContents ); + __VTPRINTEXIT( "DialContainer.GetContents" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::OfferKeyEventL +// --------------------------------------------------------------------------- +// +TKeyResponse CVtUiDialerContainer::OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode aType ) + { + __VTPRINTENTER( "DialContainer.OfferKeyEventL" ) + TKeyResponse response( EKeyWasNotConsumed ); + TChar dtmfTone; + if ( VtUiUtility::IsDTMFEvent( aEvent, dtmfTone ) && + ( aType == EEventKey ) ) + { + response = EKeyWasConsumed; + AppendDigit( dtmfTone ); + } + __VTPRINTEXIT( "DialContainer.OfferKeyEventL" ) + return response; + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::Draw +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::Draw( const TRect& ) const + { + __VTPRINTENTER( "DialContainer.Draw" ) + CWindowGc& gc( SystemGc() ); + gc.SetBrushStyle( CWindowGc::ESolidBrush ); + gc.SetPenStyle( CGraphicsContext::ENullPen ); + gc.SetBrushColor( AKN_LAF_COLOR( KVtUiColorWhite ) ); + gc.Clear(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, this, gc, Rect() ); + __VTPRINTEXIT( "DialContainer.Draw" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::SizeChanged +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::SizeChanged() + { + __VTPRINTENTER( "DialContainer.SizeChanged" ) + TRect bgRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, bgRect ); + iBgContext->SetRect( bgRect ); + + AknsUtils::RegisterControlPosition( this ); + CCoeControl::SizeChanged(); + __VTPRINTEXIT( "DialContainer.SizeChanged" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::PositionChanged +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::PositionChanged() + { + __VTPRINTENTER( "DialContainer.PositionChanged" ) + AknsUtils::RegisterControlPosition( this ); + CCoeControl::PositionChanged(); + __VTPRINTEXIT( "DialContainer.PositionChanged" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CVtUiDialerContainer::CountComponentControls() const + { + return iDialer ? 1 : 0; + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CVtUiDialerContainer::ComponentControl( TInt aIndex ) const + { + CCoeControl* result = NULL; + switch ( aIndex ) + { + case 0: + result = iDialer; + break; + default: + break; + } + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::CVtUiDialerContainer +// --------------------------------------------------------------------------- +// +CVtUiDialerContainer::CVtUiDialerContainer( + CVtUiFeatureManager& aFeatureManager ) : + iComponentState( *this ), + iFeatureManager( &aFeatureManager ), + iComponentManager( &aFeatureManager.ComponentManager() ), + iUiStates( aFeatureManager.UiStates() ) + { + __VTPRINTENTER( "DialContainer.ctor" ) + __VTPRINTEXIT( "DialContainer.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::ConstructL( CVtUiBitmapManager& aBitmapManager ) + { + __VTPRINTENTER( "DialContainer.ConstructL" ) + iBgContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDQsnBgScreen, Rect(), ETrue ); + CreateWindowL(); + DrawableWindow()->SetPointerGrab( ETrue ); + SetExtent( TPoint(), TSize() ); + ActivateL(); + MakeVisible( EFalse ); + iInputBuffer = CVtUiDTMFBuffer::NewL( *iCoeEnv ); + iVideoControl = CVtUiDialerVideoControl::NewL( aBitmapManager ); + iDialer = CVideoDTMFDialer::NewL( *this, *iVideoControl, DialerRect() ); + + iSKModifier = CVtUiDialerSKModifier::NewL( *iFeatureManager ); + // Disable fading when using DP (eliminates nasty color error) + if ( FeatureManager::FeatureSupported( KFeatureIdDisplayPost ) ) + { + Window().SetNonFading( ETrue ); + } + iAsyncDeactivate = new ( ELeave ) CAsyncCallBack( + TCallBack( ASyncDoDeactivate, this ), CActive::EPriorityLow ); + __VTPRINTEXIT( "DialContainer.ConstructL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::RegisterComponentL +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::RegisterComponentL() + { + __VTPRINTENTER( "DialContainer.RegisterComponentL" ) + User::LeaveIfError( iComponentManager->ChangeResourceChangeRegistration( + *this, MVtUiComponentManager::ERegister ) ); + User::LeaveIfError( + iComponentManager->ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::ERegister ) ); + User::LeaveIfError( iComponentManager->ChangeKeyEventRegistration( + *this, MVtUiComponentManager::ERegister ) ); + __VTPRINTEXIT( "DialContainer.RegisterComponentL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::UnregisterComponent +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::UnregisterComponent() + { + __VTPRINTENTER( "DialContainer.UnregisterComponent" ) + iComponentManager->ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::EUnregister ); + iComponentManager->ChangeResourceChangeRegistration( + *this, MVtUiComponentManager::EUnregister ); + iComponentManager->ChangeKeyEventRegistration( + *this, MVtUiComponentManager::EUnregister ); + __VTPRINTEXIT( "DialContainer.UnregisterComponent" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::UnregisterComponent +// --------------------------------------------------------------------------- +// +MVtUiVideoWindow* CVtUiDialerContainer::ComponentAsVideoWindow() + { + __VTPRINTENTER( "DialContainer.ComponentAsVideoWindow" ) + __VTPRINTEXIT( "DialContainer.ComponentAsVideoWindow" ) + return iVideoControl; + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::LayoutDialerContainer +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::LayoutDialerContainer() + { + __VTPRINTENTER( "DialContainer.LayoutDialerContainer" ) + + TAknWindowLineLayout mainPaneLL; + + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + // Landscape: Option11 (thin status pane, lsc) + mainPaneLL = AknLayoutScalable_Apps::main_pane( 15 ).LayoutLine(); + } + else + { + // Portrait: main pane with status pane off, control pane on + mainPaneLL = AknLayoutScalable_Apps::main_pane( 9 ).LayoutLine(); + } + + TRect appWinRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow, + appWinRect ); + + // Layout container + AknLayoutUtils::LayoutControl( this, appWinRect, mainPaneLL ); + + // Layout dialer + const TInt variety( Layout_Meta_Data::IsLandscapeOrientation() ? + 1 : 0 ); + TAknWindowLineLayout dialerLLout( + AknLayoutScalable_Apps::main_video_tele_dialer_pane( + variety ).LayoutLine() ); + AknLayoutUtils::LayoutControl( iDialer, Rect(), dialerLLout ); + + // Layout video control + AknLayoutUtils::LayoutControl( iVideoControl, iDialer->Rect(), + AknLayoutScalable_Apps::video_down_pane_cp( + variety ).LayoutLine() ); + + __VTPRINTEXIT( "DialContainer.LayoutDialerContainer" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::DialerRect +// --------------------------------------------------------------------------- +// +TRect CVtUiDialerContainer::DialerRect() const + { + __VTPRINTENTER( "DialContainer.DialerRect" ) + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect ); + __VTPRINTEXIT( "DialContainer.DialerRect" ) + return mainPaneRect; + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::Reset +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::Reset() + { + __VTPRINTENTER( "DialContainer.Reset" ) + iInputBuffer->Reset(); + __VTPRINTEXIT( "DialContainer.Reset" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::AppendDigit +// --------------------------------------------------------------------------- +// +void CVtUiDialerContainer::AppendDigit( TChar aDigit ) + { + __VTPRINTENTER( "DialContainer.AppendDigit" ) + iInputBuffer->Append( aDigit ); + __VTPRINTEXIT( "DialContainer.AppendDigit" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::MopSupplyObject +// --------------------------------------------------------------------------- +// +TTypeUid::Ptr CVtUiDialerContainer::MopSupplyObject( TTypeUid aId ) + { + __VTPRINTENTER( "CVtUiDialerContainer.MopSupplyObject" ) + // Required during rendering of the background skin in Draw() + if (aId.iUid == MAknsControlContext::ETypeId) + { + __VTPRINTEXIT( "CVtUiDialerContainer.MopSupplyObject.1" ) + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); + } + __VTPRINTEXIT( "CVtUiDialerContainer.MopSupplyObject.2" ) + return CCoeControl::MopSupplyObject( aId ); + } + +// --------------------------------------------------------------------------- +// CVtUiDialerContainer::ASyncDoDeactivate +// --------------------------------------------------------------------------- +// +TInt CVtUiDialerContainer::ASyncDoDeactivate( TAny* aSelf ) + { + __VTPRINTENTER( "DialContainer.ASyncDoDeactivate" ) + CVtUiDialerContainer* self = + reinterpret_cast< CVtUiDialerContainer* >( aSelf ); + self->iMode = CVtUiAppUi::ERenderingModeDialer; + TVtUiWsEvent< CVtUiAppUi::TRenderingMode > renderingEvent( + EVtUiWsEventEndRenderingMode, &self->iMode ); + self->iCoeEnv->WsSession().SendEventToWindowGroup( + self->Window().WindowGroupId(), renderingEvent ); + __VTPRINTEXIT( "DialContainer.ASyncDoDeactivate" ) + return KErrNone; + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/dialer/cvtuidialerskmodifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/dialer/cvtuidialerskmodifier.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2007 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: Softkey modifier class. +* +*/ + + +#include +#include "cvtuidialerskmodifier.h" +#include "mvtuicommandsetting.h" +#include "tvtuicommandmodifierpriority.h" +#include "cvtuifeaturemanager.h" +#include "tvtuistates.h" +#include "tvtuifeatureids.h" +#include "CVtUiAppUi.h" +#include +#include + + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiDialerSKModifier::NewL +// --------------------------------------------------------------------------- +// +CVtUiDialerSKModifier* CVtUiDialerSKModifier::NewL( + CVtUiFeatureManager& aFeatureMgr ) + { + __VTPRINTENTER( "CVtUiDialerSKModifier.NewL" ) + CVtUiDialerSKModifier* self = + new ( ELeave ) CVtUiDialerSKModifier( aFeatureMgr ); + __VTPRINTEXIT( "CVtUiDialerSKModifier.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiDialerSKModifier::~CVtUiDialerSKModifier +// --------------------------------------------------------------------------- +// +CVtUiDialerSKModifier::~CVtUiDialerSKModifier() + { + __VTPRINTENTER( "CVtUiDialerSKModifier.~" ) + __VTPRINTEXIT( "CVtUiDialerSKModifier.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerSKModifier::CVtUiDialerSKModifier +// --------------------------------------------------------------------------- +// +CVtUiDialerSKModifier::CVtUiDialerSKModifier( + CVtUiFeatureManager& aFeatureMgr ) + : CVtUiCommandModifyBase( EVtUiCmdModifierPriorityNumberEntry ), + iFeatureMgr( aFeatureMgr ) + { + __VTPRINTENTER( "CVtUiDialerSKModifier.Ctr" ) + __VTPRINTEXIT( "CVtUiDialerSKModifier.Ctr" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerSKModifier::ModifyCommandsL +// --------------------------------------------------------------------------- +// +void CVtUiDialerSKModifier::ModifyCommandsL( MVtUiCommandSetting& ) + { + __VTPRINTENTER( "CVtUiDialerSKModifier.ModifyCommandsL" ) + CEikButtonGroupContainer* cba = iFeatureMgr.AppUi().GetCba(); + cba->SetCommandSetL( R_VIDEOTELUI_SOFTKEYS_EMPTY_DIALEREXIT ); + __VTPRINTEXIT( "CVtUiDialerSKModifier.ModifyCommandsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerSKModifier::Supports +// --------------------------------------------------------------------------- +// +TBool CVtUiDialerSKModifier::Supports( + MVtUiCommandSetting::Type aType ) const + { + __VTPRINTENTER( "CVtUiDialerSKModifier.Supports" ) + __VTPRINTEXIT( "CVtUiDialerSKModifier.Supports" ) + return ( aType == MVtUiCommandSetting::ECommandTypeSoftkeys ); + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/dialer/cvtuidialervideocontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/dialer/cvtuidialervideocontrol.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2006 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: Mini dialer feature +* +*/ + + +#include +#include +#include +#include + +#include "cvtuidialervideocontrol.h" + +// Portrait variety constant +const static TInt KVarietyPortrait = 0; + +// Landscape variety constant +const static TInt KVarietyLandscape = 1; + +// Implementation of CVtUiDialerVideoControl + +// --------------------------------------------------------------------------- +// CVtUiDialerVideoControl::NewL +// --------------------------------------------------------------------------- +// +CVtUiDialerVideoControl* CVtUiDialerVideoControl::NewL( + CVtUiBitmapManager& aBitmapManager ) + { + __VTPRINTENTER( "DialCtrl.NewL" ) + CVtUiDialerVideoControl* self = + new ( ELeave ) CVtUiDialerVideoControl( aBitmapManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "DialCtrl.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiDialerVideoControl::~CVtUiDialerVideoControl +// --------------------------------------------------------------------------- +// +CVtUiDialerVideoControl::~CVtUiDialerVideoControl() + { + __VTPRINTENTER( "DialCtrl.~" ) + __VTPRINTEXIT( "DialCtrl.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerVideoControl::CVtUiDialerVideoControl +// --------------------------------------------------------------------------- +// +CVtUiDialerVideoControl::CVtUiDialerVideoControl( + CVtUiBitmapManager& aBitmapManager ) : + CVtUiVideoControlBase( aBitmapManager ) + { + __VTPRINTENTER( "DialCtrl.ctor" ) + // Disable blind icon drawing + SetRenderingHint( ENoBlindIcon ); + __VTPRINTEXIT( "DialCtrl.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiDialerVideoControl::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiDialerVideoControl::ConstructL() + { + __VTPRINTENTER( "DialCtrl.ConstructL" ) + BaseConstructL(); + __VTPRINTEXIT( "DialCtrl.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiDialerVideoControl::WaitingTextLayout +// ----------------------------------------------------------------------------- +// +TAknTextLineLayout CVtUiDialerVideoControl::WaitingTextLayout( TInt aLine ) + { + __VTPRINTENTER( "DialCtrl.WaitingTextLayout" ) + + TInt variety( Layout_Meta_Data::IsLandscapeOrientation() ? + KVarietyLandscape : KVarietyPortrait ); + + TAknWindowComponentLayout l2( + AknLayoutScalable_Apps::main_video_tele_dialer_pane( variety ) ); + + TAknTextComponentLayout l3; + +#if 0 + if ( variety == KVarietyPortrait ) + { + if ( !aLine ) + { + l3 = AknLayoutScalable_Apps::main_video_tele_dialer_pane_t1( 0 ); + } + else + { + l3 = AknLayoutScalable_Apps::main_video_tele_dialer_pane_t2( 0 ); + } + } + else + { + if ( !aLine ) + { + l3 = AknLayoutScalable_Apps::call_video_pane_t1(); + } + else + { + l3 = AknLayoutScalable_Apps::call_video_pane_t2(); + } + } +#endif + + if ( !aLine ) + { + l3 = AknLayoutScalable_Apps::main_video_tele_dialer_pane_t1( 0 ); + } + else + { + l3 = AknLayoutScalable_Apps::main_video_tele_dialer_pane_t2( 0 ); + } + + __VTPRINTEXIT( "DialCtrl.WaitingTextLayout" ) + return TAknWindowComponentLayout::ComposeText( l2, l3 ).LayoutLine(); + } + +// ----------------------------------------------------------------------------- +// CVtUiMainControl::LayoutRemoteVideo +// ----------------------------------------------------------------------------- +// +void CVtUiDialerVideoControl::LayoutRemoteVideo( ) + { + __VTPRINTENTER( "DialCtrl.LayoutRemoteVideo" ) + if ( NULL != iRemoteVideoControl && iRemoteVideoControl->IsVisible() ) + { + TRect rectRemoteVideo(StreamClippingRect()); + iRemoteVideoControl->SetExtent( PositionRelativeToScreen(),rectRemoteVideo.Size() ); + } + __VTPRINTEXIT( "DialCtrl.LayoutRemoteVideo" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/menu/cvtuimenucontext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/menu/cvtuimenucontext.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2006 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: Menu context class. +* +*/ + + +#include + +#include "cvtuimenucontext.h" + +/** Menu context reference priority */ +const TInt KVtUiMenuContextPriority = 100; + +// --------------------------------------------------------------------------- +// CVtUiMenuContext::~CVtUiMenuContext +// --------------------------------------------------------------------------- +// +CVtUiMenuContext::~CVtUiMenuContext() + { + __VTPRINTENTER( "MenuCtx.~" ) + UnregisterCommandContext(); + __VTPRINTEXIT( "MenuCtx.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenuContext::NewL +// --------------------------------------------------------------------------- +// +CVtUiMenuContext* CVtUiMenuContext::NewL( + MVtUiCommandManager& aCommandManager ) + { + __VTPRINTENTER( "MenuCtx.NewL" ) + CVtUiMenuContext* self = new ( ELeave ) CVtUiMenuContext( aCommandManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "MenuCtx.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiMenuContext::ValidateL +// --------------------------------------------------------------------------- +// +void CVtUiMenuContext::ValidateL( CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "MenuCtx.ValidateL" ) + ValidateMenuItemsL( aAction ); + __VTPRINTEXIT( "MenuCtx.ValidateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenuContext::CVtUiMenuContext +// --------------------------------------------------------------------------- +// +CVtUiMenuContext::CVtUiMenuContext( MVtUiCommandManager& aCommandManager ) + : CVtUiCmdContext( aCommandManager, EVtUiCmdContextTypeMenu, + KVtUiMenuContextPriority ) + { + __VTPRINTENTER( "MenuCtx.ctor" ) + __VTPRINTEXIT( "MenuCtx.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenuContext::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiMenuContext::ConstructL() + { + __VTPRINTENTER( "MenuCtx.ConstructL" ) + RegisterCommandContextL(); + __VTPRINTEXIT( "MenuCtx.ConstructL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/menu/cvtuimenuitemdimmeraction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/menu/cvtuimenuitemdimmeraction.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2006 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: Menu item dimmer action class. +* +*/ + + +#include +#include + +#include "cvtuimenuitemdimmeraction.h" +#include "tvtuicmdvalidatorcallback.h" +#include "tvtuimenucommanditerator.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiMenuItemDimmerAction::NewL +// --------------------------------------------------------------------------- +// +CVtUiMenuItemDimmerAction* CVtUiMenuItemDimmerAction::NewL() + { + __VTPRINTENTER( "MenuDimAct.NewL" ) + CVtUiMenuItemDimmerAction* self = + new ( ELeave ) CVtUiMenuItemDimmerAction(); + __VTPRINTEXIT( "MenuDimAct.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiMenuItemDimmerAction::SetMenuPane +// --------------------------------------------------------------------------- +// +void CVtUiMenuItemDimmerAction::SetMenuPane( CEikMenuPane* aMenuPane ) + { + __VTPRINTENTER( "MenuDimAct.SetMenuPane" ) + iMenuPane = aMenuPane; + __VTPRINTEXIT( "MenuDimAct.SetMenuPane" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenuItemDimmerAction::ProcessL +// --------------------------------------------------------------------------- +// +void CVtUiMenuItemDimmerAction::ProcessL( + const MVtUiCmdValidatorCallBack& aCallBack ) + { + __VTPRINTENTER( "MenuDimAct.ProcessL" ) + + if ( iMenuPane ) + { + for ( TVtUiMenuCommandIterator i( *iMenuPane ); i.HasNext(); ) + { + TInt commandId( i.Next() ); + if ( !IsCommandHandled( commandId ) ) + { + if ( aCallBack.Call( commandId ) ) + { + CommandHandledL( commandId ); + SetItemDimmed( commandId ); + } + } + } + } + __VTPRINTEXIT( "MenuDimAct.ProcessL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenuItemDimmerAction::EndProcess +// --------------------------------------------------------------------------- +// +void CVtUiMenuItemDimmerAction::EndProcess() + { + __VTPRINTENTER( "MenuDimAct.EndProcess" ) + iMenuPane = NULL; + __VTPRINTEXIT( "MenuDimAct.EndProcess" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenuItemDimmerAction::CVtUiMenuItemDimmerAction +// --------------------------------------------------------------------------- +// +CVtUiMenuItemDimmerAction::CVtUiMenuItemDimmerAction() + { + __VTPRINTENTER( "MenuDimAct.ctor" ) + __VTPRINTEXIT( "MenuDimAct.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenuItemDimmerAction::SetItemDimmed +// --------------------------------------------------------------------------- +// +void CVtUiMenuItemDimmerAction::SetItemDimmed( TInt aCommandId ) + { + __VTPRINTENTER( "MenuDimAct.SetItemDimmed" ) + iMenuPane->SetItemDimmed( aCommandId, ETrue ); + __VTPRINTEXIT( "MenuDimAct.SetItemDimmed" ) + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/menu/cvtuimenus.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/menu/cvtuimenus.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2006 - 2008 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: Mennu Ui feature class. +* +*/ + + +#include + +#include "cvtuimenus.h" +#include "cvtuimenucontext.h" +#include "cvtuimenuitemdimmeraction.h" +#include "cvtuifeaturemanager.h" +#include "cvtuicommandmanager.h" + +// --------------------------------------------------------------------------- +// CVtUiMenus::NewL +// --------------------------------------------------------------------------- +// +CVtUiMenus* CVtUiMenus::NewL( CVtUiFeatureManager& aFeatureManager ) + { + __VTPRINTENTER( "Menus.NewL" ) + CVtUiMenus* self = new ( ELeave ) CVtUiMenus( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "Menus.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiMenus::~CVtUiMenus +// --------------------------------------------------------------------------- +// +CVtUiMenus::~CVtUiMenus() + { + __VTPRINTENTER( "Menus.~" ) + delete iMenuCommandContext; + delete iMenuDimmerAction; + __VTPRINTEXIT( "Menus.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenus::SetMenuPane +// --------------------------------------------------------------------------- +// +void CVtUiMenus::SetMenuPane( CEikMenuPane* aMenuPane ) + { + __VTPRINTENTER( "Menus.SetMenuPane" ) + iMenuDimmerAction->SetMenuPane( aMenuPane ); + __VTPRINTEXIT( "Menus.SetMenuPane" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenus::StartL +// --------------------------------------------------------------------------- +// +void CVtUiMenus::StartL() + { + __VTPRINTENTER( "Menus.StartL" ) + __VTPRINTEXIT( "Menus.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenus::Stop +// --------------------------------------------------------------------------- +// +void CVtUiMenus::Stop() + { + __VTPRINTENTER( "Menus.Stop" ) + __VTPRINTEXIT( "Menus.Stop" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenus::InitFeatureL +// --------------------------------------------------------------------------- +// +void CVtUiMenus::InitFeatureL() + { + __VTPRINTENTER( "Menus.InitFeatureL" ) + __VTPRINTEXIT( "Menus.InitFeatureL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenus::RefreshL +// --------------------------------------------------------------------------- +// +void CVtUiMenus::RefreshL() + { + __VTPRINTENTER( "Menus.RefreshL" ) + iFeatureManager.CommandManager().ValidateMenuItemsL( *iMenuDimmerAction ); + __VTPRINTEXIT( "Menus.RefreshL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenus::AddCommandModifier +// --------------------------------------------------------------------------- +// +TInt CVtUiMenus::AddCommandModifier( CVtUiCommandModifyBase& ) + { + __VTPRINTENTER( "Menus.AddCommandModifier" ) + __VTPRINTEXIT( "Menus.AddCommandModifier" ) + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CVtUiMenus::RemoveCommandModifier +// --------------------------------------------------------------------------- +// +void CVtUiMenus::RemoveCommandModifier( CVtUiCommandModifyBase& ) + { + __VTPRINTENTER( "Menus.RemoveCommandModifier" ) + __VTPRINTEXIT( "Menus.RemoveCommandModifier" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenus::CVtUiMenus +// --------------------------------------------------------------------------- +// +CVtUiMenus::CVtUiMenus( CVtUiFeatureManager& aFeatureManager ) + : CVtUiFeatureBase( EVtUiFeatureIdMenu, aFeatureManager ) + { + __VTPRINTENTER( "Menus.ctor" ) + __VTPRINTEXIT( "Menus.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiMenus::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiMenus::ConstructL() + { + __VTPRINTENTER( "Menus.ConstructL" ) + iMenuCommandContext = + CVtUiMenuContext::NewL( iFeatureManager.CommandManager() ); + iMenuDimmerAction = CVtUiMenuItemDimmerAction::NewL(); + + // No need to add this to command manager as command UI. Menu is explicitly + // updated by CVtUiAppUi::DynInitMenuPaneL and in all other situations + // update is not needed because menu is not open. + // NOTE: If a command modifier is implemented for menu then it needs + // to be added to command UI. + __VTPRINTEXIT( "Menus.ConstructL" ) + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/menu/tvtuimenucommanditerator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/menu/tvtuimenucommanditerator.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2006 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: Menu command iterator. +* +*/ + + +#include + +#include "tvtuimenucommanditerator.h" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// TVtUiMenuCommandIterator::TVtUiMenuCommandIterator +// --------------------------------------------------------------------------- +// +TVtUiMenuCommandIterator::TVtUiMenuCommandIterator( CEikMenuPane& aMenuPane ) +: iMenuPane( &aMenuPane ), iCurrent( 0 ) + { + } + +// --------------------------------------------------------------------------- +// TVtUiMenuCommandIterator::HasNext +// --------------------------------------------------------------------------- +// +TBool TVtUiMenuCommandIterator::HasNext() const + { + return ( iCurrent < iMenuPane->NumberOfItemsInPane() ); + } + +// --------------------------------------------------------------------------- +// TVtUiMenuCommandIterator::Next +// --------------------------------------------------------------------------- +// +TInt TVtUiMenuCommandIterator::Next() + { + return iMenuPane->MenuItemCommandId( iCurrent++ ); + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/numberentry/CVtUiNumberEntryControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/numberentry/CVtUiNumberEntryControl.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,315 @@ +/* +* Copyright (c) 2004-2007 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: Implementation of the CVtUiNumberEntryControl control class. +* +*/ + + +// INCLUDE FILES +#include "CVtUiNumberEntryControl.h" +#include "VtUiLayout.h" +#include "VtUiUtility.h" +#include "mvtuicomponentmanager.h" +#include "tvtuistates.h" +#include "tvtuiwsevent.h" +#include "mvtuifeature.h" +#include "mvtuinumberentrycontrolobserver.h" +#include "cvtuidtmfbuffer.h" + +#include +#include +#include + +// CONSTANTS + +// ============================ MEMBER FUNCTIONS =============================== + +// Implementation for TVtUiNumberEntryComponentState + +// ----------------------------------------------------------------------------- +// TVtUiNumberEntryComponentState::TVtUiNumberEntryComponentState +// ----------------------------------------------------------------------------- +// +TVtUiNumberEntryComponentState::TVtUiNumberEntryComponentState( + MVtUiComponent& aComponent ) + : TVtUiComponentState( aComponent, + TVtUiBlockListBitField( + MVtUiComponent::EComponentIdDialer ) ) + { + } + +// Implementation for CVtUiNumberEntryControl + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::CVtUiNumberEntryControl +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiNumberEntryControl::CVtUiNumberEntryControl( + MVtUiFeature& aFeature, + TVtUiStates& aUiStates ) + : iFeature( aFeature ), + iComponentState( *this ), + iUiStates( aUiStates ) + { + __VTPRINTENTER( "NECtrl.ctor" ) + __VTPRINTEXIT( "NECtrl.ctor" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::ConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryControl::ConstructL( const TRect& aRect ) + { + __VTPRINTENTER( "NECtrl.ConstructL" ) + CreateWindowL(); + SetRect( aRect ); + ActivateL(); + MakeVisible( EFalse ); + iInputBuffer = CVtUiDTMFBuffer::NewL( *iCoeEnv ); + __VTPRINTEXIT( "NECtrl.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::~CVtUiNumberEntryControl +// Destructor. +// ----------------------------------------------------------------------------- +// +CVtUiNumberEntryControl::~CVtUiNumberEntryControl() + { + __VTPRINTENTER( "NECtrl.~" ) + AknsUtils::DeregisterControlPosition( this ); + delete iInputBuffer; + __VTPRINTEXIT( "NECtrl.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::OpenNumberEntry +// ----------------------------------------------------------------------------- +// +TBool CVtUiNumberEntryControl::OpenNumberEntry() + { + __VTPRINTENTER( "NECtrl.OpenNumberEntry" ) + TBool result( EFalse ); + if ( !iUiStates.IsNumberEntryOpen() ) + { + __VTPRINT( DEBUG_GEN, "VtUiNumberEntry.OPEN" ) + iInputBuffer->Activate(); + iUiStates.SetIsNumberEntryOpen( ETrue ); + result = ETrue; + } + __VTPRINTEXITR( "NECtrl.OpenNumberEntry %d", result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::IsNumberEntryOpen +// ----------------------------------------------------------------------------- +// +TBool CVtUiNumberEntryControl::IsNumberEntryOpen() const + { + __VTPRINTENTER( "NECtrl.IsNumberEntryOpen" ) + const TBool result( iUiStates.IsNumberEntryOpen() ); + __VTPRINTEXITR( "NECtrl.IsNumberEntryOpen %d",result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::CloseNumberEntry +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryControl::CloseNumberEntry() + { + __VTPRINTENTER( "NECtrl.CloseNumberEntry" ) + if ( iUiStates.IsNumberEntryOpen() ) + { + __VTPRINT( DEBUG_GEN, "NECtrl.CloseNumberEntry CLOSE" ) + iUiStates.SetIsNumberEntryOpen( EFalse ); + iInputBuffer->Deactivate(); + } + __VTPRINTEXIT( "NECtrl.CloseNumberEntry" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::RegisterComponentL +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryControl::RegisterComponentL( + MVtUiComponentManager& aComponentManager ) + { + __VTPRINTENTER( "NECtrl.RegisterComponentL" ) + User::LeaveIfError( aComponentManager.ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::ERegister ) ); + __VTPRINTEXIT( "NECtrl.RegisterComponentL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::UnregisterComponent +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryControl::UnregisterComponent( + MVtUiComponentManager& aComponentManager ) + { + __VTPRINTENTER( "NECtrl.UnregisterComponent" ) + iInputBuffer->Reset(); + aComponentManager.ChangeComponentRegistration( iComponentState, + MVtUiComponentManager::EUnregister ); + __VTPRINTEXIT( "NECtrl.UnregisterComponent" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::SetNumberEntryControlObserver +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryControl::SetNumberEntryControlObserver( + MVtUiNumberEntryControlObserver* aObserver ) + { + __VTPRINTENTER( "NECtrl.SetNumberEntryControlObserver" ) + iControlObserver = aObserver; + __VTPRINTEXIT( "NECtrl.SetNumberEntryControlObserver" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::OfferKeyEventL +// ----------------------------------------------------------------------------- +// +TKeyResponse CVtUiNumberEntryControl::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode ) + { + __VTPRINTENTER( "NECtrl.OfferKeyEventL" ) + + TKeyResponse resp( EKeyWasNotConsumed ); + + if ( IsDisplayingMenuOrDialog() || + aKeyEvent.iCode == EKeyLeftArrow || + aKeyEvent.iCode == EKeyRightArrow || + aKeyEvent.iCode == EKeyUpArrow || + aKeyEvent.iCode == EKeyDownArrow || + aKeyEvent.iCode == EKeyBackspace || + aKeyEvent.iCode == EKeyZoomIn || + aKeyEvent.iCode == EKeyZoomOut || + aKeyEvent.iScanCode == EStdKeyUpArrow || + aKeyEvent.iScanCode == EStdKeyDownArrow || + aKeyEvent.iScanCode == EStdKeyLeftArrow || + aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + return resp; + } + + TChar dtmfTone; + if ( VtUiUtility::IsDTMFEvent( aKeyEvent, dtmfTone ) ) + { + iInputBuffer->Append( dtmfTone ); + } + + __VTPRINTEXITR( "NECtrl.OfferKeyEvent %d", resp ) + return resp; + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::DoCloseNumberEntry +// ----------------------------------------------------------------------------- +// +TInt CVtUiNumberEntryControl::DoCloseNumberEntry( TAny* aAny ) + { + __VTPRINTENTER( "NECtrl.DoCloseNumberEntry" ) + CVtUiNumberEntryControl* self = + reinterpret_cast< CVtUiNumberEntryControl* >( aAny ); + self->HandleTimeoutCloseNumberEntry(); + __VTPRINTEXIT( "NECtrl.DoCloseNumberEntry" ) + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::HandleTimeoutCloseNumberEntry +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryControl::HandleTimeoutCloseNumberEntry() + { + __VTPRINTENTER( "NECtrl.HandleTimeoutCloseNumberEntry" ) + __VTPRINTEXIT( "NECtrl.HandleTimeoutCloseNumberEntry" ) + iFeature.Stop(); + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::IsDisplayingMenuOrDialog +// ----------------------------------------------------------------------------- +// +TBool CVtUiNumberEntryControl::IsDisplayingMenuOrDialog() const + { + __VTPRINTENTER( "NECtrl.IsDisplayingMenuOrDialog" ) + CEikMenuBar* menuBar = iEikonEnv->AppUiFactory()->MenuBar(); + const TBool result( CCoeEnv::Static()->AppUi()->IsDisplayingDialog() || + ( menuBar && menuBar->IsDisplayed() ) ); + __VTPRINTEXITR( "NECtrl.IsDisplayingMenuOrDialog %d", result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::ComponentId +// ----------------------------------------------------------------------------- +// +MVtUiComponent::TComponentId CVtUiNumberEntryControl::ComponentId() const + { + __VTPRINTENTER( "NECtrl.ComponentId" ) + __VTPRINTEXIT( "NECtrl.ComponentId" ) + return MVtUiComponent::EComponentIdNumberEntry; + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::ComponentAsControl +// ----------------------------------------------------------------------------- +// +CCoeControl* CVtUiNumberEntryControl::ComponentAsControl() + { + __VTPRINTENTER( "NECtrl.ComponentAsControl" ) + __VTPRINTEXIT( "NECtrl.ComponentAsControl" ) + return this; + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::DoActivateL +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryControl::DoActivateL() + { + __VTPRINTENTER( "NECtrl.DoActivateL" ) + OpenNumberEntry(); + if ( iControlObserver ) + { + iControlObserver->ControlActivatedL(); + } + __VTPRINTEXIT( "NECtrl.DoActivateL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::DoDeactivateL +// ----------------------------------------------------------------------------- +// +void CVtUiNumberEntryControl::DoDeactivateL() + { + __VTPRINTENTER( "NECtrl.DoDeactivateL" ) + CloseNumberEntry(); + if ( iControlObserver ) + { + iControlObserver->ControlDeactivated(); + } + __VTPRINTEXIT( "NECtrl.DoDeactivateL" ) + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/numberentry/cvtuinumberentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/numberentry/cvtuinumberentry.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,215 @@ +/* +* Copyright (c) 2006 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: Number entry UI feature implementation. +* +*/ + + +#include + +#include "cvtuinumberentry.h" +#include "cvtuifeaturemanager.h" +#include "mvtuicommandmanager.h" +#include "mvtuicomponentmanager.h" +#include "mvtuicommandui.h" +#include "tvtuifeatureids.h" +#include "CVtUiNumberEntryControl.h" +#include "CVtUiAppUi.h" + + +// We need this to be able to make control's priority lower than activation +// control's priority is +extern const TInt KVtUiNumberEntryActivationPriority; + +// Priority of number entry control. +const TInt KVtUiNumberEntryControlPriorityHidden = + KVtUiNumberEntryActivationPriority - 1; + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::NewL +// --------------------------------------------------------------------------- +// +CVtUiNumberEntry* CVtUiNumberEntry::NewL( + CVtUiFeatureManager& aFeatureManager ) + { + __VTPRINTENTER( "NE.NewL" ) + CVtUiNumberEntry* self = + new ( ELeave ) CVtUiNumberEntry( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "NE.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::~CVtUiNumberEntry +// --------------------------------------------------------------------------- +// +CVtUiNumberEntry::~CVtUiNumberEntry() + { + __VTPRINTENTER( "NE.~" ) + DeleteNumberEntryControl(); + __VTPRINTEXIT( "NE.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::StartL +// --------------------------------------------------------------------------- +// +void CVtUiNumberEntry::StartL() + { + __VTPRINTENTER( "NE.StartL" ) + if ( State() == MVtUiFeature::EUnprepared ) + { + PrepareL(); + iFeatureManager.ComponentManager().RequestActivationL( + MVtUiComponent::EComponentIdNumberEntry ); + iFeatureState = MVtUiFeature::EActive; + } + __VTPRINTEXIT( "NE.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::Stop +// --------------------------------------------------------------------------- +// +void CVtUiNumberEntry::Stop() + { + __VTPRINTENTER( "NE.Stop" ) + if ( State() == MVtUiFeature::EActive ) + { + TRAP_IGNORE( iFeatureManager.ComponentManager().DeActivateComponentL( + MVtUiComponent::EComponentIdNumberEntry ) ); + iFeatureState = MVtUiFeature::EReady; + } + Unprepare(); + __VTPRINTEXIT( "NE.Stop" ) + } + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::InitFeatureL +// --------------------------------------------------------------------------- +// +void CVtUiNumberEntry::InitFeatureL() + { + __VTPRINTENTER( "NE.InitFeatureL" ) + CreateNumberEntryControlL(); + __VTPRINTEXIT( "NE.InitFeatureL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::ControlActivated +// --------------------------------------------------------------------------- +// +void CVtUiNumberEntry::ControlActivatedL() + { + __VTPRINTENTER( "NE.ControlActivatedL" ) + __VTPRINTEXIT( "NE.ControlActivatedL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::ControlDeactivated +// --------------------------------------------------------------------------- +// +void CVtUiNumberEntry::ControlDeactivated() + { + __VTPRINTENTER( "NE.ControlDeactivated" ) + __VTPRINTEXIT( "NE.ControlDeactivated" ) + } + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::CVtUiNumberEntry +// --------------------------------------------------------------------------- +// +CVtUiNumberEntry::CVtUiNumberEntry( CVtUiFeatureManager& aFeatureManager ) + : CVtUiFeatureBase( EVtUiFeatureIdNumberEntry, aFeatureManager ) + { + __VTPRINTENTER( "NE.ctor" ) + __VTPRINTEXIT( "NE.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiNumberEntry::ConstructL() + { + __VTPRINTENTER( "NE.ConstructL" ) + BaseConstructL(); + __VTPRINTEXIT( "NE.ConstructL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::PrepareL +// --------------------------------------------------------------------------- +// +void CVtUiNumberEntry::PrepareL() + { + __VTPRINTENTER( "NE.PrepareL" ) + iNumberEntryControl->SetNumberEntryControlObserver( this ); + iNumberEntryControl->RegisterComponentL( + iFeatureManager.ComponentManager() ); + iFeatureManager.AppUi().AddToStackL( iNumberEntryControl, + KVtUiNumberEntryControlPriorityHidden, ECoeStackFlagRefusesFocus ); + iFeatureState = MVtUiFeature::EReady; + __VTPRINTEXIT( "NE.PrepareL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::Unprepare() +// --------------------------------------------------------------------------- +// +void CVtUiNumberEntry::Unprepare() + { + __VTPRINTENTER( "NE.Unprepare" ) + if ( iFeatureState > MVtUiFeature::EUnprepared ) + { + iNumberEntryControl->SetNumberEntryControlObserver( NULL ); + iFeatureManager.AppUi().RemoveFromStack( iNumberEntryControl ); + iNumberEntryControl->UnregisterComponent( + iFeatureManager.ComponentManager() ); + iFeatureState = MVtUiFeature::EUnprepared; + } + __VTPRINTEXIT( "NE.Unprepare" ) + } + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::CreateNumberEntryControlL +// --------------------------------------------------------------------------- +// +void CVtUiNumberEntry::CreateNumberEntryControlL() + { + __VTPRINTENTER( "NE.CreateNumberEntryControlL" ) + iNumberEntryControl = new ( ELeave ) CVtUiNumberEntryControl( *this, + iFeatureManager.UiStates() ); + iNumberEntryControl->ConstructL( TRect() ); + iNumberEntryControl->SetMopParent( &iFeatureManager.AppUi() ); + __VTPRINTEXIT( "NE.CreateNumberEntryControlL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiNumberEntry::DeleteNumberEntryControl +// --------------------------------------------------------------------------- +// +void CVtUiNumberEntry::DeleteNumberEntryControl() + { + __VTPRINTENTER( "NE.DeleteNumberEntryControl" ) + delete iNumberEntryControl; + iNumberEntryControl = NULL; + iFeatureState = MVtUiFeature::EUnprepared; + __VTPRINTEXIT( "NE.DeleteNumberEntryControl" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/prefs/cvtuibrightness.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/prefs/cvtuibrightness.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2006 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: implementation. +* +*/ + + +#include +#include "cvtuibrightness.h" +#include "tvtuifeatureids.h" +#include "cvtuibrightnesspopup.h" +#include "cvtuipopupbase.h" +#include "cvtuiprefsliderbase.h" +#include "videotelui.hrh" +#include "cvtuifeaturemanager.h" +#include "tvtuistates.h" + +// --------------------------------------------------------------------------- +// CVtUiBrightness::NewL +// --------------------------------------------------------------------------- +// +CVtUiBrightness* CVtUiBrightness::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "CVtUiBrightness.NewL" ) + CVtUiBrightness* self = + new ( ELeave ) CVtUiBrightness( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + __VTPRINTEXIT( "CVtUiBrightness.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiBrightness::~CVtUiBrightness +// --------------------------------------------------------------------------- +// +CVtUiBrightness::~CVtUiBrightness() + { + __VTPRINTENTER( "CVtUiBrightness.~" ) + __VTPRINTEXIT( "CVtUiBrightness.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiBrightness::StartL +// --------------------------------------------------------------------------- +// +void CVtUiBrightness::StartL() + { + __VTPRINTENTER( "CVtUiBrightness.StartL" ) + CVtUiPrefSliderBase::StartL(); + iFeatureManager.UiStates().SetBrightnessModeOn( ETrue ); + __VTPRINTEXIT( "CVtUiBrightness.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiBrightness::Stop +// --------------------------------------------------------------------------- +// +void CVtUiBrightness::Stop() + { + __VTPRINTENTER( "CVtUiBrightness.Stop" ) + CVtUiPrefSliderBase::Stop(); + iFeatureManager.UiStates().SetBrightnessModeOn( EFalse ); + __VTPRINTEXIT( "CVtUiBrightness.Stop" ) + } + +// --------------------------------------------------------------------------- +// CVtUiBrightness::CVtUiBrightness +// --------------------------------------------------------------------------- +// +CVtUiBrightness::CVtUiBrightness( CVtUiFeatureManager& aFeatureManager ) + : CVtUiPrefSliderBase( aFeatureManager, EVtUiFeatureIdBrightness ) + { + __VTPRINTENTER( "CVtUiBrightness.CVtUiBrightness" ) + __VTPRINTEXIT( "CVtUiBrightness.CVtUiBrightness" ) + } + +// --------------------------------------------------------------------------- +// CVtUiBrightness::CVtUiBrightness +// --------------------------------------------------------------------------- +// +void CVtUiBrightness:: ConstructL() + { + __VTPRINTENTER( "CVtUiBrightness.ConstructL" ) + BaseConstructL(); + SetPopup( CVtUiBrightnessPopup::NewL( iFeatureManager ) ); + __VTPRINTEXIT( "CVtUiBrightness.ConstructL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/prefs/cvtuibrightnesspopup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/prefs/cvtuibrightnesspopup.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2006 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: implementation. +* +*/ + + + +#include +#include +#include "cvtuibrightnesspopup.h" +#include "tvtuilocalvariation.h" +#include "mvtuicomponent.h" +#include "CVtUiAppUi.h" +#include "mvtuicomponentmanager.h" +#include "tvtuicomponentstate.h" +#include + +// --------------------------------------------------------------------------- +// CVtUiBrightnessPopup::NewL +// --------------------------------------------------------------------------- +// +CVtUiBrightnessPopup* CVtUiBrightnessPopup::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "CVtUiBrightnessPopup.NewL" ) + CVtUiBrightnessPopup* self = + new ( ELeave ) CVtUiBrightnessPopup( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + __VTPRINTEXIT( "CVtUiBrightnessPopup.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiBrightnessPopup::~CVtUiBrightnessPopup +// --------------------------------------------------------------------------- +// +CVtUiBrightnessPopup::~CVtUiBrightnessPopup() + { + __VTPRINTENTER( "CVtUiBrightnessPopup.~" ) + __VTPRINTEXIT( "CVtUiBrightnessPopup.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiBrightnessPopup::CurrentValue +// --------------------------------------------------------------------------- +// +TInt CVtUiBrightnessPopup::CurrentValue() + { + __VTPRINTENTER( "CVtUiBrightnessPopup.CurrentValue" ) + // ask from engine current value + TInt value; + if ( iCameraPref->GetBrightness( value) ) + { + __VTPRINTEXIT( "CVtUiBrightnessPopup.CurrentValueERR" ) + return 0; + } + __VTPRINTEXIT( "CVtUiBrightnessPopup.CurrentValue" ) + return value; + } +// --------------------------------------------------------------------------- +// CVtUiBrightnessPopup::CVtUiBrightnessPopup +// --------------------------------------------------------------------------- +// +CVtUiBrightnessPopup::CVtUiBrightnessPopup( CVtUiFeatureManager& aFeatureManager ) + : CVtUiPrefPopupBase( aFeatureManager, TVtUiBlockListBitField( + MVtUiComponent::EComponentIdDialer | + MVtUiComponent::EComponentIdToolbar | + MVtUiComponent::EComponentIdNumberEntry | + MVtUiComponent::EComponentIdVolume | + MVtUiComponent::EComponentIdZoom | + MVtUiComponent::EVComponentIdContrast ), EVComponentIdBrightness, + KVtEngSetBrightness ) + { + + __VTPRINTENTER( "CVtUiBrightnessPopup.CVtUiBrightnessPopup" ) + __VTPRINTEXIT( "CVtUiBrightnessPopup.CVtUiBrightnessPopup" ) + } + +// --------------------------------------------------------------------------- +// CVtUiBrightnessPopup::CVtUiBrightnessPopup +// --------------------------------------------------------------------------- +// +void CVtUiBrightnessPopup:: ConstructL() + { + __VTPRINTENTER( "CVtUiBrightnessPopup.ConstructL" ) + BaseConstructL(); + __VTPRINTEXIT( "CVtUiBrightnessPopup.ConstructL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/prefs/cvtuicolortone.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/prefs/cvtuicolortone.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,383 @@ +/* +* Copyright (c) 2006 - 2008 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: Color tone UI feature implementation. +* +*/ + + +#include +#include +#include +#include +#include "cvtuicolortone.h" +#include "tvtuifeatureids.h" +#include +#include "mvtuicomponentmanager.h" +#include "cvtuifeaturemanager.h" +#include "CVtUiAppUi.h" +#include "tvtuilocalvariation.h" +#include "cvtuifeaturemanager.h" +#include "tvtuistates.h" +#include "cvtuicommandmanager.h" + +// Implementation of TVtUiColorToneComponentState + +// --------------------------------------------------------------------------- +// TVtUiColorToneComponentState::TVtUiColorToneComponentState +// --------------------------------------------------------------------------- +// +TVtUiColorToneComponentState::TVtUiColorToneComponentState( + MVtUiComponent& aComponent ) : + TVtUiComponentState( aComponent, + TVtUiBlockListBitField( + MVtUiComponent::EComponentIdDialer | + MVtUiComponent::EComponentIdToolbar | + MVtUiComponent::EComponentIdNumberEntry ) ) + { + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::NewL +// --------------------------------------------------------------------------- +// +CVtUiColorTone* CVtUiColorTone::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "UiColorTone.NewL" ) + CVtUiColorTone* self = + new ( ELeave ) CVtUiColorTone( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + __VTPRINTEXIT( "UiColorTone.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::~CVtUiColorTone +// --------------------------------------------------------------------------- +// +CVtUiColorTone::~CVtUiColorTone() + { + __VTPRINTENTER( "UiColorTone.~" ) + // unregister layout change + iFeatureManager.ComponentManager().ChangeLayoutChangeRegistration( + *this, MVtUiComponentManager::EUnregister ); + // unregister component + iFeatureManager.ComponentManager().ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::EUnregister ); + __VTPRINTEXIT( "UiColorTone.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::StartL +// --------------------------------------------------------------------------- +// +void CVtUiColorTone::StartL() + { + __VTPRINTENTER( "UiColorTone.StartL" ) + if ( iFeatureState == MVtUiFeature::EReady ) + { + iFeatureManager.AppUi().EnableCommandActivatingAndCleanupPushL(); + iFeatureManager.UiStates().SetIsFixedToolbarVisible( EFalse ); + iFeatureManager.ComponentManager(). + RequestActivationL ( MVtUiComponent::EComponentIdColorTone ); + CleanupStack::Pop(); // EnableCommandActivatingAndCleanupPushL + // set state + iFeatureState = MVtUiFeature::EActive; + } + __VTPRINTEXIT( "UiColorTone.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::Stop +// --------------------------------------------------------------------------- +// +void CVtUiColorTone::Stop() + { + __VTPRINTENTER( "UiColorTone.Stop" ) + iAsyncCallback->Cancel(); + iAsyncCallback->Set( TCallBack( &DoStopL, this ) ); + iAsyncCallback->CallBack(); + __VTPRINTEXIT( "UiColorTone.Stop" ) + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::InitFeatureL +// --------------------------------------------------------------------------- +// +void CVtUiColorTone::InitFeatureL() + { + __VTPRINTENTER( "UiColorTone.InitFeatureL" ) + CVtUiPrefSettingListBase::InitFeatureL(); + User::LeaveIfError( + iFeatureManager.ComponentManager().ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::ERegister ) ); + User::LeaveIfError( + iFeatureManager.ComponentManager().ChangeLayoutChangeRegistration( + *this, MVtUiComponentManager::ERegister ) ); + iFeatureState = EReady; + __VTPRINTEXIT( "UiColorTone.InitFeatureL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::ComponentId +// --------------------------------------------------------------------------- +// +MVtUiComponent::TComponentId CVtUiColorTone::ComponentId() const + { + __VTPRINTENTER( "UiColorTone.ComponentId" ) + __VTPRINTEXIT( "UiColorTone.ComponentId" ) + return MVtUiComponent::EComponentIdColorTone; + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::ComponentAsControl +// --------------------------------------------------------------------------- +// +CCoeControl* CVtUiColorTone::ComponentAsControl() + { + __VTPRINTENTER( "UiColorTone.ComponentAsControl" ) + __VTPRINTEXIT( "UiColorTone.ComponentAsControl" ) + return NULL; + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::DoActivateL +// --------------------------------------------------------------------------- +// +void CVtUiColorTone::DoActivateL() + { + __VTPRINTENTER( "UiColorTone.DoActivateL" ) + // get supported color tone modes + iCameraPref->GetSupportedColorTones( iSupportedModes ); + __VTPRINT2( DEBUG_GEN, "UiColorTone.ConstructL=%d", iSupportedModes ) + iFeatureManager.UiStates().SetColorToneModeOn( ETrue ); + iAsyncCallback->Cancel(); + iAsyncCallback->Set( TCallBack( &DoStartL, this ) ); + iAsyncCallback->CallBack(); + __VTPRINTEXIT( "UiColorTone.DoActivateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::DoDeactivateL +// --------------------------------------------------------------------------- +// +void CVtUiColorTone::DoDeactivateL() + { + __VTPRINTENTER( "UiColorTone.DoDeactivateL" ) + iFeatureManager.UiStates().SetColorToneModeOn( EFalse ); + CVtUiPrefSettingListBase::StopSettingPageL(); + __VTPRINTEXIT( "UiColorTone.DoDeactivateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::HandleLayoutChangeL +// --------------------------------------------------------------------------- +// +void CVtUiColorTone::HandleLayoutChangeL() + { + __VTPRINTENTER( "UiColorTone.HandleLayoutChangeL" ) + if ( iFeatureState == MVtUiFeature::EActive ) + { + SizeChanged(); + } + __VTPRINTEXIT( "UiColorTone.HandleLayoutChangeL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::CurrentSelection +// --------------------------------------------------------------------------- +// +TInt CVtUiColorTone::CurrentSelection() + { + __VTPRINTENTER( "UiColorTone.CurrentSelection" ) + // ask from engine which item is currently active + MVtEngCameraPreferences::TColorTone wb; + if ( iCameraPref->GetColorTone( wb ) ) + { + __VTPRINTEXIT( "UiColorTone.CurrentSelectionERR" ) + // if error occured return 0 i.e. first list item + return 0; + } + __VTPRINTEXIT( "UiColorTone.CurrentSelection" ) + return MapCTEnumToArrayIndex( wb ); + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::SetItemsL +// --------------------------------------------------------------------------- +// +void CVtUiColorTone::SetItemsL( CDesCArray& aArray ) + { + __VTPRINTENTER( "UiColorTone.SetItemsL<" ) + __VTPRINT2( DEBUG_GEN, "UiColorTone.SetItemsL=%d", iSupportedModes ) + // Normal mode allways supported + ReadAndAppendItemL( aArray, R_VIDEOTELUI_QTN_INCAL_CT_NORMAL_OPTION ); + iActiveItems.Append( MVtEngCameraPreferences::ENormal ); + + if( iSupportedModes & MVtEngCameraPreferences::ESepia ) + { + ReadAndAppendItemL( aArray, R_VIDEOTELUI_QTN_INCAL_SEPIA_OPTION ); + iActiveItems.Append( MVtEngCameraPreferences::ESepia ); + } + if( iSupportedModes & MVtEngCameraPreferences::EGrayscale ) + { + ReadAndAppendItemL( aArray, R_VIDEOTELUI_QTN_INCAL_B_AND_W_OPTION ); + iActiveItems.Append( MVtEngCameraPreferences::EGrayscale ); + } + if( iSupportedModes & MVtEngCameraPreferences::ENegative ) + { + ReadAndAppendItemL( aArray, R_VIDEOTELUI_QTN_INCAL_NEGATIVE_OPTION ); + iActiveItems.Append( MVtEngCameraPreferences::ENegative ); + } + __VTPRINTEXIT( "UiColorTone.SetItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::SettingPageResId +// --------------------------------------------------------------------------- +// +TInt CVtUiColorTone::SettingPageResId() const + { + __VTPRINTENTER( "UiColorTone.SettingPageResId" ) + __VTPRINTEXIT( "UiColorTone.SettingPageResId" ) + return R_VIDEOTELUI_COLOR_TONE_SETTING_PAGE; + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::SettingPageItemChanged +// --------------------------------------------------------------------------- +// +void CVtUiColorTone::SettingPageItemChangedL( TInt aIndex ) + { + __VTPRINTENTER( "CVtUiColorTone.SettingPageItemChangedL" ) + __VTPRINT2( DEBUG_GEN, "CVtUiColorTone.index=%d", aIndex ) + if ( iFeatureManager.UiStates().ExecState() == TVtUiStates::EExecStateResetting ) + { + __VTPRINTEXIT( "CVtUiColorTone.SettingPageItemChangedL" ) + return; + } + // Map index to right color tone value + MVtEngCameraPreferences::TColorTone ct = MapArrayIndexToCTEnum( aIndex ); + + // cast the parameter + TPtrC8 params( reinterpret_cast< TUint8* >( &ct ), + sizeof( MVtEngCameraPreferences::TColorTone ) ); + + // Adjust color tone + MVtEngMedia::TCameraId currentCamId; + iFeatureManager.AppUi().Model().Media().GetCurrentCameraId( currentCamId ); + if( currentCamId == MVtEngMedia::ESecondaryCamera ) + { + iFeatureManager.AppUi().DoExecuteCmdL( KVtEngSetColorTone, ¶ms ); + iPendingSettingChangeCmd = EFalse; + } + else + iPendingSettingChangeCmd = ETrue; + __VTPRINTEXIT( "CVtUiColorTone.SettingPageItemChangedL" ) + } + + +// --------------------------------------------------------------------------- +// CVtUiColorTone::CVtUiColorTone +// --------------------------------------------------------------------------- +// +CVtUiColorTone::CVtUiColorTone( CVtUiFeatureManager& aFeatureManager ) + : CVtUiPrefSettingListBase( aFeatureManager, EVtUiFeatureIdColourTone ), + iComponentState( *this ) + { + __VTPRINTENTER( "UiColorTone.UiColorTone" ) + __VTPRINTEXIT( "UiColorTone.UiColorTone" ) + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::MapCTEnumToArrayIndex +// --------------------------------------------------------------------------- +// +TInt CVtUiColorTone::MapCTEnumToArrayIndex( MVtEngCameraPreferences:: + TColorTone& aColorTone ) const + { + __VTPRINTENTER( "CVtUiColorTone.MapCTEnumToArrayIndex" ) + __VTPRINT2( DEBUG_GEN, "CVtUiColorTone.cpunt=%d", iActiveItems.Count() ) + for ( TInt i = 0; i < iActiveItems.Count(); ++i ) + { + if ( iActiveItems [ i ] == aColorTone ) + { + __VTPRINT2( DEBUG_GEN, "CVtUiColorTone.index=%d", i ) + __VTPRINTEXIT( "CVtUiColorTone.MapCTEnumToArrayIndex" ) + return i; + } + } + __VTPRINTEXIT( "CVtUiColorTone.MapCTEnumToArrayIndex" ) + // not found + return KErrNotFound; + } +// --------------------------------------------------------------------------- +// CVtUiColorTone::MapArrayIndexToCTEnum +// --------------------------------------------------------------------------- +// +MVtEngCameraPreferences::TColorTone CVtUiColorTone::MapArrayIndexToCTEnum( + TInt aIndex) const + { + __VTPRINTENTER( "TColorTone.MapArrayIndexToCTEnum" ) + __VTPRINT2( DEBUG_GEN, "TColorTone.index=%d", aIndex ) + __VTPRINT2( DEBUG_GEN, "TColorTone.count=%d", iActiveItems.Count() ) + const TInt count = iActiveItems.Count(); + if ( count > 0 && aIndex < count && aIndex >= 0 ) + { + __VTPRINTEXIT( "TColorTone.MapArrayIndexToCTEnum" ) + return static_cast< MVtEngCameraPreferences::TColorTone > + ( iActiveItems[ aIndex ] ); + } + else // not valid index return first item in the list + { + __VTPRINTEXIT( "TColorTone.MapArrayIndexToCTEnum_ERROR_INDEX" ) + return static_cast< MVtEngCameraPreferences::TColorTone > + ( iActiveItems[ 0 ] ); + } + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::DoStop +// --------------------------------------------------------------------------- +// +TInt CVtUiColorTone::DoStopL( TAny* aAny ) + { + __VTPRINTENTER( "CVtUiColorTone.DoStopL" ) + CVtUiColorTone* self = static_cast< CVtUiColorTone* >( aAny ); + if ( self->iFeatureState == MVtUiFeature::EActive ) + { + self->iFeatureManager.ComponentManager(). + DeActivateComponentL ( MVtUiComponent::EComponentIdColorTone ); + // set state + self->iFeatureState = MVtUiFeature::EReady; + } + __VTPRINTEXIT( "CVtUiColorTone.DoStopL" ) + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CVtUiColorTone::DoStart +// --------------------------------------------------------------------------- +// +TInt CVtUiColorTone::DoStartL( TAny* aAny ) + { + __VTPRINTENTER( "CVtUiColorTone.DoStart" ) + CVtUiColorTone* self = static_cast< CVtUiColorTone* >( aAny ); + self->CVtUiPrefSettingListBase::StartSettingPageL(); + self->iFeatureManager.UiStates().SetIsCommandActivating( EFalse ); + __VTPRINTEXIT( "CVtUiColorTone.DoStart" ) + return KErrNone; + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/prefs/cvtuicontrast.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/prefs/cvtuicontrast.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2006 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: implementation. +* +*/ + + +#include +#include "cvtuicontrast.h" +#include "tvtuifeatureids.h" +#include "cvtuicontrastpopup.h" +#include "cvtuipopupbase.h" +#include "videotelui.hrh" +#include "cvtuifeaturemanager.h" +#include "tvtuistates.h" + +// --------------------------------------------------------------------------- +// CVtUiContrast::NewL +// --------------------------------------------------------------------------- +// +CVtUiContrast* CVtUiContrast::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "CVtUiContrast.NewL" ) + CVtUiContrast* self = + new ( ELeave ) CVtUiContrast( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + __VTPRINTEXIT( "CVtUiContrast.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiContrast::~CVtUiContrast +// --------------------------------------------------------------------------- +// +CVtUiContrast::~CVtUiContrast() + { + __VTPRINTENTER( "CVtUiContrast.~" ) + __VTPRINTEXIT( "CVtUiContrast.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiContrast::StartL +// --------------------------------------------------------------------------- +// +void CVtUiContrast::StartL() + { + __VTPRINTENTER( "CVtUiContrast.StartL" ) + CVtUiPrefSliderBase::StartL(); + iFeatureManager.UiStates().SetContrastModeOn( ETrue ); + __VTPRINTEXIT( "CVtUiContrast.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiContrast::Stop +// --------------------------------------------------------------------------- +// +void CVtUiContrast::Stop() + { + __VTPRINTENTER( "CVtUiContrast.Stop" ) + CVtUiPrefSliderBase::Stop(); + iFeatureManager.UiStates().SetContrastModeOn( EFalse ); + __VTPRINTEXIT( "CVtUiContrast.Stop" ) + } + +// --------------------------------------------------------------------------- +// CVtUiContrast::CVtUiContrast +// --------------------------------------------------------------------------- +// +CVtUiContrast::CVtUiContrast( CVtUiFeatureManager& aFeatureManager ) + : CVtUiPrefSliderBase( aFeatureManager, EVtUiFeatureIdContrast ) + { + __VTPRINTENTER( "CVtUiContrast.CVtUiContrast" ) + __VTPRINTEXIT( "CVtUiContrast.CVtUiContrast" ) + } + +// --------------------------------------------------------------------------- +// CVtUiContrast::CVtUiContrast +// --------------------------------------------------------------------------- +// +void CVtUiContrast:: ConstructL() + { + __VTPRINTENTER( "CVtUiContrast.ConstructL" ) + BaseConstructL(); + SetPopup( CVtUiContrastPopup::NewL( iFeatureManager ) ); + __VTPRINTEXIT( "CVtUiContrast.ConstructL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/prefs/cvtuicontrastpopup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/prefs/cvtuicontrastpopup.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2006 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: Implementation of Contrast popup +* +*/ + + + +#include +#include "cvtuicontrastpopup.h" +#include +#include "tvtuilocalvariation.h" +#include +#include "mvtuicomponent.h" +#include "CVtUiAppUi.h" +#include +#include + +// --------------------------------------------------------------------------- +// CVtUiContrastPopup::NewL +// --------------------------------------------------------------------------- +// +CVtUiContrastPopup* CVtUiContrastPopup::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "CVtUiContrastPopup.NewL" ) + CVtUiContrastPopup* self = + new ( ELeave ) CVtUiContrastPopup( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + __VTPRINTEXIT( "CVtUiContrastPopup.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiContrastPopup::~CVtUiContrastPopup +// --------------------------------------------------------------------------- +// +CVtUiContrastPopup::~CVtUiContrastPopup() + { + __VTPRINTENTER( "CVtUiContrastPopup.~" ) + __VTPRINTEXIT( "CVtUiContrastPopup.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiContrastPopup::CurrentValue +// --------------------------------------------------------------------------- +// +TInt CVtUiContrastPopup::CurrentValue() + { + __VTPRINTENTER( "CVtUiContrastPopup.CurrentValue" ) + // ask from engine current value + TInt value; + if ( iCameraPref->GetContrast( value) ) + { + __VTPRINTEXIT( "CVtUiContrastPopup.CurrentValueERR" ) + return 0; + } + __VTPRINTEXIT( "CVtUiContrastPopup.CurrentValue" ) + return value; + } + +// --------------------------------------------------------------------------- +// CVtUiContrastPopup::CVtUiContrastPopup +// --------------------------------------------------------------------------- +// +CVtUiContrastPopup::CVtUiContrastPopup( CVtUiFeatureManager& aFeatureManager ) + : CVtUiPrefPopupBase( aFeatureManager, TVtUiBlockListBitField( + MVtUiComponent::EComponentIdDialer | + MVtUiComponent::EComponentIdToolbar | + MVtUiComponent::EComponentIdNumberEntry | + MVtUiComponent::EComponentIdVolume | + MVtUiComponent::EComponentIdZoom | + MVtUiComponent::EVComponentIdBrightness ), EVComponentIdContrast, + KVtEngSetContrast ) + { + __VTPRINTENTER( "CVtUiContrastPopup.CVtUiContrastPopup" ) + __VTPRINTEXIT( "CVtUiContrastPopup.CVtUiContrastPopup" ) + } + +// --------------------------------------------------------------------------- +// CVtUiContrastPopup::CVtUiContrastPopup +// --------------------------------------------------------------------------- +// +void CVtUiContrastPopup::ConstructL() + { + __VTPRINTENTER( "CVtUiContrastPopup.ConstructL" ) + BaseConstructL(); + __VTPRINTEXIT( "CVtUiContrastPopup.ConstructL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/prefs/cvtuiprefpopupbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/prefs/cvtuiprefpopupbase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,189 @@ +/* +* Copyright (c) 2007 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: Implementation of base class for video preference popups +* +*/ + + +#include +#include +#include + +#include "cvtuiprefpopupbase.h" +#include "mvtuicomponentmanager.h" +#include "mvtuicomponentstateobserver.h" +#include "cvtuifeaturemanager.h" +#include "CVtUiAppUi.h" + +// Number of steps +static const TInt KStepCount = 20; + +// Slider min value +static const TInt KSLiderMinValue = -100; + +// Slider min value +static const TInt KSLiderDefaultValue = 0; + +// Slider max value +static const TInt KSLiderMaxValue = 100; + +// Min adjust value +static const TInt KMinAdjustValue = 0; + +// Max adjust value +static const TInt KMaxAdjustValue = 20; + +// default time out time for zoom popup +const TInt KDefaultPrefTimeOutTime = 5; + +// --------------------------------------------------------------------------- +// CVtUiPrefPopupBase::~CVtUiPrefPopupBase +// --------------------------------------------------------------------------- +// +CVtUiPrefPopupBase::~CVtUiPrefPopupBase() + { + __VTPRINTENTER( "CVtUiPrefPopupBase.~CVtUiPrefPopupBase" ) + __VTPRINTEXIT( "CVtUiPrefPopupBase.~CVtUiPrefPopupBase" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefPopupBase::HandleControlEventL() +// --------------------------------------------------------------------------- +// +void CVtUiPrefPopupBase::HandleControlEventL( + CCoeControl* aControl,TCoeEvent aEventType ) + { + __VTPRINTENTER( "CVtUiPrefPopupBase.HandleControlEventL" ) + CVtUiPopupBase::HandleControlEventL( aControl, aEventType ); + if ( aEventType == EEventStateChanged ) + { + const TInt value( Value() ); + if ( value != iCurrent ) + { + __VTPRINT( DEBUG_GEN, "CVtUiPrefPopupBase.OfferKeyEventL value != current " ) + iCurrent = value; + __VTPRINT2( DEBUG_GEN, "CVtUiPrefPopupBase.HandleControlEventL = %d", ScaledValue() ) + AdjustVideoL( ScaledValue() ); + } + } + + __VTPRINTEXIT( "CVtUiPrefPopupBase.HandleControlEventL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefPopupBase::UpdatePopupL() +// --------------------------------------------------------------------------- +// +void CVtUiPrefPopupBase::UpdatePopupL() + { + __VTPRINTENTER( "CVtUiPrefPopupBase.UpdatePrefPopupL" ) + + AdjustVideoL( ScaledValue() ); + + __VTPRINTEXIT( "CVtUiPrefPopupBase.UpdatePrefPopupL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefPopupBase::OfferKeyEventL() +// --------------------------------------------------------------------------- +// +TKeyResponse CVtUiPrefPopupBase::OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode aCode ) + { + __VTPRINTENTER( "CVtUiPrefPopupBase.OfferKeyEventL" ) + TKeyResponse response = + CVtUiPopupBase::OfferKeyEventL( aEvent, aCode ); + + if ( response == EKeyWasConsumed ) + { + AdjustVideoL( ScaledValue() ); + } + + __VTPRINTEXIT( "CVtUiPrefPopupBase.OfferKeyEventL" ) + return response; + } + +// CVtUiPrefPopupBase::AdjustVideoL() +// --------------------------------------------------------------------------- +// +void CVtUiPrefPopupBase::AdjustVideoL( TInt aValue ) + { + __VTPRINTENTER( "CVtUiPrefPopupBase.AdjustVideoL" ) + // cast the parameter + TPtrC8 params( reinterpret_cast< TUint8* >( &aValue ), sizeof( TInt ) ); + + // Adjust Contrast + iFeatureManager.AppUi().DoExecuteCmdL( iEngineCommandId, ¶ms ); + __VTPRINTEXIT( "CVtUiPrefPopupBase.AdjustVideoL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefPopupBase::DoActivateL() +// --------------------------------------------------------------------------- +// +void CVtUiPrefPopupBase::DoActivateL() + { + __VTPRINTENTER( "CVtUiPrefPopupBase.DoActivateL" ) + CVtUiPopupBase::DoActivateL(); + // Set current value + __VTPRINT2( DEBUG_GEN, "CVtUiPrefPopupBase.DoActivateL = %d", CurrentValue() ) + ScaleAndSetValue( CurrentValue() ); + AdjustVideoL( ScaledValue() ); + __VTPRINTEXIT( "CVtUiPrefPopupBase.DoActivateL" ) + } + +// CVtUiPrefPopupBase::CVtUiPrefPopupBase +// --------------------------------------------------------------------------- +// +CVtUiPrefPopupBase::CVtUiPrefPopupBase( CVtUiFeatureManager& aFeatureManager, + TVtUiBlockListBitField aBitField, TComponentId aComponentId, TInt aCmdId ) : + CVtUiPopupBase( aFeatureManager.ComponentManager(), aBitField, + aComponentId ), iFeatureManager( aFeatureManager ), + iEngineCommandId ( aCmdId ) + { + __VTPRINTENTER( "CVtUiPrefPopupBase.CVtUiPrefPopupBase" ) + __VTPRINTEXIT( "CVtUiPrefPopupBase.CVtUiPrefPopupBase" ) + } + + +// --------------------------------------------------------------------------- +// CVtUiPrefPopupBase::BaseConstructL +// --------------------------------------------------------------------------- +// +void CVtUiPrefPopupBase::BaseConstructL() + { + __VTPRINTENTER( "CVtUiPrefPopupBase.BaseConstructL" ) + CVtUiPopupBase::BaseConstructL(); + // Get camera preferences extension. + iCameraPref = static_cast ( iFeatureManager. + AppUi().Model().Extension( KVtEngExtensionCameraPreferences ) ); + + // Set range and step count for the slider + SetAdjustRange( KMinAdjustValue, KMaxAdjustValue, KStepCount ); + + // Set value range to baseclass + // range e.g. 0-20 + SetMinAndMaxValues( KSLiderMinValue , KSLiderMaxValue ); + + // Set slider type to percentage + SetValueType( EAknSliderValuePercentage ); + + // Set default value + ScaleAndSetValue( KSLiderDefaultValue ); + + // Set timeout + SetTimeOut( KDefaultPrefTimeOutTime ); + + __VTPRINTEXIT( "CVtUiPrefPopupBase.BaseConstructL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/prefs/cvtuiprefsettinglistbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/prefs/cvtuiprefsettinglistbase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,406 @@ +/* +* Copyright (c) 2007 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: Softkey UI feature implementation. +* +*/ + + +#include +#include +#include +#include +#include +#include + +#include "cvtuiprefsettinglistbase.h" +#include "CVtUiAppUi.h" +#include "cvtuitransparentsettingpage.h" +#include "CVtUiMainControl.h" +#include "CVtUiContextControl.h" +#include "CVtUiRemoteVideoControl.h" +#include "cvtuifeaturemanager.h" +#include "VtUiLayout.h" +#include "CVtUiEndCallButtonPane.h" + +#include + +// constants +static const TInt KMaxNumberOfArrayItems = 5; +static const TInt KMaxNumberOfActiveItems = 5; +static const TInt KOrdinalPositionBase = 4; + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::~CVtUiPrefSettingListBase +// --------------------------------------------------------------------------- +// +CVtUiPrefSettingListBase::~CVtUiPrefSettingListBase() + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.~CVtUiPrefSettingListBase" ) + delete iViewfinderBitmap; + delete iSettingPage; + iActiveItems.Close(); + __VTPRINTEXIT( "CVtUiPrefSettingListBase.~CVtUiPrefSettingListBase" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::InitFeatureL +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::InitFeatureL() + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.InitFeatureL" ) + ResizeBackroundBitmapRect(); + __VTPRINTEXIT( "CVtUiPrefSettingListBase.InitFeatureL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::IsPendingCmd +// --------------------------------------------------------------------------- +// +TBool CVtUiPrefSettingListBase::IsPendingCmd() + { + return iPendingSettingChangeCmd; + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::HandlePendingCmd +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::HandlePendingCmdL() + { + SettingPageItemChangedL( iOriginalSelection ); + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::HandleSettingPageEventL +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::HandleSettingPageEventL( + CAknSettingPage* /*aSettingPage*/, TAknSettingPageEvent aEventType ) + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.HandleSettingPageEventL" ) + const TInt currentItem = iSettingPage->ListBoxControl()->CurrentItemIndex(); + switch ( aEventType ) + { + case EEventSettingCancelled: + { + if ( iOriginalSelection != currentItem ) + { + // Set back to orginal selection + SettingPageItemChangedL( iOriginalSelection ); + iCurrentSelection = iOriginalSelection; + } + Stop(); + break; + } + case EEventSettingChanged: + { + SettingPageItemChangedL( currentItem ); + iOriginalSelection = currentItem; + Stop(); + break; + } + case EEventSettingOked: + { + // Check if the current selection has changed + if ( iOriginalSelection != currentItem ) + { + SettingPageItemChangedL( currentItem ); + iOriginalSelection = currentItem; + iCurrentSelection = currentItem; + } + Stop(); + break; + } + default: + break; + } + __VTPRINTEXIT( "CVtUiPrefSettingListBase.HandleSettingPageEventL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::ListStateChangedL +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::ListStateChangedL() + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.ListStateChangedL" ) + // Check if new item is focused in the selection list + + const TInt currentItem = iSettingPage->ListBoxControl()->CurrentItemIndex(); + if ( iCurrentSelection != currentItem ) + { + // Update current selection + iCurrentSelection = currentItem; + // Adjust frame + SettingPageItemChangedL( currentItem ); + } + __VTPRINTEXIT( "CVtUiPrefSettingListBase.ListStateChangedL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::StartSettingPageL +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::StartSettingPageL() + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.StartSettingPageL" ) + // Swap image places if needed + iAppUi.SwitchViewFinderToMainPaneL(); + + // Creates setting page first + CreateSettingPageL(); + + // Sort controls window position + SortControlsWindowPoistion(); + + // Launch setting page. + iSettingPage->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted, EFalse ); + iSettingPage = NULL; + __VTPRINTEXIT( "CVtUiPrefSettingListBase.StartSettingPageL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::StopSettingPageL +// +// +void CVtUiPrefSettingListBase::StopSettingPageL() + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.StopSettingPageL" ) + + if ( iSettingPage) + { + // Cancell the setting page + TKeyEvent keyEvent; + keyEvent.iCode = EKeyEscape; + iSettingPage->OfferKeyEventL( keyEvent, EEventKey ); + } + + // Sort controls window position + SortControlsWindowPoistion(); + + // Swap image places if needed + iAppUi.RestoreViewFinderL(); + + __VTPRINTEXIT( "CVtUiPrefSettingListBase.StopSettingPageL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::SizeChanged +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::SizeChanged() + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.SizeChanged" ) + ResizeBackroundBitmapRect(); + // Set new coordinates and size + if( iSettingPage ) + { + iSettingPage->SetBitmapPositionAndClipRect( iBitmapTopLeftCorner, + iBitmapClippingRect ); + iSettingPage->HandleLayoutChangeL(); + } + __VTPRINTEXIT( "CVtUiPrefSettingListBase.SizeChanged" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::UpdateBackground +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::UpdateBackground( CFbsBitmap* aFrame ) + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.UpdateBackground" ) + if ( aFrame ) + { + // aFrame is valid only in this callback, the bitmap + // must be copied for use as the setting page background + iViewfinderBitmap->Duplicate( aFrame->Handle() ); + if ( iSettingPage ) + { + // Update background + iSettingPage->ChangeBackground( iViewfinderBitmap ); + } + } + __VTPRINTEXIT( "CVtUiPrefSettingListBase.UpdateBackground" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::UpdateSettingL +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::UpdateSettingL() + { + // if no active items do nothing + if ( iActiveItems.Count() > 0 ) + { + // user change the focuse in the list but not + // select it indeed + if( iOriginalSelection != iCurrentSelection ) + SettingPageItemChangedL( iCurrentSelection ); + else + // yes,user has tapped down the OK button to choose a item + SettingPageItemChangedL( iOriginalSelection ); + } + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::CVtUiPrefSettingListBase +// --------------------------------------------------------------------------- +// +CVtUiPrefSettingListBase::CVtUiPrefSettingListBase( CVtUiFeatureManager& + aFeatureManager, TVtUiFeatureId aFeatureId ) : CVtUiFeatureBase( + aFeatureId, aFeatureManager ), iActiveItems( KMaxNumberOfActiveItems ), + iPendingSettingChangeCmd( EFalse ), iBitmapTopLeftCorner( 0, 0 ), + iAppUi( aFeatureManager.AppUi() ) + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.CVtUiPrefSettingListBase" ) + __VTPRINTEXIT( "CVtUiPrefSettingListBase.CVtUiPrefSettingListBase" ) + } + + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::ConstructL() + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.ConstructL" ) + BaseConstructL(); + // Get camera preferences extension. + iCameraPref = static_cast (iFeatureManager. + AppUi().Model().Extension( KVtEngExtensionCameraPreferences ) ); + // Create backgound bitmap + iViewfinderBitmap = new ( ELeave ) CFbsBitmap(); + __VTPRINTEXIT( "CVtUiPrefSettingListBase.ConstructL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::ReadAndAppendItemL +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::ReadAndAppendItemL( CDesCArray& aItems, + TInt aResId ) + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.ReadAndAppendItemL" ) + HBufC* text = iAppUi.GetEikonEnv()->AllocReadResourceLC( aResId ); + aItems.AppendL( *text ); + CleanupStack::PopAndDestroy(); // text + __VTPRINTEXIT( "CVtUiPrefSettingListBase.ReadAndAppendItemL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::CreateSettingPageL +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::CreateSettingPageL() + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.CreateSettingPageL" ) + CDesCArray* selectionArray = new ( ELeave ) + CDesCArraySeg( KMaxNumberOfArrayItems ); + CleanupStack::PushL( selectionArray ); + // Set items must be called before CurrentSelection function + // Otherwise iActiveItems array is not populated + iActiveItems.Reset(); + SetItemsL( *selectionArray ); + TInt resourceId = SettingPageResId(); + + // Current selection is needed when a new item is focused in the list + iCurrentSelection = iOriginalSelection; + TInt current( CurrentSelection() ); + if ( !iSettingPage ) + { + iSettingPage = new ( ELeave ) CVtUiTransparentSettingPage( resourceId, + iCurrentSelection, selectionArray ); + iSettingPage->ConstructL(); + iSettingPage->SetSettingPageObserver( this ); + iSettingPage->SetSettingPageEventStateObserver( this ); + } + CleanupStack::PopAndDestroy(); // selectionArray + ResizeBackroundBitmapRect(); + iSettingPage->SetBitmapPositionAndClipRect( iBitmapTopLeftCorner, + iBitmapClippingRect ); + __VTPRINTEXIT( "CVtUiPrefSettingListBase.CreateSettingPageL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::ShrinkBackroundBitmapRect +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::ResizeBackroundBitmapRect() + { + __VTPRINTENTER( "CVtUiPrefSettingListBase.ResizeBackroundBitmapRect" ) + TRect parent( iAppUi.MainControl().Size() ); + TAknWindowLineLayout rect; + TAknLayoutRect iStreamLayout; + VtUiLayout::GetSecondWindowStreamLayout( rect, ETrue ); + iStreamLayout.LayoutRect( parent, rect ); + + // In landscape rect from layout doesn't work + // for some reason + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + iBitmapClippingRect = parent; + } + else + { + iBitmapClippingRect = iStreamLayout.Rect(); + } + + iBitmapTopLeftCorner = iStreamLayout.Rect().iTl; + __VTPRINTEXIT( "CVtUiPrefSettingListBase.ResizeBackroundBitmapRect" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSettingListBase::SortControlsWindowPoistion +// --------------------------------------------------------------------------- +// +void CVtUiPrefSettingListBase::SortControlsWindowPoistion() + { + TInt ordinalPos = KOrdinalPositionBase; + + if ( iSettingPage ) + { + ordinalPos++; + } + + // Re-sort control's window position + iAppUi.MainControl().DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + iAppUi.MainControl().DrawableWindow()->OrdinalPriority() ); + + if ( iSettingPage ) + { + iSettingPage->DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + iSettingPage->DrawableWindow()->OrdinalPriority() ); + } + + iAppUi.CurrentFixedToolbar()->DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + iAppUi.CurrentFixedToolbar()->DrawableWindow()->OrdinalPriority() ); + + iAppUi.ContextControl().DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + iAppUi.ContextControl().DrawableWindow()->OrdinalPriority() ); + + iAppUi.RemoteVideoControl().DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + iAppUi.RemoteVideoControl().DrawableWindow()->OrdinalPriority() ); + + iAppUi.EndCallButtonPane().DrawableWindow()->SetOrdinalPosition( + ordinalPos--, + iAppUi.EndCallButtonPane().DrawableWindow()->OrdinalPriority() ); + } + +// End of file diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/prefs/cvtuiprefsliderbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/prefs/cvtuiprefsliderbase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2007 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: Implementatin of base class for video pref sliders +* +*/ + + +#include + +#include "cvtuiprefsliderbase.h" +#include "cvtuifeaturemanager.h" +#include "mvtuicomponentmanager.h" +#include "CVtUiAppUi.h" +#include "mvtuicommandmanager.h" +#include "cvtuiprefpopupbase.h" + + +// --------------------------------------------------------------------------- +// CVtUiPrefSliderBase::~CVtUiPrefSliderBase +// --------------------------------------------------------------------------- +// +CVtUiPrefSliderBase::~CVtUiPrefSliderBase() + { + __VTPRINTENTER( "CVtUiPrefSliderBase.~CVtUiPrefSliderBase" ) + __VTPRINTEXIT( "CVtUiPrefSliderBase.~CVtUiPrefSliderBase" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSliderBase::StartL +// --------------------------------------------------------------------------- +// +void CVtUiPrefSliderBase::StartL() + { + __VTPRINTENTER( "CVtUiPrefSliderBase.StartL" ) + // call base class implementation + CVtUiSliderBase::StartL(); + + // Swap image places if needed + iFeatureManager.AppUi().SwitchViewFinderToMainPaneL(); + + __VTPRINTEXIT( "CVtUiPrefSliderBase.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPrefSliderBase::Stop +// --------------------------------------------------------------------------- +// +void CVtUiPrefSliderBase::Stop() + { + __VTPRINTENTER( "CVtUiPrefSliderBase.Stop" ) + if ( iFeatureState == MVtUiFeature::EActive ) + { + // call base class implementation + CVtUiSliderBase::Stop(); + + // Swap image places if needed + TRAP_IGNORE( iFeatureManager.AppUi().RestoreViewFinderL() ); + } + __VTPRINTEXIT( "CVtUiPrefSliderBase.Stop" ) + } + + +// --------------------------------------------------------------------------- +// CVtUiPrefSliderBase::InitFeatureL +// --------------------------------------------------------------------------- +// +void CVtUiPrefSliderBase::InitFeatureL() + { + __VTPRINTENTER( "CVtUiPrefSliderBase.InitFeatureL" ) + // call base class implementation + CVtUiSliderBase::InitFeatureL(); + __VTPRINTEXIT( "CVtUiPrefSliderBase.InitFeatureL" ) + } + + +// --------------------------------------------------------------------------- +// CVtUiPrefSliderBase::CVtUiPrefSliderBase +// --------------------------------------------------------------------------- +// +CVtUiPrefSliderBase::CVtUiPrefSliderBase( CVtUiFeatureManager& aFeatureManager, + TVtUiFeatureId aFeatureId ) : CVtUiSliderBase( + aFeatureManager, aFeatureId ) + { + __VTPRINTENTER( "CVtUiPrefSliderBase.CVtUiPrefSliderBase" ) + __VTPRINTEXIT( "CVtUiPrefSliderBase.CVtUiPrefSliderBase" ) + } + + +// --------------------------------------------------------------------------- +// CVtUiPrefSliderBase::BaseConstructL +// --------------------------------------------------------------------------- +// +void CVtUiPrefSliderBase::BaseConstructL() + { + __VTPRINTENTER( "CVtUiPrefSliderBase.BaseConstructL" ) + CVtUiSliderBase::BaseConstructL(); + __VTPRINTEXIT( "CVtUiPrefSliderBase.BaseConstructL" ) + } + + + + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/prefs/cvtuitransparentsettingpage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/prefs/cvtuitransparentsettingpage.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,206 @@ +/* +* Copyright (c) 2007 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: Transparent camera setting page. +* +*/ + + + +#include "cvtuitransparentsettingpage.h" +#include "mvtuisettingpageobserver.h" +#include "VtUiLayout.h" +#include +#include +#include +#include + + +/** +* CVtUiTransparentSettingPage +* +* Transparent camera setting page. Extends class CAknTransparentCameraSettingPage +* with position related functionality. +* +* @since S60 v3.2 +*/ +void CVtUiTransparentSettingPage::HandleLayoutChangeL() + { + GetTheLayoutData(); + } + +// ----------------------------------------------------------------------------- +// CVtUiTransparentSettingPage::CVtUiTransparentSettingPage +// ----------------------------------------------------------------------------- +// +CVtUiTransparentSettingPage::CVtUiTransparentSettingPage( TInt aResourceID, + TInt& aCurrentSelectionIndex, const MDesCArray* aItemArray) : + CAknTransparentCameraSettingPage( aResourceID, + aCurrentSelectionIndex, aItemArray ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiTransparentSettingPage::ConstructL +// ----------------------------------------------------------------------------- +// +void CVtUiTransparentSettingPage::ConstructL() + { + CAknTransparentCameraSettingPage::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// CVtUiTransparentSettingPage::~CVtUiTransparentSettingPage +// ----------------------------------------------------------------------------- +// +CVtUiTransparentSettingPage::~CVtUiTransparentSettingPage() + { + } + +// ----------------------------------------------------------------------------- +// CVtUiNumberEntryControl::SetNumberEntryControlObserver +// ----------------------------------------------------------------------------- +// +void CVtUiTransparentSettingPage::SetSettingPageEventStateObserver( + MVtUiSettingPageObserver* aObserver ) + { + iSettingPageObserver = aObserver; + } + +// ----------------------------------------------------------------------------- +// CVtUiTransparentSettingPage::GetTheLayoutData +// ----------------------------------------------------------------------------- +// +void CVtUiTransparentSettingPage::GetTheLayoutData() + { + // Varieties + TInt labelVariety = 6; + TInt listboxVariety = 6; + + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + labelVariety = 5; + listboxVariety = 5; + } + + // Rect for label and shadow text + TRect labelRect = RectFromLayout( AknLayoutScalable_Apps:: + aid_placing_vt_set_title( labelVariety ) ); + + // Rect for listbox control + TRect listBoxRect = RectFromLayout( AknLayoutScalable_Apps:: + aid_placing_vt_set_content( listboxVariety ) ); + + // Get text label from parent class + CEikLabel* textLabel = TextLabel(); + + // Set label's new positions + if ( textLabel ) + { + textLabel->SetPosition( labelRect.iTl ); + } + + // Get shadow text from parent class + CEikLabel* shadowText = ShadowText(); + + // Set shadow text's new positions if shadow text exists + if( shadowText ) + { + // This information should come from layout, but + // also AknSettingPage does the positioning in this way. + labelRect.Move( 1, 1 ); + shadowText->SetPosition( labelRect.iTl ); + } + + // Set new rect for listbox control + ListBoxControl()->SetRect( listBoxRect ); + } + +// ----------------------------------------------------------------------------- +// CVtUiTransparentSettingPage::DynamicInitL +// ----------------------------------------------------------------------------- +// +void CVtUiTransparentSettingPage::DynamicInitL() + { + GetTheLayoutData(); + } + +// ----------------------------------------------------------------------------- +// CVtUiTransparentSettingPage::HandleControlEventL +// ----------------------------------------------------------------------------- +// +void CVtUiTransparentSettingPage::HandleControlEventL( CCoeControl* /*aControl*/, + TCoeEvent aEventType ) + { + __VTPRINTENTER( "CVtUiTransparentSettingPage.HandleControlEventL" ) + if ( aEventType == EEventStateChanged ) + { + if ( iSettingPageObserver ) + { + iSettingPageObserver->ListStateChangedL(); + } + __VTPRINT( DEBUG_GEN, " CVtUiTransparentSettingPage.EEventStateChanged" ) + } + + __VTPRINTEXIT( "CVtUiTransparentSettingPage.HandleControlEventL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiTransparentSettingPage::HandleResourceChange +// ----------------------------------------------------------------------------- +// +void CVtUiTransparentSettingPage::HandleResourceChange(TInt aType) + { + CAknTransparentCameraSettingPage::HandleResourceChange(aType); + GetTheLayoutData(); + } + +// ----------------------------------------------------------------------------- +// CVtUiTransparentSettingPage::RectFromLayout +// ----------------------------------------------------------------------------- +// +TRect CVtUiTransparentSettingPage::RectFromLayout( + const TAknWindowComponentLayout& aComponentLayout ) const + { + __VTPRINTENTER( "CVtUiTransparentSettingPage.RectFromLayout" ) + + TInt main_pane_variety( 0 ); + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + main_pane_variety = 4; + } + + TAknWindowComponentLayout layout1 = + AknLayoutScalable_Apps::main_pane( main_pane_variety ); + TAknWindowComponentLayout layout2 = + AknLayoutScalable_Apps::main_video_tele_pane(); + + TAknWindowLineLayout layout = + TAknWindowComponentLayout::Compose( + TAknWindowComponentLayout::Compose( layout1, layout2 ), aComponentLayout ). + LayoutLine(); + + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + TAknLayoutRect layoutRect; + layoutRect.LayoutRect( screen, layout ); + + // setting page is window owning control and its position is relative to mainpane + // layotdata is instead relative to screen + TRect rect( layoutRect.Rect() ); + rect.Move( -PositionRelativeToScreen() ); + + __VTPRINTEXIT( "CVtUiTransparentSettingPage.RectFromLayout" ) + return rect; + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/prefs/cvtuivideoquality.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/prefs/cvtuivideoquality.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,441 @@ +/* +* Copyright (c) 2007 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: Video quality UI feature implementation. +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "cvtuivideoquality.h" +#include "tvtuifeatureids.h" +#include "VtUiLayout.h" +#include "VtUiUtility.h" +#include "CVtUiAppUi.h" +#include "cvtuifeaturemanager.h" +#include "mvtuicomponentmanager.h" +#include "tvtuilocalvariation.h" +#include "tvtuistates.h" + +// constants +_LIT( KVtUiFormatActive, "0\t%S" ); +_LIT( KVtUiFormatInactive, "\t%S" ); +const TInt KVtUiMaxListItemLength = 128; + +// Implementation of TVtUiVideoQualityComponentState + +// --------------------------------------------------------------------------- +// TVtUiVideoQualityComponentState::TVtUiVideoQualityComponentState +// --------------------------------------------------------------------------- +// +TVtUiVideoQualityComponentState::TVtUiVideoQualityComponentState( + MVtUiComponent& aComponent ) : + TVtUiComponentState( aComponent, + TVtUiBlockListBitField( + MVtUiComponent::EComponentIdDialer | + MVtUiComponent::EComponentIdNumberEntry ) ) + { + __VTPRINTENTER( "TVtUiVideoQualityComponentState.Ctor" ) + __VTPRINTEXIT( "TVtUiVideoQualityComponentState.Ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::NewL +// --------------------------------------------------------------------------- +// +CVtUiVideoQuality* CVtUiVideoQuality::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "CVtUiVideoQuality.NewL" ) + CVtUiVideoQuality* self = + new ( ELeave ) CVtUiVideoQuality( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + __VTPRINTEXIT( "CVtUiVideoQuality.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::~CVtUiVideoQuality +// --------------------------------------------------------------------------- +// +CVtUiVideoQuality::~CVtUiVideoQuality() + { + __VTPRINTENTER( "CVtUiVideoQuality.~CVtUiVideoQuality" ) + + // Delete the callback + delete iShowSelectionListCallback; + + // unregister component + iFeatureManager.ComponentManager().ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::EUnregister ); + + __VTPRINTEXIT( "CVtUiVideoQuality.~CVtUiVideoQuality" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::StartL +// --------------------------------------------------------------------------- +// +void CVtUiVideoQuality::StartL() + { + __VTPRINTENTER( "CVtUiVideoQuality.StartL" ) + if ( iFeatureState == MVtUiFeature::EReady ) + { + iFeatureManager.UiStates().SetIsFixedToolbarVisible( EFalse ); + iFeatureManager.ComponentManager(). + RequestActivationL ( MVtUiComponent::EComponentIdVideoQuality ); + // set state + iFeatureState = MVtUiFeature::EActive; + } + __VTPRINTEXIT( "CVtUiVideoQuality.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::Stop +// --------------------------------------------------------------------------- +// +void CVtUiVideoQuality::Stop() + { + __VTPRINTENTER( "CVtUiVideoQuality.Stop" ) + TRAP_IGNORE( + { + if ( iFeatureState == MVtUiFeature::EActive ) + { + iFeatureManager.ComponentManager(). + DeActivateComponentL ( MVtUiComponent::EComponentIdVideoQuality ); + // set state + iFeatureState = MVtUiFeature::EReady; + } + } ); + __VTPRINTEXIT( "CVtUiVideoQuality.Stop" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::InitFeatureL +// --------------------------------------------------------------------------- +// +void CVtUiVideoQuality::InitFeatureL() + { + __VTPRINTENTER( "CVtUiVideoQuality.InitFeatureL" ) + // register component to conponent manager + User::LeaveIfError( + iFeatureManager.ComponentManager().ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::ERegister ) ); + iFeatureState = EReady; + __VTPRINTEXIT( "CVtUiVideoQuality.InitFeatureL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::ComponentId +// --------------------------------------------------------------------------- +// +MVtUiComponent::TComponentId CVtUiVideoQuality::ComponentId() const + { + __VTPRINTENTER( "CVtUiVideoQuality.ComponentId" ) + __VTPRINTEXIT( "CVtUiVideoQuality.ComponentId" ) + return MVtUiComponent::EComponentIdVideoQuality; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::ComponentAsControl +// --------------------------------------------------------------------------- +// +CCoeControl* CVtUiVideoQuality::ComponentAsControl() + { + __VTPRINTENTER( "CVtUiWhiteBalance.ComponentAsControl" ) + __VTPRINTEXIT( "CVtUiVideoQuality.ComponentAsControl" ) + return NULL; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::DoActivateL +// --------------------------------------------------------------------------- +// +void CVtUiVideoQuality::DoActivateL() + { + __VTPRINTENTER( "CVtUiVideoQuality.DoActivateL" ) + __VTPRINTEXIT( "CVtUiVideoQuality.DoActivateL" ) + iFeatureManager.UiStates().SetVideoQualityModeOn( ETrue ); + iShowSelectionListCallback->CallBack(); + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::DoDeactivateL +// --------------------------------------------------------------------------- +// +void CVtUiVideoQuality::DoDeactivateL() + { + __VTPRINTENTER( "CVtUiVideoQuality.DoDeactivateL" ) + iFeatureManager.UiStates().SetVideoQualityModeOn( EFalse ); + __VTPRINTEXIT( "CVtUiVideoQuality.DoDeactivateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::CreateIconLC +// --------------------------------------------------------------------------- +// +CGulIcon* CVtUiVideoQuality::CreateIconLC( TVtUiBitmapId aIconId, + TVtUiBitmapId aMaskId ) + { + __VTPRINTENTER( "CVtUiVideoQuality.CreateIconLC" ) + TFileName fileName; + TInt bitmapIndex; + TInt bitmapMaskIndex; + CFbsBitmap* newIconBmp; + CFbsBitmap* newIconMaskBmp; + VtUiLayout::Resolve( aIconId, fileName, bitmapIndex ); + TAknsItemID skinId = VtUiLayout::MapBitmapToSkinId( aIconId ); + VtUiLayout::Resolve( aMaskId, fileName, bitmapMaskIndex ); + AknsUtils::CreateIconL( AknsUtils::SkinInstance(), skinId, newIconBmp, + newIconMaskBmp, fileName, bitmapIndex, bitmapMaskIndex ); + CleanupStack::PushL( newIconBmp ); + CleanupStack::PushL( newIconMaskBmp ); + CGulIcon* gulIcon = CGulIcon::NewL( newIconBmp, newIconMaskBmp ); + CleanupStack::Pop( newIconMaskBmp ); + CleanupStack::Pop( newIconBmp ); + CleanupStack::PushL( gulIcon ); + __VTPRINTEXIT( "CVtUiVideoQuality.CreateIconLC" ) + return gulIcon; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::ShowSelectionListL +// --------------------------------------------------------------------------- +// +void CVtUiVideoQuality::ShowSelectionListL() + { + __VTPRINTENTER( "CVtUiVideoQuality.ShowSelectionListL" ) + // create listbox + CAknSingleGraphicPopupMenuStyleListBox* listBox = + new ( ELeave ) CAknSingleGraphicPopupMenuStyleListBox(); + CleanupStack::PushL( listBox ); + + // create popuplist + CAknPopupList* popUpList = + CAknPopupList::NewL( listBox, R_VIDEOTELUI_SOFTKEYS_SELECT_CANCEL ); + CleanupStack::PushL( popUpList ); + + listBox->ConstructL( popUpList, + EAknListBoxSelectionList | EAknListBoxLoopScrolling ); + + // Create an array of icons, reading them from the file and + // set them in the listbox + CArrayPtr* icons = new(ELeave) CAknIconArray( 1 ); + CleanupStack::PushL(icons); + CGulIcon* icon = CreateIconLC( EVtUiBitmap_qgn_prop_sub_current, + EVtUiBitmap_qgn_prop_sub_current_mask ); + icons->AppendL( icon ); + listBox->ItemDrawer()->ColumnData()->SetIconArray( icons ); + CleanupStack::Pop(2); //icon + icons + + // Read item array from resources + CDesCArray* textArray = + iFeatureManager.AppUi().GetEikonEnv()-> + ReadDesCArrayResourceL( R_VIDEOTELUI_VIDEO_QUALITY_ARRAY ); + CleanupStack::PushL( textArray ); + + CDesCArraySeg* listBoxRows = new ( ELeave ) CDesCArraySeg( 3 ); + CleanupStack::PushL( listBoxRows ); + + // Read items to array + SetItemsL( *listBoxRows, *textArray ); + + // Create listbox model. + CTextListBoxModel* listBoxModel = listBox->Model(); + // Set item array + listBoxModel->SetItemTextArray( listBoxRows ); + + // Set ownership + listBoxModel->SetOwnershipType( ELbmOwnsItemArray ); + + // Enable marquee + listBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue ); + + CleanupStack::Pop(2); // listBoxRows + testArray + + TInt popupOk = popUpList->ExecuteLD(); + + CleanupStack::Pop(); // popUpList + popUpList = NULL; + + if ( popupOk ) + { + ItemSelectedL( listBox->CurrentItemIndex() ); + } + else + { + // Selection canceled. + } + + // Reset arrays + listBoxRows->Reset(); + textArray->Reset(); + icons->ResetAndDestroy(); // icons + icon + + // Delete listbox + CleanupStack::PopAndDestroy( listBox ); // listBox + + iAsyncCallback->Set( TCallBack( &DoStop, this ) ); + iAsyncCallback->CallBack(); + __VTPRINTEXIT( "CVtUiVideoQuality.ShowSelectionListL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::AsyncShowSelectionListL +// --------------------------------------------------------------------------- +// +TInt CVtUiVideoQuality::AsyncShowSelectionList( TAny* aPtr ) + { + CVtUiVideoQuality* self = reinterpret_cast< CVtUiVideoQuality* > ( aPtr ); + TRAPD( err, self->ShowSelectionListL() ); + return err; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::SetItemsL +// --------------------------------------------------------------------------- +// +void CVtUiVideoQuality::SetItemsL( CDesCArray& aTarget, + const CDesCArray& aSource ) + { + __VTPRINTENTER( "CVtUiVideoQuality.SetItemsL" ) + TInt activeItem( ActiveItem() ); + TInt count( aSource.Count() ); + for ( TInt i = 0; i < count; i++ ) + { + TBuf< KVtUiMaxListItemLength > item; + TPtrC sourceItem( aSource[ i ] ); + if ( i == activeItem ) + { + item.Format( KVtUiFormatActive(), &sourceItem ); + } + else + { + item.Format( KVtUiFormatInactive(), &sourceItem ); + } + aTarget.AppendL( item ); + } + __VTPRINTEXIT( "CVtUiVideoQuality.SetItemsL" ) + } +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::ActiveItem +// --------------------------------------------------------------------------- +// +TInt CVtUiVideoQuality::ActiveItem() const + { + __VTPRINTENTER( "CVtUiVideoQuality.ActiveItem" ) + TInt activeItem( 0 ); + MVtEngMedia::TVideoQuality videoQuality; + VtUiUtility::GetVideoQuality( iFeatureManager.AppUi().Model().Media(), + videoQuality ); + switch( videoQuality ) + { + case MVtEngMedia::EVideoQualityNormal: + activeItem = 0; + break; + case MVtEngMedia::EVideoQualityDetail: + activeItem = 1; + break; + case MVtEngMedia::EVideoQualityMotion: + activeItem = 2; + break; + default: + break; + } + __VTPRINTEXIT( "CVtUiVideoQuality.ActiveItem" ) + return activeItem; + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::ItemSelectedL +// --------------------------------------------------------------------------- +// + void CVtUiVideoQuality::ItemSelectedL( TInt aItemIndex ) + { + __VTPRINTENTER( "CVtUiVideoQuality.ItemSelectedL" ) + MVtEngMedia::TVideoQuality qualityLevel; + switch( aItemIndex ) + { + case 0: + qualityLevel = MVtEngMedia::EVideoQualityNormal; + break; + + case 1: + qualityLevel = MVtEngMedia::EVideoQualityDetail; + break; + + case 2: + qualityLevel = MVtEngMedia::EVideoQualityMotion; + break; + default: + break; + } + // cast the parameter + TPtrC8 params( reinterpret_cast< TUint8* >( &qualityLevel ), + sizeof( MVtEngMedia::TVideoQuality ) ); + iFeatureManager.AppUi().DoExecuteCmdL( KVtEngSetVideoQuality, ¶ms ); + __VTPRINTEXIT( "CVtUiVideoQuality.ItemSelectedL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::CVtUiVideoQuality +// --------------------------------------------------------------------------- +// +CVtUiVideoQuality::CVtUiVideoQuality( CVtUiFeatureManager& aFeatureManager ) : + CVtUiFeatureBase( EVtUiFeatureIdVideoQuality, aFeatureManager ), + iComponentState( *this ) + { + __VTPRINTENTER( "CVtUiWhiteBalance.CVtUiVideoQuality" ) + __VTPRINTEXIT( "CVtUiVideoQuality.CVtUiVideoQuality" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVideoQuality::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiVideoQuality::ConstructL() + { + __VTPRINTENTER( "CVtUiVideoQuality.ConstructL" ) + BaseConstructL(); + iShowSelectionListCallback = new ( ELeave ) CAsyncCallBack( + TCallBack( &AsyncShowSelectionList, this ), + CActive::EPriorityStandard ); + __VTPRINTEXIT( "CVtUiVideoQuality.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiVideoQuality::DoStop +// ----------------------------------------------------------------------------- +// +TInt CVtUiVideoQuality::DoStop( TAny* aAny ) + { + __VTPRINTENTER( "CVtUiVideoQuality.DoStop" ) + CVtUiFeatureBase* self = static_cast< CVtUiFeatureBase* >( aAny ); + self->Stop(); + __VTPRINTEXIT( "CVtUiVideoQuality.DoStop" ) + return KErrNone; + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/prefs/cvtuiwhitebalance.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/prefs/cvtuiwhitebalance.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,390 @@ +/* +* Copyright (c) 2007 - 2008 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: White balance UI feature implementation. +* +*/ + + +#include +#include +#include +#include "cvtuiwhitebalance.h" +#include "tvtuifeatureids.h" +#include +#include +#include "mvtuicomponentmanager.h" +#include "cvtuifeaturemanager.h" +#include "CVtUiAppUi.h" +#include "tvtuilocalvariation.h" +#include "tvtuistates.h" +#include "cvtuifeaturemanager.h" +#include "cvtuicommandmanager.h" + +// Implementation of TVtUiWhiteBalanceComponentState + +// --------------------------------------------------------------------------- +// TVtUiWhiteBalanceComponentState::TVtUiWhiteBalanceComponentState +// --------------------------------------------------------------------------- +// +TVtUiWhiteBalanceComponentState::TVtUiWhiteBalanceComponentState( + MVtUiComponent& aComponent ) : + TVtUiComponentState( aComponent, + TVtUiBlockListBitField( + MVtUiComponent::EComponentIdToolbar | + MVtUiComponent::EComponentIdNumberEntry ) ) + { + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::NewL +// --------------------------------------------------------------------------- +// +CVtUiWhiteBalance* CVtUiWhiteBalance::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "CVtUiWhiteBalance.NewL" ) + CVtUiWhiteBalance* self = + new ( ELeave ) CVtUiWhiteBalance( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + __VTPRINTEXIT( "CVtUiWhiteBalance.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::~CVtUiWhiteBalance +// --------------------------------------------------------------------------- +// +CVtUiWhiteBalance::~CVtUiWhiteBalance() + { + __VTPRINTENTER( "CVtUiWhiteBalance.~CVtUiWhiteBalance" ) + // unregister layout change + iFeatureManager.ComponentManager().ChangeLayoutChangeRegistration( + *this, MVtUiComponentManager::EUnregister ); + // unregister component + iFeatureManager.ComponentManager().ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::EUnregister ); + __VTPRINTEXIT( "CVtUiWhiteBalance.~CVtUiWhiteBalance" ) + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::StartL +// --------------------------------------------------------------------------- +// +void CVtUiWhiteBalance::StartL() + { + __VTPRINTENTER( "CVtUiWhiteBalance.StartL" ) + if ( iFeatureState == MVtUiFeature::EReady ) + { + iFeatureManager.AppUi().EnableCommandActivatingAndCleanupPushL(); + iFeatureManager.UiStates().SetIsFixedToolbarVisible( EFalse ); + iFeatureManager.ComponentManager(). + RequestActivationL ( MVtUiComponent::EComponentIdWhiteBalance ); + CleanupStack::Pop(); // EnableCommandActivatingAndCleanupPushL + // set state + iFeatureState = MVtUiFeature::EActive; + } + __VTPRINTEXIT( "CVtUiWhiteBalance.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::Stop +// --------------------------------------------------------------------------- +// +void CVtUiWhiteBalance::Stop() + { + __VTPRINTENTER( "CVtUiWhiteBalance.Stop" ) + iAsyncCallback->Cancel(); + iAsyncCallback->Set( TCallBack( &DoStopL, this ) ); + iAsyncCallback->CallBack(); + __VTPRINTEXIT( "CVtUiWhiteBalance.Stop" ) + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::InitFeatureL +// --------------------------------------------------------------------------- +// +void CVtUiWhiteBalance::InitFeatureL() + { + __VTPRINTENTER( "CVtUiWhiteBalance.InitFeatureL" ) + CVtUiPrefSettingListBase::InitFeatureL(); + User::LeaveIfError( + iFeatureManager.ComponentManager().ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::ERegister ) ); + User::LeaveIfError( + iFeatureManager.ComponentManager().ChangeLayoutChangeRegistration( + *this, MVtUiComponentManager::ERegister ) ); + iFeatureState = EReady; + __VTPRINTEXIT( "CVtUiWhiteBalance.InitFeatureL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::ComponentId +// --------------------------------------------------------------------------- +// +MVtUiComponent::TComponentId CVtUiWhiteBalance::ComponentId() const + { + __VTPRINTENTER( "CVtUiWhiteBalance.ComponentId" ) + __VTPRINTEXIT( "CVtUiWhiteBalance.ComponentId" ) + return MVtUiComponent::EComponentIdWhiteBalance; + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::ComponentAsControl +// --------------------------------------------------------------------------- +// +CCoeControl* CVtUiWhiteBalance::ComponentAsControl() + { + __VTPRINTENTER( "CVtUiWhiteBalance.ComponentAsControl" ) + __VTPRINTEXIT( "CVtUiWhiteBalance.ComponentAsControl" ) + return NULL; + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::DoActivateL +// --------------------------------------------------------------------------- +// +void CVtUiWhiteBalance::DoActivateL() + { + __VTPRINTENTER( "CVtUiWhiteBalance.DoActivateL" ) + // get supported white balance modes + iCameraPref->GetSupportedWhiteBalanceModes( iSupportedModes ); + __VTPRINT2( DEBUG_GEN,"CVtUiWhiteBalance.DoActivateL=%d", iSupportedModes ) + iFeatureManager.UiStates().SetWhiteBalanceModeOn( ETrue ); + iAsyncCallback->Cancel(); + iAsyncCallback->Set( TCallBack( &DoStartL, this ) ); + iAsyncCallback->CallBack(); + __VTPRINTEXIT( "CVtUiWhiteBalance.DoActivateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::DoDeactivateL +// --------------------------------------------------------------------------- +// +void CVtUiWhiteBalance::DoDeactivateL() + { + __VTPRINTENTER( "CVtUiWhiteBalance.DoDeactivateL" ) + iFeatureManager.UiStates().SetWhiteBalanceModeOn( EFalse ); + CVtUiPrefSettingListBase::StopSettingPageL(); + __VTPRINTEXIT( "CVtUiWhiteBalance.DoDeactivateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::HandleLayoutChangeL +// --------------------------------------------------------------------------- +// +void CVtUiWhiteBalance::HandleLayoutChangeL() + { + __VTPRINTENTER( "CVtUiWhiteBalance.HandleLayoutChangeL" ) + if ( iFeatureState == MVtUiFeature::EActive ) + { + SizeChanged(); + } + __VTPRINTEXIT( "CVtUiWhiteBalance.HandleLayoutChangeL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::CurrentSelection +// --------------------------------------------------------------------------- +// +TInt CVtUiWhiteBalance::CurrentSelection() + { + __VTPRINTENTER( "CVtUiWhiteBalance.CurrentSelection" ) + // ask from engine which item is currently active + MVtEngCameraPreferences::TWhiteBalance wb; + if ( iCameraPref->GetWhiteBalance( wb ) ) + { + __VTPRINT( DEBUG_GEN, "CurrentSelection::error" ); + __VTPRINTEXIT( "CVtUiWhiteBalance.CurrentSelection" ) + // if error occured return 0 i.e. first list item + return 0; + } + __VTPRINTEXIT( "CVtUiWhiteBalance.CurrentSelection" ) + return MapWBEnumToArrayIndex( wb ); + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::SetItemsL +// --------------------------------------------------------------------------- +// +void CVtUiWhiteBalance::SetItemsL( CDesCArray& aArray ) + { + __VTPRINTENTER( "CVtUiWhiteBalance.SetItemsL" ) + __VTPRINT2( DEBUG_GEN, "CVtUiWhiteBalance.SetItemsL=%d", iSupportedModes ) + // Auto mode allways supported + ReadAndAppendItemL( aArray, R_VIDEOTELUI_QTN_INCAL_AUTOMATIC_OPTION ); + iActiveItems.Append( MVtEngCameraPreferences::EAuto ); + + if( iSupportedModes & MVtEngCameraPreferences::EDaylight ) + { + ReadAndAppendItemL( aArray, R_VIDEOTELUI_QTN_INCAL_SUNNY_OPTION ); + iActiveItems.Append( MVtEngCameraPreferences::EDaylight ); + } + if( iSupportedModes & MVtEngCameraPreferences::ECloudy ) + { + ReadAndAppendItemL( aArray, R_VIDEOTELUI_QTN_INCAL_CLOUDY_OPTION ); + iActiveItems.Append( MVtEngCameraPreferences::ECloudy ); + } + if( iSupportedModes & MVtEngCameraPreferences::ETungsten ) + { + ReadAndAppendItemL( aArray, R_VIDEOTELUI_QTN_INCAL_INCANDESCENT_OPTION ); + iActiveItems.Append( MVtEngCameraPreferences::ETungsten ); + } + if( iSupportedModes & MVtEngCameraPreferences::EFluorescent ) + { + ReadAndAppendItemL( aArray, R_VIDEOTELUI_QTN_INCAL_FLUORESCENT_OPTION ); + iActiveItems.Append( MVtEngCameraPreferences::EFluorescent ); + } + __VTPRINTEXIT( "CVtUiWhiteBalance.SetItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::SettingPageResId +// --------------------------------------------------------------------------- +// +TInt CVtUiWhiteBalance::SettingPageResId() const + { + __VTPRINTENTER( "CVtUiWhiteBalance.SettingPageResId" ) + __VTPRINTEXIT( "CVtUiWhiteBalance.SettingPageResId" ) + return R_VIDEOTELUI_WHITE_BALANCE_SETTING_PAGE; + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::SettingPageItemChangedL +// --------------------------------------------------------------------------- +// +void CVtUiWhiteBalance::SettingPageItemChangedL( TInt aIndex ) + { + __VTPRINTENTER( "CVtUiWhiteBalance.SettingPageItemChangedL" ) + __VTPRINT2( DEBUG_GEN, "CVtUiWhiteBalance.index=%d", aIndex ) + if ( iFeatureManager.UiStates().ExecState() == TVtUiStates::EExecStateResetting ) + { + __VTPRINTEXIT( "CVtUiWhiteBalance.SettingPageItemChangedL" ) + return; + } + // Map index to right white balance value + MVtEngCameraPreferences::TWhiteBalance wb = MapArrayIndexToWBEnum( aIndex ); + + // cast the parameter + TPtrC8 params( reinterpret_cast< TUint8* >( &wb ), + sizeof( MVtEngCameraPreferences::TWhiteBalance ) ); + + // Adjust white balance + MVtEngMedia::TCameraId camId; + iFeatureManager.AppUi().Model().Media().GetCurrentCameraId(camId); + + if( camId == MVtEngMedia::ESecondaryCamera ) + { + iFeatureManager.AppUi().DoExecuteCmdL( KVtEngSetWhiteBalance, ¶ms ); + iPendingSettingChangeCmd = EFalse; + } + else + iPendingSettingChangeCmd = ETrue; + __VTPRINTEXIT( "CVtUiWhiteBalance.SettingPageItemChangedL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::CVtUiWhiteBalance +// --------------------------------------------------------------------------- +// +CVtUiWhiteBalance::CVtUiWhiteBalance( CVtUiFeatureManager& aFeatureManager ) + : CVtUiPrefSettingListBase( aFeatureManager, EVtUiFeatureIdWhiteBalance ), + iComponentState( *this ) + { + __VTPRINTENTER( "CVtUiWhiteBalance.CVtUiWhiteBalance" ) + __VTPRINTEXIT( "CVtUiWhiteBalance.CVtUiWhiteBalance" ) + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::MapWBEnumToArrayIndex +// --------------------------------------------------------------------------- +// +TInt CVtUiWhiteBalance::MapWBEnumToArrayIndex( MVtEngCameraPreferences:: + TWhiteBalance& aWhiteBalance ) const + { + __VTPRINTENTER( "CVtUiWhiteBalance.MapWBEnumToArrayIndex" ) + __VTPRINT2( DEBUG_GEN, "CVtUiWhiteBalance.cpunt=%d", iActiveItems.Count() ) + for ( TInt i = 0; i < iActiveItems.Count(); ++i ) + { + if ( iActiveItems [ i ] == aWhiteBalance ) + { + __VTPRINT2( DEBUG_GEN, "CVtUiWhiteBalance.index=%d", i ) + __VTPRINTEXIT( "CVtUiWhiteBalance.MapWBEnumToArrayIndex" ) + return i; + } + } + // not found + __VTPRINTEXIT( "CVtUiWhiteBalance.MapWBEnumToArrayIndexNF" ) + return KErrNotFound; + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::MapArrayIndexToWBEnum +// --------------------------------------------------------------------------- +// +MVtEngCameraPreferences::TWhiteBalance CVtUiWhiteBalance:: + MapArrayIndexToWBEnum( TInt aIndex) const + { + __VTPRINTENTER( "CVtUiWhiteBalance.MapArrayIndexToWBEnum" ) + __VTPRINT2( DEBUG_GEN, "CVtUiWhiteBalance.index=%d", aIndex ) + __VTPRINT2( DEBUG_GEN, "CVtUiWhiteBalance.count=%d", iActiveItems.Count() ) + const TInt count = iActiveItems.Count(); + if ( count > 0 && aIndex < count && aIndex >= 0 ) + { + __VTPRINTEXIT( "CVtUiWhiteBalance.MapArrayIndexToWBEnum" ) + return static_cast< MVtEngCameraPreferences::TWhiteBalance > + ( iActiveItems[ aIndex ] ); + } + else // not valid index return first item in the list + { + __VTPRINTEXIT( "CVtUiWhiteBalance.MapArrayIndexToWBEnum_ERROR_INDEX" ) + return static_cast< MVtEngCameraPreferences::TWhiteBalance > + ( iActiveItems[ 0 ] ); + } + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::DoStop +// --------------------------------------------------------------------------- +// +TInt CVtUiWhiteBalance::DoStopL( TAny* aAny ) + { + __VTPRINTENTER( "CVtUiWhiteBalance.DoStopL" ) + CVtUiWhiteBalance* self = static_cast< CVtUiWhiteBalance* >( aAny ); + if ( self->iFeatureState == MVtUiFeature::EActive ) + { + __VTPRINT( DEBUG_GEN, "CVtUiWhiteBalance::Stop1" ); + self->iFeatureManager.ComponentManager(). + DeActivateComponentL ( MVtUiComponent::EComponentIdWhiteBalance ); + // set state + self->iFeatureState = MVtUiFeature::EReady; + } + __VTPRINTEXIT( "CVtUiWhiteBalance.DoStopL" ) + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CVtUiWhiteBalance::DoStart +// --------------------------------------------------------------------------- +// +TInt CVtUiWhiteBalance::DoStartL( TAny* aAny ) + { + __VTPRINTENTER( "CVtUiWhiteBalance.DoStart" ) + CVtUiWhiteBalance* self = static_cast< CVtUiWhiteBalance* >( aAny ); + self->CVtUiPrefSettingListBase::StartSettingPageL(); + self->iFeatureManager.UiStates().SetIsCommandActivating( EFalse ); + __VTPRINTEXIT( "CVtUiWhiteBalance.DoStart" ) + return KErrNone; + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/softkey/cvtuisoftkeycontext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/softkey/cvtuisoftkeycontext.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2006 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: Sofkey context class implementation. +* +*/ + + +#include + +#include "cvtuisoftkeycontext.h" + +/** Softkey context reference priority */ +const TInt KVtUiSoftkeyContextPriority = 200; + +// --------------------------------------------------------------------------- +// CVtUiSoftkeyContext::~CVtUiSoftkeyContext +// --------------------------------------------------------------------------- +// +CVtUiSoftkeyContext::~CVtUiSoftkeyContext() + { + __VTPRINTENTER( "SKCtx.~" ) + UnregisterCommandContext(); + __VTPRINTEXIT( "SKCtx.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeyContext::NewL +// --------------------------------------------------------------------------- +// +CVtUiSoftkeyContext* CVtUiSoftkeyContext::NewL( + MVtUiCommandManager& aCommandManager ) + { + __VTPRINTENTER( "SKCtx.NewL" ) + CVtUiSoftkeyContext* self = + new ( ELeave ) CVtUiSoftkeyContext( aCommandManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "SKCtx.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeyContext::ValidateL +// --------------------------------------------------------------------------- +// +void CVtUiSoftkeyContext::ValidateL( CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "SKCtx.ValidateL" ) + ValidateSoftkeyItemsL( aAction ); + __VTPRINTEXIT( "SKCtx.ValidateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeyContext::CVtUiSoftkeyContext +// --------------------------------------------------------------------------- +// +CVtUiSoftkeyContext::CVtUiSoftkeyContext( MVtUiCommandManager& aCommandManager ) + : CVtUiCmdContext( aCommandManager, EVtUiCmdContextTypeSoftkey, + KVtUiSoftkeyContextPriority ) + { + __VTPRINTENTER( "SKCtx.ctor" ) + __VTPRINTEXIT( "SKCtx.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeyContext::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiSoftkeyContext::ConstructL() + { + __VTPRINTENTER( "SKCtx.ConstructL" ) + RegisterCommandContextL(); + __VTPRINTEXIT( "SKCtx.ConstructL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/softkey/cvtuisoftkeys.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/softkey/cvtuisoftkeys.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,167 @@ +/* +* Copyright (c) 2006 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: Softkey UI feature implementation. +* +*/ + + +#include +#include +#include "cvtuisoftkeys.h" +#include "cvtuisoftkeysetting.h" +#include "cvtuisoftkeyvalidationaction.h" +#include "cvtuifeaturemanager.h" +#include "mvtuicommandmanager.h" +#include "cvtuisoftkeycontext.h" + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiSoftkeys::NewL +// --------------------------------------------------------------------------- +// +CVtUiSoftkeys* CVtUiSoftkeys::NewL( CVtUiFeatureManager& aFeatureManager, + CEikButtonGroupContainer& aButtonGroupContainer ) + { + __VTPRINTENTER( "SKs.NewL" ) + CVtUiSoftkeys* self = + new ( ELeave ) CVtUiSoftkeys( aFeatureManager, aButtonGroupContainer ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "SKs.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeys::~CVtUiSoftkeys +// --------------------------------------------------------------------------- +// +CVtUiSoftkeys::~CVtUiSoftkeys() + { + __VTPRINTENTER( "SKs.~" ) + iFeatureManager.CommandManager().RemoveCommandUi( *this ); + delete iSoftkeyCommandContext; + delete iSoftkeySetting; + delete iSoftkeyValidationAction; + __VTPRINTEXIT( "SKs.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeys::ButtonGroup +// --------------------------------------------------------------------------- +// +CEikButtonGroupContainer& CVtUiSoftkeys::ButtonGroup() + { + __VTPRINTENTER( "SKs.ButtonGroup" ) + __VTPRINTEXIT( "SKs.ButtonGroup" ) + return iButtonGroupContainer; + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeys::StartL +// --------------------------------------------------------------------------- +// +void CVtUiSoftkeys::StartL() + { + __VTPRINTENTER( "SKs.StartL" ) + __VTPRINTEXIT( "SKs.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeys::Stop +// --------------------------------------------------------------------------- +// +void CVtUiSoftkeys::Stop() + { + __VTPRINTENTER( "SKs.Stop" ) + __VTPRINTEXIT( "SKs.Stop" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeys::InitFeatureL +// --------------------------------------------------------------------------- +// +void CVtUiSoftkeys::InitFeatureL() + { + __VTPRINTENTER( "SKs.InitFeatureL" ) + __VTPRINTEXIT( "SKs.InitFeatureL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeys::RefreshL +// --------------------------------------------------------------------------- +// +void CVtUiSoftkeys::RefreshL() + { + __VTPRINTENTER( "SKs.RefreshL" ) + iFeatureManager.CommandManager().ValidateSoftkeyItemsL( + *iSoftkeyValidationAction ); + iSoftkeySetting->DefineCommandsL( *iSoftkeyValidationAction ); + iButtonGroupContainer.DrawNow(); + __VTPRINTEXIT( "SKs.RefreshL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeys::AddCommandModifierL +// --------------------------------------------------------------------------- +// +TInt CVtUiSoftkeys::AddCommandModifier( CVtUiCommandModifyBase& aModifier ) + { + __VTPRINTENTER( "SKs.AddCommandModifier" ) + TInt result( iSoftkeySetting->AddModifier( aModifier ) ); + __VTPRINTEXITR( "SKs.AddCommandModifier %d", result ) + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeys::RemoveCommandModifier +// --------------------------------------------------------------------------- +// +void CVtUiSoftkeys::RemoveCommandModifier( CVtUiCommandModifyBase& aModifier ) + { + __VTPRINTENTER( "SKs.RemoveCommandModifier" ) + iSoftkeySetting->RemoveModifier( aModifier ); + __VTPRINTEXIT( "SKs.RemoveCommandModifier" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeys::CVtUiSoftkeys +// --------------------------------------------------------------------------- +// +CVtUiSoftkeys::CVtUiSoftkeys( CVtUiFeatureManager& aFeatureManager, + CEikButtonGroupContainer& aButtonGroupContainer ) + : CVtUiFeatureBase( EVtUiFeatureIdSoftkey, aFeatureManager ), + iButtonGroupContainer( aButtonGroupContainer ) + { + __VTPRINTENTER( "SKs.ctor" ) + __VTPRINTEXIT( "SKs.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeys::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiSoftkeys::ConstructL() + { + __VTPRINTENTER( "SKs.ConstructL" ) + iSoftkeyCommandContext = CVtUiSoftkeyContext::NewL( + iFeatureManager.CommandManager() ); + iSoftkeySetting = new ( ELeave ) CVtUiSoftkeySetting( *this ); + iSoftkeyValidationAction = CVtUiSoftkeyValidationAction::NewL(); + User::LeaveIfError( + iFeatureManager.CommandManager().AddCommandUi( *this ) ); + __VTPRINTEXIT( "SKs.ConstructL" ) + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/softkey/cvtuisoftkeysetting.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/softkey/cvtuisoftkeysetting.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2006 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: Softkey setting implementation. +* +*/ + + +#include +#include + +#include "cvtuisoftkeys.h" +#include "cvtuisoftkeysetting.h" +#include "cvtuisoftkeyvalidationaction.h" + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiSoftkeySetting::~CVtUiSoftkeySetting +// --------------------------------------------------------------------------- +// +CVtUiSoftkeySetting::~CVtUiSoftkeySetting() + { + __VTPRINTENTER( "SKSet.~" ) + __VTPRINTEXIT( "SKSet.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeySetting::CVtUiSoftkeySetting +// --------------------------------------------------------------------------- +// +CVtUiSoftkeySetting::CVtUiSoftkeySetting( CVtUiSoftkeys& aSoftkeys ) : + CVtUiCommandSetting( ECommandTypeSoftkeys ), + iSoftkeys( &aSoftkeys ) + { + __VTPRINTENTER( "SKSet.ctor" ) + __VTPRINTEXIT( "SKSet.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeySetting::DoDefineCommandsL +// --------------------------------------------------------------------------- +// +void CVtUiSoftkeySetting::DoDefineCommandsL() + { + __VTPRINTENTER( "SKSet.DoDefineCommandsL" ) + iSoftkeys->ButtonGroup().SetCommandSetL( Action().ResourceId() ); + __VTPRINTEXIT( "SKSet.DoDefineCommandsL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/softkey/cvtuisoftkeyvalidationaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/softkey/cvtuisoftkeyvalidationaction.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2006 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: Softkey validation action implementation. +* +*/ + + +#include +#include +#include + +#include "cvtuisoftkeyvalidationaction.h" +#include "tvtuicmdvalidatorcallback.h" + +// ======== MEMBER FUNCTIONS ======== + +// softkey ids +static const TInt SKIDS[] = + { + R_AVKON_SOFTKEYS_OPTIONS_BACK, + R_VIDEOTELUI_SOFTKEYS_EMPTY_ACTIVE_COMMAND, + R_VIDEOTELUI_SOFTKEYS_EMPTY_DIALEREXIT, + R_VIDEOTELUI_SOFTKEYS_SHARE_OBJECT_IMAGE, + R_VIDEOTELUI_SOFTKEYS_CAPTURE_VIDEO, + R_VIDEOTELUI_SOFTKEYS_ENABLE_AUDIO, + R_VIDEOTELUI_SOFTKEYS_ENABLE_VIDEO, + R_VIDEOTELUI_SOFTKEYS_DIALER, + R_VIDEOTELUI_SOFTKEYS_BT_HANDSFREE, + R_VIDEOTELUI_SOFTKEYS_LOUDSPEAKER, + R_VIDEOTELUI_SOFTKEYS_HANDSET_B, + R_VIDEOTELUI_SOFTKEYS_END_CALL, + R_AVKON_SOFTKEYS_EMPTY // this is end marker, keep it last + }; + +// --------------------------------------------------------------------------- +// CVtUiSoftkeyValidationAction::NewL +// --------------------------------------------------------------------------- +// +CVtUiSoftkeyValidationAction* CVtUiSoftkeyValidationAction::NewL() + { + __VTPRINTENTER( "SKValAct.NewL" ) + CVtUiSoftkeyValidationAction* self = + new ( ELeave ) CVtUiSoftkeyValidationAction(); + __VTPRINTEXIT( "SKValAct.NewL" ) + return self; + } +// --------------------------------------------------------------------------- +// CVtUiSoftkeyValidationAction::BeginProcess +// --------------------------------------------------------------------------- +// +void CVtUiSoftkeyValidationAction::BeginProcess() + { + __VTPRINTENTER( "SKValAct.EndProcess" ) + CVtUiCmdValidationActionBase::BeginProcess(); + iCurrentIdx = 0; + __VTPRINTEXIT( "SKValAct.EndProcess" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeyValidationAction::ProcessL +// --------------------------------------------------------------------------- +// +void CVtUiSoftkeyValidationAction::ProcessL( + const MVtUiCmdValidatorCallBack& aCallBack ) + { + __VTPRINTENTER( "SKValAct.ProcessL" ) + while ( SKIDS[ iCurrentIdx ] != R_AVKON_SOFTKEYS_EMPTY ) + { + if ( aCallBack.Call( SKIDS[ iCurrentIdx ] ) ) + { + break; + } + else + { + iCurrentIdx++; + } + } + __VTPRINTEXIT( "SKValAct.ProcessL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeyValidationAction::ResourceId +// --------------------------------------------------------------------------- +// +TInt CVtUiSoftkeyValidationAction::ResourceId() const + { + __VTPRINTENTER( "SKValAct.ResourceId" ) + __VTPRINTEXITR( "SKValAct.ResourceId %d", SKIDS[ iCurrentIdx ] ) + return SKIDS[ iCurrentIdx ]; + } + +// --------------------------------------------------------------------------- +// CVtUiSoftkeyValidationAction::CVtUiSoftkeyValidationAction +// --------------------------------------------------------------------------- +// +CVtUiSoftkeyValidationAction::CVtUiSoftkeyValidationAction() + { + __VTPRINTENTER( "SKValAct.ctor" ) + __VTPRINTEXIT( "SKValAct.ctor" ) + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/toolbar/cvtuifixedtoolbar.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/toolbar/cvtuifixedtoolbar.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,299 @@ +/* +* Copyright (c) 2008 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: Fixed toolbar UI feature implementation. +* +*/ + + +// INCLUDE FILES + +#include "cvtuifixedtoolbar.h" +#include "cvtuifeaturemanager.h" +#include "mvtuicomponentmanager.h" +#include "mvtuicommandmanager.h" +#include "videotelui.hrh" +#include "tvtuistates.h" +#include "cvtuitoolbarcmdpolicy.h" +#include "cvtuitoolbarskmodifier.h" +#include "CVtUiAppUi.h" +#include +#include +#include +#include "tvtuistates.h" +#include + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::NewL +// ----------------------------------------------------------------------------- +// +CVtUiFixedToolbar* CVtUiFixedToolbar::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "FixedToolbar.NewL" ) + CVtUiFixedToolbar* self = new ( ELeave ) CVtUiFixedToolbar( + aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + __VTPRINTEXIT( "FixedToolbar.NewL" ) + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::CVtUiFixedToolbar +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiFixedToolbar::CVtUiFixedToolbar( CVtUiFeatureManager& + aFeatureManager ) : CVtUiToolbarBase( aFeatureManager ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::ConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CVtUiFixedToolbar::ConstructL() + { + __VTPRINTENTER( "FixedToolbar.ConstructL" ) + BaseConstructL(); + + //create toolbar + iToolbar = iFeatureManager.AppUi().CurrentFixedToolbar(); + + // create and add items into the toolbar + CreateToolbarButtonsL(); + + // Dim all toolbar buttons until first refresh is called + DimToolbarbuttons( ETrue ); + + if ( !Layout_Meta_Data::IsLandscapeOrientation() ) + { + MakeToolbarVisible( EFalse ); + } + + __VTPRINTEXIT( "FixedToolbar.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::~CVtUiFixedToolbar +// Destructor. +// ----------------------------------------------------------------------------- +// +CVtUiFixedToolbar::~CVtUiFixedToolbar() + { + __VTPRINTENTER( "FixedToolbar.~" ) + delete iIdle; + __VTPRINTEXIT( "FixedToolbar.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::CreateToolbarButtons +// ----------------------------------------------------------------------------- +// +void CVtUiFixedToolbar::CreateToolbarButtonsL() + { + __VTPRINTENTER( "FixedToolbar.CreateToolbarButtons" ) + // Default buttons created in base clase + CVtUiToolbarBase::CreateToolbarButtonsL(); + + // toggle microphone + CreateToolbarItemL( R_AVKONBUTTON_AUDIO_ROUTING_BUTTON, + EVtUiCmdToolbarAudioRouting, iFeatureManager.AppUi() ); + + + __VTPRINTEXIT( "FixedToolbar.CreateToolbarButtons" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::PopulateCmdsIdsL +// ----------------------------------------------------------------------------- +// +void CVtUiFixedToolbar::PopulateCmdsIdsL() + { + __VTPRINTENTER( "FixedToolbar.PopulateCmdsIdsL" ) + // Default commands populated in base clase + CVtUiToolbarBase::PopulateCmdsIdsL(); + + CVtUiAppUi& appUi = iFeatureManager.AppUi(); + + iCmdIds.AppendL( EVtUiCmdActivateBT ); + iCmdIds.AppendL( EVtUiCmdSwitchFromBTToIHF ); + iCmdIds.AppendL( EVtUiCmdActivateLoudspeaker ); + iCmdIds.AppendL( EVtUiCmdDeactivateLoudspeaker ); + + __VTPRINTEXIT( "FixedToolbar.PopulateCmdsIdsL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::SetToolbarVisibilityAfterLayoutChangeL +// ----------------------------------------------------------------------------- +// +void CVtUiFixedToolbar::SetToolbarVisibilityAfterLayoutChangeL( TBool aVisible ) + { + // Portrait to landscape show tb + __VTPRINTENTER( "FixedToolbar.SetToolbarVisibilityAfterLayoutChangeL" ) + if( aVisible ) + { + __VTPRINT(DEBUG_GEN, "FixedToolbar.SetToolbarVisibilityAfterLayoutChangeL.1" ) + DimToolbarbuttons( ETrue ); + // Set flag + iFeatureManager.UiStates().SetIsFixedToolbarVisible( ETrue ); + // set visible + iFeatureManager.AppUi().CurrentFixedToolbar() + ->SetToolbarVisibility( ETrue ); + // Set callback to dim toolbarbuttons +// if ( !iIdle ) +// { +// iIdle = CIdle::NewL( CActive::EPriorityIdle ); +// } +// +// if ( !iIdle->IsActive() ) +// { +// iIdle->Start( TCallBack( &DoDimToolbarButtons, this ) ); +// } + } + // Landsacpe to portrait hide tb + else + { + __VTPRINT(DEBUG_GEN, "FixedToolbar.SetToolbarVisibilityAfterLayoutChangeL.2" ) + DimToolbarbuttons( EFalse ); + iFeatureManager.AppUi().CurrentFixedToolbar() + ->SetToolbarVisibility( EFalse ); + // Set flag + iFeatureManager.UiStates().SetIsFixedToolbarVisible( EFalse ); + } + __VTPRINTEXIT( "FixedToolbar.SetToolbarVisibilityAfterLayoutChangeL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::DimToolbarbuttons +// ----------------------------------------------------------------------------- +// +void CVtUiFixedToolbar::DimToolbarbuttons( TBool aIsDimmed ) + { + __VTPRINTENTER( "FixedToolbar.DimToolbarbuttons" ) + iToolbar->SetItemDimmed( EVtUiCmdToolbarToggleVideo, aIsDimmed, ETrue ); + iToolbar->SetItemDimmed( EVtUiCmdToolbarToggleMicrophone, aIsDimmed, ETrue ); + iToolbar->SetItemDimmed( EVtUiCmdToolbarAudioRouting, aIsDimmed, ETrue ); + __VTPRINTEXITR( "FixedToolbar.DimToolbarbuttons %d", aIsDimmed ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::MakeToolbarVisible +// ----------------------------------------------------------------------------- +// +void CVtUiFixedToolbar::MakeToolbarVisible( const TBool aVisible ) + { + __VTPRINTENTER( "FixedToolbar.MakeToolbarVisible" ) + iFeatureManager.AppUi().CurrentFixedToolbar()-> + SetToolbarVisibility( aVisible ); + iFeatureManager.UiStates().SetIsFixedToolbarVisible( aVisible ); + __VTPRINTEXITR( "FixedToolbar.MakeToolbarVisible %d", aVisible ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::DoShowToolbarL +// ----------------------------------------------------------------------------- +// +TInt CVtUiFixedToolbar::DoShowToolbarL( TAny* aAny ) + { + __VTPRINTENTER( "FixedToolbar.DoShowToolbarL" ) + CVtUiFixedToolbar* self = static_cast< CVtUiFixedToolbar* >( aAny ); + self->iFeatureManager.AppUi().CurrentFixedToolbar() + ->SetToolbarVisibility( ETrue ); + __VTPRINTEXIT( "FixedToolbar.DoShowToolbarL" ) + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::DoToolbarButton +// ----------------------------------------------------------------------------- +// +TInt CVtUiFixedToolbar::DoDimToolbarButtons( TAny* aAny ) + { + __VTPRINTENTER( "FixedToolbar.DoDimToolbarButtons" ) + CVtUiFixedToolbar* self = static_cast< CVtUiFixedToolbar* >( aAny ); + self->DimToolbarbuttons( ETrue ); + __VTPRINTEXIT( "FixedToolbar.DoDimToolbarButtons" ) + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::DoActivateL +// ----------------------------------------------------------------------------- +// +void CVtUiFixedToolbar::DoActivateL() + { + __VTPRINTENTER( "FixedToolbar.DoActivateL" ) + if ( !iFeatureManager.UiStates().IsFixedToolbarVisible() && + !Layout_Meta_Data::IsLandscapeOrientation() ) + { + // reset flag + iFeatureManager.UiStates().SetIsFixedToolbarVisible( ETrue ); + // Show toolbar with delay in order to prevent overdrawing + // witht other components. + iAsyncCallback->Cancel(); + iAsyncCallback->Set( TCallBack( &DoShowToolbarL, this ) ); + iAsyncCallback->CallBack(); + } + else + { + // Undim buttons + __VTPRINT( DEBUG_GEN, "FixedToolbar.DoDeactivateL.DTB EFalse" ) + // toolbar might be unvisible, because condition in the contructor + // "if ( !Layout_Meta_Data::IsLandscapeOrientation() )" + // will be evaluated ture eventhough the orientation is forced to be landsacepe + // because it seems that the orientation is still portrait in the constructor phase + MakeToolbarVisible( ETrue ); + DimToolbarbuttons( EFalse ); + } + // Start blocking pointer events + BlockPointerEvents( ETrue ); + // Base class + CVtUiToolbarBase::DoActivateL(); + __VTPRINTEXIT( "FixedToolbar.DoActivateL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFixedToolbar::DoDeactivateL +// ----------------------------------------------------------------------------- +// +void CVtUiFixedToolbar::DoDeactivateL() + { + __VTPRINTENTER( "FixedToolbar.DoDeactivateL" ) + iAsyncCallback->Cancel(); + if ( !iFeatureManager.UiStates().IsFixedToolbarVisible() && + !Layout_Meta_Data::IsLandscapeOrientation() ) + { + iFeatureManager.AppUi().CurrentFixedToolbar() + ->SetToolbarVisibility( EFalse ); + __VTPRINT( DEBUG_GEN, "FixedToolbar.DoDeactivateL.Vs" ) + } + else + { + // Dim all buttons + __VTPRINT( DEBUG_GEN, "FixedToolbar.DoDeactivateL.DTB ETrue" ) + DimToolbarbuttons( ETrue ); + } + // Stop blocking pointer events + BlockPointerEvents( EFalse ); + // Base class + CVtUiToolbarBase::DoDeactivateL(); + __VTPRINTEXIT( "FixedToolbar.DoDeactivateL" ) + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/toolbar/cvtuifloatingtoolbar.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/toolbar/cvtuifloatingtoolbar.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,468 @@ +/* +* Copyright (c) 2008 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: Floating toolbar UI feature implementation. +* +*/ + + +// INCLUDE FILES + +#include "cvtuifloatingtoolbar.h" +#include "cvtuifeaturemanager.h" +#include "mvtuicomponentmanager.h" +#include "mvtuicommandmanager.h" +#include "cvtuitoolbarbutton.h" +#include "videotelui.hrh" +#include "tVtuifeaturevariation.h" +#include "tvtuistates.h" +#include "cvtuitoolbarcmdpolicy.h" +#include "cvtuitoolbarskmodifier.h" +#include "CVtUiAppUi.h" +#include +#include +#include +#include +#include +#include +#include + +// CONSTANTS +static const TInt KThreeToolbarbuttons = 3; +static const TInt KFourToolbarbuttons = 4; +static const TInt KFiveToolbarbuttons = 5; +static const TInt KSixToolbarbuttons = 6; +static const TInt KSevenToolbarbuttons = 7; + + +// ----------------------------------------------------------------------------- +// CVtUiFloatingToolbar::NewL +// ----------------------------------------------------------------------------- +// +CVtUiFloatingToolbar* CVtUiFloatingToolbar::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "FloatingToolbar.NewL" ) + TVtUiSideVolumeKeysVariation svkvariation; + if ( !svkvariation.IsSideVolumeKeysSupported() ) + { + // User of this class should notice that newl could return null, + // even if no leave happened. + __VTPRINT(DEBUG_GEN, "Toolbar.NewL.NULL" ) + return NULL; + } + CVtUiFloatingToolbar* self = new ( ELeave ) CVtUiFloatingToolbar( + aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + __VTPRINTEXIT( "FloatingToolbar.NewL" ) + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiFloatingToolbar::CVtUiFloatingToolbar +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiFloatingToolbar::CVtUiFloatingToolbar( CVtUiFeatureManager& + aFeatureManager ) : CVtUiToolbarBase( aFeatureManager ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiFloatingToolbar::ConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CVtUiFloatingToolbar::ConstructL() + { + __VTPRINTENTER( "FloatingToolbar.ConstructL" ) + BaseConstructL(); + + // fixed toolbar is always visible ( defined in resource) hide it + iFeatureManager.AppUi().CurrentFixedToolbar()->SetToolbarVisibility( EFalse ); + + // create toolbar + iToolbar = CAknToolbar::NewL( R_VIDEOTELUI_FLOATING_TOOLBAR ); + + GfxTransEffect::Register( iToolbar, KNullUid, EFalse ); + + // create and add items into the toolbar + CreateToolbarButtonsL(); + + iFeatureManager.UiStates().SetIsFloatingToolbarVisible( EFalse ); + + // layout toolbar + LayoutToolbarL(); + + User::LeaveIfError( + iFeatureManager.ComponentManager().ChangeResourceChangeRegistration( + *this, MVtUiComponentManager::ERegister ) ); + + __VTPRINTEXIT( "FloatingToolbar.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFloatingToolbar::~CVtUiFloatingToolbar +// Destructor. +// ----------------------------------------------------------------------------- +// +CVtUiFloatingToolbar::~CVtUiFloatingToolbar() + { + __VTPRINTENTER( "FloatingToolbar.~" ) + // unregister resource change registration + iFeatureManager.ComponentManager().ChangeResourceChangeRegistration( + *this, MVtUiComponentManager::EUnregister ); + delete iToolbar; + iToolbar = NULL; + __VTPRINTEXIT( "FloatingToolbar.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFloatingToolbar::PopulateCmdsIdsL +// ----------------------------------------------------------------------------- +// +void CVtUiFloatingToolbar::PopulateCmdsIdsL() + { + __VTPRINTENTER( "FloatingToolbar.PopulateCmdsIdsL" ) + CVtUiAppUi& appUi = iFeatureManager.AppUi(); + + // Default commands populated in base clase + CVtUiToolbarBase::PopulateCmdsIdsL(); + + iCmdIds.AppendL( EVtUiCmdZoom ); + + switch( iNumberOfToolbarButtons ) + { + case KFourToolbarbuttons: + iCmdIds.AppendL( EVtUiCmdUsePrimaryCamera ); + iCmdIds.AppendL( EVtUiCmdUseSecondaryCamera ); + break; + + case KFiveToolbarbuttons: + iCmdIds.AppendL( EVtUiCmdUsePrimaryCamera ); + iCmdIds.AppendL( EVtUiCmdUseSecondaryCamera ); + iCmdIds.AppendL( EVtUiCmdSwapImagesPlaces ); + break; + + case KSixToolbarbuttons: + iCmdIds.AppendL( EVtUiCmdUsePrimaryCamera ); + iCmdIds.AppendL( EVtUiCmdUseSecondaryCamera ); + iCmdIds.AppendL( EVtUiCmdSwapImagesPlaces ); + iCmdIds.AppendL( EVtUiCmdShareObjectImage ); + break; + /* + case KSevenToolbarbuttons: + iCmdIds.AppendL( EVtUiCmdUsePrimaryCamera ); + iCmdIds.AppendL( EVtUiCmdUseSecondaryCamera ); + iCmdIds.AppendL( EVtUiCmdSwapImagesPlaces ); + iCmdIds.AppendL( EVtUiCmdShareObjectImage ); + iCmdIds.AppendL( EVtUiCmdSnapshot ); + break; + */ + default: + break; + } + + __VTPRINTEXIT( "FloatingToolbar.PopulateCmdsIdsL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFloatingToolbar::CreateToolbarButtons +// ----------------------------------------------------------------------------- +// +void CVtUiFloatingToolbar::CreateToolbarButtonsL() + { + __VTPRINTENTER( "FloatingToolbar.CreateToolbarButtons" ) + + // Default buttons created in base clase + CVtUiToolbarBase::CreateToolbarButtonsL(); + + CVtUiAppUi& appUi = iFeatureManager.AppUi(); + + // activate zoom mode + CreateToolbarItemL( R_AVKONBUTTON_ACTIVATE_ZOOM_MODE_BUTTON, + EVtUiCmdZoom, appUi ); + // disable tooltip from button's latched state + // because tooltip needs to be shown only when + // button gets focus not then when button is selected + FindToolbarItemByCommandId( EVtUiCmdZoom )->State( 1 ) + ->SetHelpTextL( KNullDesC() ); + + switch( iNumberOfToolbarButtons ) + { + case KFourToolbarbuttons: + // toggle camera + CreateToolbarItemL( R_AVKONBUTTON_TOGGLE_CAMERA_BUTTON, + EVtUiCmdToolbarToggleCamera, appUi ); + break; + + case KFiveToolbarbuttons: + // toggle camera + CreateToolbarItemL( R_AVKONBUTTON_TOGGLE_CAMERA_BUTTON, + EVtUiCmdToolbarToggleCamera, appUi ); + + // swap images + CreateToolbarItemL( R_AVKONBUTTON_SWAP_IMAGES_BUTTON, + EVtUiCmdSwapImagesPlaces, appUi ); + break; + + case KSixToolbarbuttons: + // toggle camera + CreateToolbarItemL( R_AVKONBUTTON_TOGGLE_CAMERA_BUTTON, + EVtUiCmdToolbarToggleCamera, appUi ); + + // swap images + CreateToolbarItemL( R_AVKONBUTTON_SWAP_IMAGES_BUTTON, + EVtUiCmdSwapImagesPlaces, appUi ); + + // share file + CreateToolbarItemL(R_AVKONBUTTON_SHARE_FILE_BUTTON, + EVtUiCmdShareObjectImage, appUi ); + break; + /* + case KSevenToolbarbuttons: + // toggle camera + CreateToolbarItemL( R_AVKONBUTTON_TOGGLE_CAMERA_BUTTON, + EVtUiCmdToolbarToggleCamera, appUi ); + + // swap images + CreateToolbarItemL( R_AVKONBUTTON_SWAP_IMAGES_BUTTON, + EVtUiCmdSwapImagesPlaces, appUi ); + + // share file + CreateToolbarItemL(R_AVKONBUTTON_SHARE_FILE_BUTTON, + EVtUiCmdShareObjectImage, appUi ); + + CreateToolbarItemL( R_AVKONBUTTON_SNAPSHOT_BUTTON, + EVtUiCmdSnapshot, appUi ); + + break; + */ + default: + break; + } + + __VTPRINTEXIT( "FloatingToolbar.CreateToolbarButtons" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFloatingToolbar::DoActivateL +// ----------------------------------------------------------------------------- +// +void CVtUiFloatingToolbar::DoActivateL() + { + __VTPRINTENTER( "FloatingToolbar.DoActivateL" ) + // start blocking key events + BlockKeyEvents( ETrue ); + // make toolbar visible + if ( !iToolbar->IsVisible() || + !iFeatureManager.UiStates().IsFloatingToolbarVisible() ) + { + // Show toolbar + iToolbar->SetToolbarVisibility( ETrue ); + } + else + { + // Undim toolbar + DimToolbar( EFalse, EFalse ); + if ( iCmdFocus != KErrNotFound ) + { + // Set focus item + iToolbar->SetItemDimmed( iCmdFocus, EFalse, ETrue ); + iToolbar->SetFocusedItemL( iCmdFocus ); + iCmdFocus = KErrNotFound; + } + } + iFeatureManager.UiStates().SetIsFloatingToolbarVisible( EFalse ); + CVtUiToolbarBase::DoActivateL(); + __VTPRINTEXIT( "FloatingToolbar.DoActivateL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFloatingToolbar::DoDeactivateL +// ----------------------------------------------------------------------------- +// +void CVtUiFloatingToolbar::DoDeactivateL() + { + __VTPRINTENTER( "FloatingToolbar.DoDeactivateL" ) + // stop blocking key events + BlockKeyEvents( EFalse ); + if ( iToolbar ) + { + // Save foces item; + if ( iToolbar->FocusedItem() != KErrNotFound ) + { + iCmdFocus = iToolbar->FocusedItem(); + } + TVtUiStates& uiStates = iFeatureManager.UiStates(); + if ( !uiStates.IsFloatingToolbarVisible() ) + { + __VTPRINT( DEBUG_GEN, "FloatingToolbar.DoDeactivateL.Vs" ) + iToolbar->SetToolbarVisibility( EFalse ); + } + else + { + // Dim toolbar + __VTPRINT( DEBUG_GEN, "FloatingToolbar.DoDeactivateL.Dim ETrue" ) + DimToolbar( ETrue, EFalse ); + } + CVtUiAppUi& appUi = iFeatureManager.AppUi(); + const TBool isZoomModeOn( uiStates.IsZoomModeOn() ); + if ( isZoomModeOn ) + { + // set zoom indicator to be hidden + appUi.SetZoomModeL( EFalse ); + } + } + CVtUiToolbarBase::DoDeactivateL(); + __VTPRINTEXIT( "FloatingToolbar.DoDeactivateL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFloatingToolbar::HandleResourceChangeL +// ----------------------------------------------------------------------------- +// +void CVtUiFloatingToolbar::HandleResourceChangeL( TInt /*aType*/ ) + { + __VTPRINTENTER( "FloatingToolbar.HandleResourceChangeL" ) + // akntoolbar should allways be in the control stack + // no need to call + // iToolbar->HandleResourceChange + LayoutToolbarL(); + __VTPRINTEXIT( "FloatingToolbar.HandleResourceChangeL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFloatingToolbar::RectFromLayout +// ----------------------------------------------------------------------------- +// +TRect CVtUiFloatingToolbar::RectFromLayout( + const TAknWindowComponentLayout& aComponentLayout ) const + { + __VTPRINTENTER( "FloatingToolbar.RectFromLayout" ) + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect ); + + TAknWindowLineLayout lineLayout = aComponentLayout.LayoutLine(); + TAknLayoutRect layoutRect; + layoutRect.LayoutRect( mainPaneRect, lineLayout ); + __VTPRINTEXIT( "FloatingToolbar.RectFromLayout" ) + return layoutRect.Rect(); + } + +// ----------------------------------------------------------------------------- +// CVtUiFloatingToolbar::LayoutToolbarL +// ----------------------------------------------------------------------------- +// +void CVtUiFloatingToolbar::LayoutToolbarL() + { + __VTPRINTENTER( "FloatingToolbar.LayoutToolbarL" ) + + // Get variety + TInt variety = GetVariety( Layout_Meta_Data::IsLandscapeOrientation() ); + // get toolbar rect from layout + TRect toolbarRect = RectFromLayout( AknLayoutScalable_Apps:: + popup_toolbar_window_cp04( variety ).LayoutLine() ); + //set top left coordinates i.e. placeholder + iToolbar->SetPosition( toolbarRect.iTl ); + + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + __VTPRINT( DEBUG_GEN, "Toolbar.LayoutToolbarL.LS" ) + iToolbar->SetOrientation( EAknOrientationVertical ); + } + else + { + __VTPRINT( DEBUG_GEN, "Toolbar.LayoutToolbarL.PR" ) + iToolbar->SetOrientation( EAknOrientationHorizontal ); + } + __VTPRINTEXIT( "FloatingToolbar.LayoutToolbarL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiFloatingToolbar::GetVariety +// ----------------------------------------------------------------------------- +// +TInt CVtUiFloatingToolbar::GetVariety( TBool aIsLandscapeOrientation ) + { + __VTPRINTENTER( "FloatingToolbar.GetVariety" ) + TInt variety = 0; + switch ( iNumberOfToolbarButtons ) + { + case KThreeToolbarbuttons: + if( aIsLandscapeOrientation ) + { + variety = 5; + } + else + { + variety = 9; + } + break; + + case KFourToolbarbuttons: + if( aIsLandscapeOrientation ) + { + variety = 4; + } + else + { + variety = 8; + } + break; + + case KFiveToolbarbuttons: + if( aIsLandscapeOrientation ) + { + variety = 3; + } + else + { + variety = 7; + } + break; + + case KSixToolbarbuttons: + if( aIsLandscapeOrientation ) + { + variety = 2; + } + else + { + variety = 6; + } + break; + + case KSevenToolbarbuttons: + if( aIsLandscapeOrientation ) + { + variety = 1; + } + else + { + variety = 4; + } + break; + + default: + + break; + } + __VTPRINTEXITR( "FloatingToolbar.GetVariety =%d",variety ) + return variety; + } +// End of File + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/toolbar/cvtuihidetoolbaritemaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/toolbar/cvtuihidetoolbaritemaction.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,244 @@ +/* +* 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: Toolbar hide item action class. +* +*/ + + +#include +#include "cvtuihidetoolbaritemaction.h" +#include "tvtuicmdvalidatorcallback.h" +#include "tvtuitoolbarcommanditerator.h" +#include "cvtuitoolbarbase.h" +#include "videotelui.hrh" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiHideToolbarItemAction::NewL +// --------------------------------------------------------------------------- +// +CVtUiHideToolbarItemAction* CVtUiHideToolbarItemAction::NewL( + CVtUiToolbarBase* aToolbar, const TVtUiStates& aUiStates ) + { + __VTPRINTENTER( "HideTbAct.NewL" ) + CVtUiHideToolbarItemAction* self = + new ( ELeave ) CVtUiHideToolbarItemAction( aToolbar, aUiStates ); + __VTPRINTEXIT( "HideTbAct.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiHideToolbarItemAction::~CVtUiHideToolbarItemAction +// --------------------------------------------------------------------------- +// +CVtUiHideToolbarItemAction::~CVtUiHideToolbarItemAction() + { + } + +// --------------------------------------------------------------------------- +// CVtUiHideToolbarItemAction::ProcessL +// --------------------------------------------------------------------------- +// +void CVtUiHideToolbarItemAction::ProcessL( + const MVtUiCmdValidatorCallBack& aCallBack ) + { + __VTPRINTENTER( "HideTbAct.ProcessL" ) + for ( TVtUiToolbarCommandIterator i( *iToolbar ); i.HasNext(); ) + { + TInt commandId( i.Next() ); + if ( !IsCommandHandled( commandId ) ) + { + __VTPRINT2( DEBUG_GEN, "HideTbAct.cb.call.cmddId=%d", commandId ) + if ( aCallBack.Call( commandId ) ) // primarypolicy + { // says can't be shown + CommandHandledL( commandId ); + SetItemHiddenL( commandId ); + } + else + { + HideOrShowToolbarControlL( commandId ); + } + } + } + __VTPRINTEXIT( "HideTbAct.ProcessL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiHideToolbarItemAction::CVtUiHideToolbarItemAction +// --------------------------------------------------------------------------- +// +CVtUiHideToolbarItemAction::CVtUiHideToolbarItemAction + ( CVtUiToolbarBase* aToolbar, const TVtUiStates& aUiStates ) + : iToolbar( aToolbar ), iUiStates ( aUiStates ) + { + __VTPRINTENTER( "HideTbAct.ctor" ) + __VTPRINTEXIT( "HideTbAct.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiHideToolbarItemAction::SetItemHiddenL +// --------------------------------------------------------------------------- +// +void CVtUiHideToolbarItemAction::SetItemHiddenL( TInt aCommandId ) + { + __VTPRINTENTER( "HideTbAct.SetItemHidden" ) + iToolbar->SetCmdIdVisibilityStateL( aCommandId, + CVtUiToolbarBase::EHidden ); + __VTPRINTEXIT( "HideTbAct.SetItemHidden" ) + } + +// --------------------------------------------------------------------------- +// CVtUiHideToolbarItemAction::HideOrShowToolbarControlL +// --------------------------------------------------------------------------- +// +void CVtUiHideToolbarItemAction::HideOrShowToolbarControlL + ( TInt aCommandId ) + { + __VTPRINTENTER( "HideTbAct.HideOrShowToolbarControlL" ) + TBool isZoomModeOn = iUiStates.IsZoomModeOn(); + TBool isVolumeModeOn = iUiStates.IsVolumeModeOn(); + TBool isBrightnessModeOn = iUiStates.IsBrightnessModeOn(); + TBool isContrastModeOn = iUiStates.IsContrastModeOn(); + TBool isDialerOpen = iUiStates.IsDialerOpen(); + TBool isDialerActivating = iUiStates.IsDialerActivating(); + TBool isWhiteBalanceModeOn = iUiStates.IsWhiteBalanceModeOn(); + TBool isColorToneModeOn = iUiStates.IsColorToneModeOn(); + TBool isCaptureModeOn = iUiStates.IsCaptureModeOn(); + TBool isSomeElseZoomOn = isBrightnessModeOn || isContrastModeOn || isDialerOpen || isVolumeModeOn + || isDialerActivating || isWhiteBalanceModeOn || isColorToneModeOn || isCaptureModeOn; + TBool isSomeoneOn = isZoomModeOn || isSomeElseZoomOn; + TBool dimmed = EFalse; + const TVtUiMediaState& mediaState( iUiStates.MediaState() ); + const TVtUiAudioState& audioState( iUiStates.AudioState() ); + + switch ( aCommandId ) + { + case EVtUiCmdDisableVideo: + case EVtUiCmdSwapImagesPlaces: + case EVtUiCmdDisableAudio: + case EVtUiCmdEnableAudio: + case EVtUiCmdEnableVideo: + if ( isSomeoneOn ) + { + dimmed = ETrue; + } + break; + + case EVtUiCmdUsePrimaryCamera: + case EVtUiCmdUseSecondaryCamera: + if ( mediaState.IsSharing() + || isSomeoneOn ) + { + dimmed = ETrue; + } + break; + case EVtUiCmdZoom: + if ( !mediaState.IsVideo() || + mediaState.IsFrozen() || + mediaState.IsSharing() || + isSomeElseZoomOn ) + { + dimmed = ETrue; + } + break; + + case EVtUiCmdShareObjectImage: + if ( mediaState.IsFrozen() || + mediaState.IsVideoPermanentlyStopped() || + isSomeoneOn ) + { + dimmed = ETrue; + } + break; + + case EVtUiCmdActivateBT: + if ( !audioState.CanActivateBtHf() || + audioState.IsAudioPermanentlyStopped() || + isSomeoneOn ) + { + dimmed = ETrue; + } + break; + + case EVtUiCmdDeactivateLoudspeaker: + if ( !audioState.CanDeactivateLoudspeaker() || + audioState.IsAudioPermanentlyStopped() || + isSomeoneOn ) + { + dimmed = ETrue; + } + break; + + case EVtUiCmdSwitchFromBTToIHF: + if ( !audioState.CanDeactivateBtHf() || + !audioState.CanActivateLoudspeaker() || + audioState.IsAudioPermanentlyStopped() || + isSomeoneOn ) + { + dimmed = ETrue; + } + break; + + case EVtUiCmdActivateLoudspeaker: + if ( !audioState.CanActivateLoudspeaker() || + audioState.IsAudioPermanentlyStopped() || + isSomeoneOn ) + { + dimmed = ETrue; + } + break; + + /* + case EVtUiCmdSnapshot: + if ( iUiStates.IsContrastModeOn() || iUiStates.IsBrightnessModeOn () + || isZoomModeOn || ( !iUiStates.MediaState().IsVideo() && + !iUiStates.MediaState().IsFrozen() ) || + !iUiStates.MediaState().IsFreezeSupported() || iUiStates.IsContrastModeOn() || + iUiStates.IsBrightnessModeOn() || isVolumeModeOn ) + { + dimmed = ETrue; + } + break; + */ + default: + dimmed = EFalse; + break; + } + + // update toolbar's commands visibility values + if ( dimmed ) + { + iToolbar->SetCmdIdVisibilityStateL( aCommandId, + CVtUiToolbarBase::EDimmed ); + } + else + { + iToolbar->SetCmdIdVisibilityStateL( aCommandId, + CVtUiToolbarBase::EShown ); + } + __VTPRINTEXIT( "HideTbAct.HideOrShowToolbarControlL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiHideToolbarItemAction::EndProcess +// --------------------------------------------------------------------------- +// +void CVtUiHideToolbarItemAction::EndProcess() + { + __VTPRINTENTER( "HideTbAct.EndProcess" ) + TRAP_IGNORE( iToolbar->UpdateToolbarL() ); + __VTPRINTEXIT( "HideTbAct.EndProcess" ) + } +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/toolbar/cvtuitoolbarbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/toolbar/cvtuitoolbarbase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,1260 @@ +/* +* Copyright (c) 2008 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: Base class for toolbar. +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include "videotelui.hrh" +#include "cvtuitoolbarbase.h" +#include "mvtuifeature.h" +#include "tvtuistates.h" +#include "cvtuitoolbarcontext.h" +#include "cvtuitoolbarcmdpolicy.h" +#include "cvtuicommandpolicymanager.h" +#include "cvtuihidetoolbaritemaction.h" +#include "cvtuifeaturemanager.h" +#include "CVtUiAppUi.h" +#include "mvtuicommandui.h" +#include "cvtuitoolbarskmodifier.h" +#include "mvtuicommandmanager.h" +#include "mvtuicomponentmanager.h" +#include "cvtuitoolbarbutton.h" +#include "VideoTelephonyInternalCRKeys.h" +#include "tVtuifeaturevariation.h" +#include "cvtuitoolbarbutton.h" +#include + +// Implementation of TVtUiToolbarComponentState + +// --------------------------------------------------------------------------- +// TVtUiToolbarComponentState::TVtUiToolbarComponentState +// --------------------------------------------------------------------------- +// +TVtUiToolbarComponentState::TVtUiToolbarComponentState( + MVtUiComponent& aComponent ) : + TVtUiComponentState( aComponent, + TVtUiBlockListBitField( + MVtUiComponent::EComponentIdNull ) ) + { + } + +// --------------------------------------------------------------------------- +// Used in FindToolbaItemByCommandId method to search toolbar item by cmd id. +// --------------------------------------------------------------------------- +// +TInt ToolbarItemIdCmpFunc( const TInt* aId, + const CVtUiToolbarButton& aToolbarItem ) + { + return ( *aId - aToolbarItem.CmdId() ); + } + + +// --------------------------------------------------------------------------- +// Used in CreateToolbarItemL method to search feature by cmd id. +// --------------------------------------------------------------------------- +// +TInt ToolbarCmpFunc( const CVtUiToolbarButton& aV1, const CVtUiToolbarButton& aV2 ) + { + return ( aV1.CmdId() - aV2.CmdId() ); + } + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::CVtUiToolbarBase +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CVtUiToolbarBase::CVtUiToolbarBase( CVtUiFeatureManager& aFeatureManager ) + : CVtUiFeatureBase( EVtUiFeatureIdToolbar, aFeatureManager ), + iComponentState( *this ) + { + __VTPRINTENTER( "Toolbar.CVtUiToolbarBase" ) + // Get number of supported buttons. + // Six is the default value for floating toolbar + // and three buttons for fixed toolbar + TVtUiToolbarVariation toolbar; + iNumberOfToolbarButtons = toolbar.NumberOfButtons(); + iCmdFocus = KErrNotFound; + __VTPRINTEXITR( "Toolbar.CVtUiToolbarBase %d", iNumberOfToolbarButtons ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::BaseConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::BaseConstructL() + { + __VTPRINTENTER( "Toolbar.ConstructL" ) + CVtUiFeatureBase::BaseConstructL(); + iFeatureManager.UiStates().SetIsToolbarAvailable( ETrue ); + __VTPRINTEXIT( "Toolbar.ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::~CVtUiToolbarBase +// Destructor. +// ----------------------------------------------------------------------------- +// +CVtUiToolbarBase::~CVtUiToolbarBase() + { + __VTPRINTENTER( "Toolbar.~" ) + // Stop(); + // Stop can not be called here if toolbar is asked from ui fw = fixed toolbar. + // If stop is called a crash occurs, whose root cause can not be solved. + // It is related somehow with focus lost in ui fw. + + Clean(); + // unregister layout change + iFeatureManager.ComponentManager().ChangeLayoutChangeRegistration( + *this, MVtUiComponentManager::EUnregister ); + // no need tot call resetanddestroy because buttons ownership is + // transferred to akntoolbar. + iToolBarControls.Reset(); + delete iToolbarCtx; + delete iToolbarCmdPolicy; + delete iHideToolbarItemAction; + delete iToolbarSKModifier; + iCmdIds.Close(); + iCmdStates.Close(); + __VTPRINTEXIT( "Toolbar.~" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::DynInitToolbarL +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::DynInitToolbarL( TInt /*aResourceId*/, + CAknToolbar* /*aToolbar*/ ) + { + __VTPRINTENTER( "Toolbar.DynInitToolbarL" ) + __VTPRINTEXIT( "Toolbar.DynInitToolbarL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::OfferToolbarEventL +// Destructor. +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::OfferToolbarEventL( TInt aCommand ) + { + __VTPRINTENTER( "Toolbar.OfferToolbarEventL" ) + __VTPRINT2( DEBUG_GEN, "Toolbar.OfferToolbarEventL.aCommand=%d", aCommand ) + + // if capture mode is on all msk events must be converted to capture command + if ( iFeatureManager.UiStates().IsCaptureModeOn() ) + { + iFeatureManager.AppUi().HandleCommandL( EVtUiCmdCapture ); + return; + } + + TInt command = MapCmdIdToChilId( aCommand ); + + if ( EVtUiCmdSwapImagesPlaces == command ) + { + if ( !( iFeatureManager.AppUi().CanSwapImagePlaces() ) ) + { + return; + } + } + + iFeatureManager.AppUi().HandleCommandL( command ); + + __VTPRINTEXITR( "Toolbar.OfferToolbarEventL.cmd %d", aCommand ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::StartL +// Destructor. +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::StartL() + { + CVtUiFeatureBase::StartL(); + __VTPRINTENTER( "Toolbar.StartL" ) + TInt error; + if ( iFeatureState == MVtUiFeature::EReady ) + { + TRAP( error, iFeatureManager.ComponentManager(). + RequestActivationL( MVtUiComponent::EComponentIdToolbar ) ); + + // set state + iFeatureState = MVtUiFeature::EActive; + } + __VTPRINTEXITR( "Toolbar.StartL error = %d", error ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::Stop +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::Stop() + { + __VTPRINTENTER( "Toolbar.Stop" ) + TInt error; + if ( iFeatureState == MVtUiFeature::EActive ) + { + TRAP( error, iFeatureManager.ComponentManager(). + DeActivateComponentL ( MVtUiComponent::EComponentIdToolbar ) ); + // set state + iFeatureState = MVtUiFeature::EReady; + } + __VTPRINTEXITR( "Toolbar.Stop error = %d", error ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::InitFeature +// Delayed initialization of the feature +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::InitFeatureL() + { + __VTPRINTENTER( "Toolbar.InitFeatureL" ) + iFeatureState = EPreparing; + iToolBarControls.ReserveL( iNumberOfToolbarButtons ); + + //create toolbar + //iToolbar = CAknToolbar::NewL( R_VIDEOTELUI_TOOLBAR ); + + iToolbar->SetToolbarObserver( this ); + + // Prohibit toolbar sliding on UI. + iToolbar->SetWithSliding( EFalse ); + + // create toolbar context and policy + iToolbarCtx = + CVtUiToolbarContext::NewL( iFeatureManager.CommandManager() ); + + iToolbarCmdPolicy = CVtUiToolbarCmdPolicy::NewL( *this ); + + // create toolbaraction + iHideToolbarItemAction = CVtUiHideToolbarItemAction::NewL( this, + iFeatureManager.UiStates() ); + + // create sofkey modifier + iToolbarSKModifier = CVtUiToolbarSKModifier:: + NewL( iFeatureManager.AppUi(), iFeatureManager.UiStates() ); + + // set supported commands + PopulateCmdsIdsL(); + + User::LeaveIfError( + iFeatureManager.ComponentManager().ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::ERegister ) ); + + User::LeaveIfError( + iFeatureManager.ComponentManager().ChangeLayoutChangeRegistration( + *this, MVtUiComponentManager::ERegister ) ); + + iFeatureState = EReady; + + __VTPRINTEXIT( "Toolbar.InitFeatureL" ) + } + + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::MapCmdIdToChilId +// ----------------------------------------------------------------------------- +// +TInt CVtUiToolbarBase::MapCmdIdToChilId( TInt aCmdId ) + { + __VTPRINTENTER( "Toolbar.MapCmdIdToChilId" ) + __VTPRINT2( DEBUG_GEN, "Toolbar.MapCmdIdToChilId.aCmdId=%d", aCmdId ) + TInt result = aCmdId; + + CVtUiToolbarButton* tbButton = FindToolbarItemByCommandId( aCmdId ); + + const TInt stateIndexValue( tbButton->StateIndex() ); + __VTPRINT2( DEBUG_GEN, "Toolbar.MapCmdIdToChilId.idx=%d", stateIndexValue ) + switch( aCmdId ) + { + case EVtUiCmdToolbarToggleVideo: + { + switch ( stateIndexValue ) + { + case 0: + case 1: + result = EVtUiCmdDisableVideo; + break; + case 2: + case 3: + result = EVtUiCmdEnableVideo; + break; + } + } + break; + + case EVtUiCmdToolbarToggleMicrophone: + { + switch ( stateIndexValue ) + { + case 0: + case 1: + result = EVtUiCmdDisableAudio; + break; + case 2: + case 3: + result = EVtUiCmdEnableAudio; + break; + } + } + break; + + case EVtUiCmdToolbarAudioRouting: + { + switch ( stateIndexValue ) + { + case 0: + case 1: + result = EVtUiCmdDeactivateLoudspeaker; + break; + case 2: + case 3: + result = EVtUiCmdSwitchFromBTToIHF; + break; + case 4: + case 5: + result = EVtUiCmdActivateLoudspeaker; + break; + case 6: + case 7: + result = EVtUiCmdActivateBT; + break; + default: + break; + }; + } + break; + + case EVtUiCmdToolbarToggleCamera: + { + switch ( stateIndexValue ) + { + case 0: + case 1: + result = EVtUiCmdUsePrimaryCamera; + break; + case 2: + case 3: + result = EVtUiCmdUseSecondaryCamera; + break; + } + } + break; + + default: + break; + } + + if ( aCmdId == result ) + { + TInt index( stateIndexValue - 1 ); + if ( index < 0 ) + { + index = tbButton->StatesCount() - 1; + } + tbButton->SetCurrentState( index, EFalse ); + } + + __VTPRINTEXITR( "Toolbar.MapCmdIdToChilId.result %d", (TInt)result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::MapCmdIdToParentId +// ----------------------------------------------------------------------------- +// +TInt CVtUiToolbarBase::MapCmdIdToParentId( TInt aCmdId ) + { + __VTPRINTENTER( "Toolbar.MapCmdIdToParentId" ) + TInt result = aCmdId; + switch( aCmdId ) + { + case EVtUiCmdDisableVideo: + case EVtUiCmdEnableVideo: + result = EVtUiCmdToolbarToggleVideo; + break; + + case EVtUiCmdDisableAudio: + case EVtUiCmdEnableAudio: + result = EVtUiCmdToolbarToggleMicrophone; + break; + + case EVtUiCmdActivateBT: + case EVtUiCmdSwitchFromBTToIHF: + case EVtUiCmdActivateLoudspeaker: + case EVtUiCmdDeactivateLoudspeaker: + result = EVtUiCmdToolbarAudioRouting; + break; + + case EVtUiCmdUsePrimaryCamera: + case EVtUiCmdUseSecondaryCamera: + result = EVtUiCmdToolbarToggleCamera; + break; + + default: + break; + } + __VTPRINTEXITR( "Toolbar.MapCmdIdToParentId.result %d", (TInt)result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::IsCmdIdVisibleInToggleButton +// ----------------------------------------------------------------------------- +// +TBool CVtUiToolbarBase::IsCmdIdVisibleInToggleButton( TInt aCmdId ) + { + __VTPRINTENTER( "Toolbar.IsCMdIdVisibleInTogB" ) + TBool result( ETrue ); + TInt cmdId( MapCmdIdToParentId( aCmdId ) ); + TInt targetStateIndex( KErrNotFound ); + switch( aCmdId ) + { + case EVtUiCmdActivateBT: + targetStateIndex = 6; + break; + + case EVtUiCmdActivateLoudspeaker: + targetStateIndex = 4; + break; + + case EVtUiCmdSwitchFromBTToIHF: + case EVtUiCmdEnableVideo: + case EVtUiCmdEnableAudio: + case EVtUiCmdUseSecondaryCamera: + targetStateIndex = 2; + break; + + case EVtUiCmdDisableVideo: + case EVtUiCmdDisableAudio: + case EVtUiCmdUsePrimaryCamera: + case EVtUiCmdDeactivateLoudspeaker: + targetStateIndex = 0; + break; + + default: + break; + } + + if ( targetStateIndex != KErrNotFound ) + { + result = ( FindToolbarItemByCommandId( cmdId ) + ->StateIndex() == targetStateIndex ); + } + + __VTPRINTEXITR( "Toolbar.IsCMdIdVisibleInTogB.result %d", (TInt)result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::PopulateCmdsIdsL +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::PopulateCmdsIdsL() + { + __VTPRINTENTER( "Toolbar.PopulateCmdsIdsL" ) + CVtUiAppUi& appUi = iFeatureManager.AppUi(); + + // default commands + iCmdIds.AppendL( EVtUiCmdDisableVideo ); + iCmdIds.AppendL( EVtUiCmdEnableVideo ); + iCmdIds.AppendL( EVtUiCmdDisableAudio ); + iCmdIds.AppendL( EVtUiCmdEnableAudio ); + + __VTPRINTEXIT( "Toolbar.PopulateCmdsIdsL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::SetToolbarVisibilityAfterLayoutChangeL +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::SetToolbarVisibilityAfterLayoutChangeL( TBool /*aVisible*/ ) + { + __VTPRINTENTER( "Toolbar.SetToolbarVisibilityAfterLayoutChangeL" ) + __VTPRINTEXIT( "Toolbar.SetToolbarVisibilityAfterLayoutChangeL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::IsToggleButtonHidden +// ----------------------------------------------------------------------------- +// +TBool CVtUiToolbarBase::IsToggleButtonHidden(TInt aFirstCmdId, TInt aSecondCmdId ) + { + __VTPRINTENTER( "Toolbar.IsToggleButtonHidden" ) + TInt count = 0; + TBool result = EFalse; + for ( TInt i = 0; i < iCmdStates.Count(); i++ ) + { + if ( iCmdStates[ i ].iCmdId == aFirstCmdId || + iCmdStates[ i ].iCmdId == aSecondCmdId ) + { + if ( iCmdStates[ i ].iNewState == EHidden ) + { + count++; + } + } + } + + if ( count > 1 ) + { + __VTPRINT(DEBUG_GEN, "IsToggleButtonHidden.Count>1" ) + result = ETrue; + } + __VTPRINTEXITR( "Toolbar.IsToggleButtonHidden.result%d", result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::Clean +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::Clean() + { + __VTPRINTENTER( "Toolbar.Clean" ) + TRAP_IGNORE( CVtUiToolbarBase::DoDeactivateL() ); + // unregister component change registration + iFeatureManager.ComponentManager().ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::EUnregister ); + __VTPRINTEXIT( "Toolbar.Clean" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::CreateToolbarButtons +// ----------------------------------------------------------------------------- +// + +void CVtUiToolbarBase::CreateToolbarButtonsL() + { + __VTPRINTENTER( "Toolbar.CreateToolbarButtons" ) + CVtUiAppUi& appUi = iFeatureManager.AppUi(); + + // two default buttons + // toggle video + CreateToolbarItemL( R_AVKONBUTTON_TOGGLE_VIDEO_BUTTON, + EVtUiCmdToolbarToggleVideo, appUi ); + + // toggle microphone + CreateToolbarItemL( R_AVKONBUTTON_TOGGLE_MICROPHONE_BUTTON, + EVtUiCmdToolbarToggleMicrophone, appUi ); + + __VTPRINTEXIT( "Toolbar.CreateToolbarButtons" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::CreateToolbarItemL +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::CreateToolbarItemL( TInt aResourceId, TInt aCommandId, + CVtUiAppUi& appUi ) + { + __VTPRINTENTER( "Toolbar.CreateToolbarItemL" ) + + CVtUiToolbarButton* toolbarItem = NULL; + TLinearOrder< CVtUiToolbarButton > linOrder( ::ToolbarCmpFunc ); + + // create toolbaritem + toolbarItem = CVtUiToolbarButton::NewLC( aResourceId, appUi, aCommandId ); + + // add toolbar item to toolbar + // CVtUiToolbarButton ownership is transferred to akntoolbar + iToolbar->AddItemL( toolbarItem, EAknCtButton, + aCommandId , NULL ); + + // add toolbar item to array + iToolBarControls.InsertInOrderL( toolbarItem, linOrder ); + + CleanupStack::Pop(); // toolbaritem + + __VTPRINTEXIT( "Toolbar.CreateToolbarItemL" ) + } + + + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::HideToolbarButton +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::HideToolbarButton( const TInt aCommandId, const TBool aHide, + const TBool aDrawNow ) + { + __VTPRINTENTER( "Toolbar.HideToolbarButton" ) + __VTPRINT2( DEBUG_GEN, "Toolbar.HideToolbarButton.aCommandId=%d", aCommandId ) + TInt cmdId = MapCmdIdToParentId( aCommandId ); + + // unhide for toggle buttons not handled + if ( !aHide && cmdId != aCommandId ) + { + return; + } + + // Get toolbar item + CVtUiToolbarButton* tbItem = FindToolbarItemByCommandId( cmdId ); + + // get button's current state + TInt stateIndex = tbItem->StateIndex(); + + switch ( cmdId ) + { + case EVtUiCmdToolbarToggleVideo: + // if both items should be hidden in togglebutton, + // then dim togglebutton + if ( IsToggleButtonHidden( EVtUiCmdDisableVideo, + EVtUiCmdEnableVideo ) ) + { + // update visibility state + TRAP_IGNORE( + SetCmdIdVisibilityStateL( EVtUiCmdDisableVideo, EDimmed ); + SetCmdIdVisibilityStateL( EVtUiCmdEnableVideo, EDimmed ); + ); + iToolbar->SetItemDimmed( cmdId, ETrue, EFalse ); + return; + } + if ( ( stateIndex == 0 || stateIndex == 1 ) && + EVtUiCmdDisableVideo == aCommandId ) + { + tbItem->SetCurrentState ( 2, EFalse ); + } + else if( ( stateIndex == 2 || stateIndex == 3 )&& + EVtUiCmdEnableVideo == aCommandId ) + { + tbItem->SetCurrentState ( 0, EFalse ); + } + break; + + case EVtUiCmdToolbarToggleMicrophone: + // if both items should be hidden in togglebutton, + // then dim togglebutton + if ( IsToggleButtonHidden( EVtUiCmdDisableAudio, + EVtUiCmdEnableAudio ) ) + { + // update visibility state + TRAP_IGNORE( + SetCmdIdVisibilityStateL( EVtUiCmdDisableAudio, EDimmed ); + SetCmdIdVisibilityStateL( EVtUiCmdEnableAudio, EDimmed ); + ); + iToolbar->SetItemDimmed( cmdId, ETrue, EFalse ); + return; + } + if ( ( stateIndex == 0 || stateIndex == 1 ) && + EVtUiCmdDisableAudio == aCommandId ) + { + tbItem->SetCurrentState ( 2, EFalse ); + } + else if( ( stateIndex == 2 || stateIndex == 3 ) && + EVtUiCmdEnableAudio == aCommandId ) + { + tbItem->SetCurrentState ( 0, EFalse ); + } + break; + + case EVtUiCmdToolbarAudioRouting: + { + const TBool isToggleButtonHidden( + IsToggleButtonHidden( EVtUiCmdActivateBT, + EVtUiCmdSwitchFromBTToIHF ) && + IsToggleButtonHidden( EVtUiCmdActivateLoudspeaker, + EVtUiCmdDeactivateLoudspeaker ) + ); + + if ( isToggleButtonHidden ) + { + TRAP_IGNORE( + SetCmdIdVisibilityStateL( EVtUiCmdActivateBT, EDimmed ); + SetCmdIdVisibilityStateL( EVtUiCmdDeactivateLoudspeaker, + EDimmed ); + SetCmdIdVisibilityStateL( EVtUiCmdSwitchFromBTToIHF, EDimmed ); + SetCmdIdVisibilityStateL( EVtUiCmdActivateLoudspeaker, + EDimmed ); + ); + iToolbar->SetItemDimmed( cmdId, ETrue, EFalse ); + return; + } + else + { + if ( tbItem ) + { + const TVtUiAudioState& audioState( + iFeatureManager.UiStates().AudioState() ); + + TInt state( 0 ); // Deactivate loudspeaker + + if ( audioState.CanDeactivateBtHf() ) + { + state = 2; // Deactivate bthf + } + else if ( audioState.CanActivateBtHf() ) + { + state = 6; // Activate bthf + } + else if ( audioState.CanActivateLoudspeaker() ) + { + state = 4; // Activate loudspeaker + } + __VTPRINT2( DEBUG_GEN, + "Toolbar.HideToolbarButton.AudioRoutingState=%d", + state ) + tbItem->SetCurrentState ( state, EFalse ); + } + } + } + break; + + case EVtUiCmdToolbarToggleCamera: + // if both items should be hidden in togglebutton, + // then dim togglebutton + if ( IsToggleButtonHidden( EVtUiCmdUsePrimaryCamera, + EVtUiCmdUseSecondaryCamera ) ) + { + // update visibility state + TRAP_IGNORE( + SetCmdIdVisibilityStateL( EVtUiCmdUsePrimaryCamera, EDimmed ); + SetCmdIdVisibilityStateL( EVtUiCmdUseSecondaryCamera, EDimmed ); + ); + iToolbar->SetItemDimmed( cmdId, ETrue, EFalse ); + return; + } + if ( ( stateIndex == 0 || stateIndex == 1 ) && + EVtUiCmdUsePrimaryCamera == aCommandId ) + { + tbItem->SetCurrentState ( 2, EFalse ); + } + else if( ( stateIndex == 2 || stateIndex == 3 ) && + EVtUiCmdUseSecondaryCamera == aCommandId ) + { + tbItem->SetCurrentState ( 0, EFalse ); + } + break; + + default: + iToolbar->HideItem( cmdId, aHide, aDrawNow); + __VTPRINT( DEBUG_GEN, "Toolbar.HideToolbarButton" ) + break; + } + __VTPRINTEXIT( "Toolbar.HideToolbarButton" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::DimToolbar +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::DimToolbar( const TBool aDimmed, const TBool aDrawNow ) + { + __VTPRINTENTER( "Toolbar.DimToolbar" ) + __VTPRINT2( DEBUG_GEN, "Toolbar.DimToolbar.aDimmed=%d", (TInt)aDimmed ) + + TInt count = iCmdStates.Count(); + for( TInt i = 0; i < count; i++ ) + { + __VTPRINT2( DEBUG_GEN, "iCmdId = %d", iCmdStates[ i ].iCmdId ) + __VTPRINT3( DEBUG_GEN, "iCmdStates.iOldState=%d iCmdStates.iNewState=%d", + iCmdStates[ i ].iOldState, iCmdStates[ i ].iNewState ) + // dim item + if ( iCmdStates[ i ].iNewState == EShown ) + { + DimToolbarButton( iCmdStates[ i ].iCmdId, aDimmed, aDrawNow ); + } + } + __VTPRINTEXIT( "Toolbar.DimToolbar" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::DimToolbarButton +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::DimToolbarButton( const TInt aCommandId, const TBool aDimmed, + const TBool aDrawNow ) + { + __VTPRINTENTER( "Toolbar.DimToolbarButton" ) + __VTPRINT2( DEBUG_GEN, "Toolbar.DimToolbarButton.aCmdId=%d", aCommandId ) + + // command not visible, no need to update button + if ( !IsCmdIdVisibleInToggleButton( aCommandId ) ) + { + __VTPRINTEXIT("Toolbar.DimToolbarButton.NotVisible" ) + return; + } + TInt cmdId = MapCmdIdToParentId( aCommandId ); + // dim item + iToolbar->SetItemDimmed( cmdId, aDimmed, aDrawNow ); + __VTPRINTEXIT( "Toolbar.DimToolbarButton" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::FindToolbaItemByCommandId +// ----------------------------------------------------------------------------- +// +CVtUiToolbarButton* CVtUiToolbarBase::FindToolbarItemByCommandId + ( const TInt aCommandId ) + { + __VTPRINTENTER( "Toolbar.FindToolbarItemByCmdId" ) + CVtUiToolbarButton* result = NULL; + + TInt index( iToolBarControls. + FindInOrder( aCommandId,::ToolbarItemIdCmpFunc ) ); + + if ( index != KErrNotFound ) + { + result = iToolBarControls[ index ]; + } + __VTPRINTEXITR( "Toolbar.FindToolbarItemByCmdId.result %d", (TInt)result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::StartBlocking +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::BlockPointerEvents( TBool aIsBlocking ) + { + __VTPRINTENTER( "Toolbar.BlockPointerEvents" ) + for (TInt i = 0; i < iToolBarControls.Count(); ++i ) + { + iToolBarControls[ i ]->BlockPointerEvents( aIsBlocking ); + } + __VTPRINTEXITR( "Toolbar.BlockPointerEvents =%d", aIsBlocking ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::StopBlocking +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::BlockKeyEvents( TBool aIsBlocking ) + { + __VTPRINTENTER( "Toolbar.BlockKeyEvents" ) + for ( TInt i = 0; i < iToolBarControls.Count(); ++i ) + { + iToolBarControls[ i ]->BlockKeyEvents( aIsBlocking ); + } + __VTPRINTEXITR( "Toolbar.BlockKeyEvents =%d", aIsBlocking ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::IsDialerActive +// ----------------------------------------------------------------------------- +// +TBool CVtUiToolbarBase::IsDialerActive() const + { + __VTPRINTENTER( "Toolbar.IsDialerActive" ) + TBool ret( EFalse ); + MVtUiFeature* dialer = iFeatureManager. + GetFeatureById( EVtUiFeatureIdDialer ); + if ( dialer ) + { + if ( dialer->State() == MVtUiFeature::EActive ) + { + ret = ETrue; + } + } + __VTPRINTEXITR( "Toolbar.IsDialerActive =%d", ret ) + return ret; + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::NumberOfToolbarControls +// ----------------------------------------------------------------------------- +// +TInt CVtUiToolbarBase::NumberOfToolbarControls() const + { + __VTPRINTENTER( "Toolbar.NumberOfToolbarControls" ) + __VTPRINTEXIT( "Toolbar.NumberOfToolbarControls" ) + return iCmdIds.Count(); + } + + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::CommandIdByCmdIdsArrayIndex +// ----------------------------------------------------------------------------- +// + TInt CVtUiToolbarBase::CommandIdByCmdIdsArrayIndex( TInt aIndex ) const + { + __VTPRINTENTER( "Toolbar.CommandIdByCmdIdsArrayIndex" ) + __VTPRINTEXIT( "Toolbar.CommandIdByCmdIdsArrayIndex.cmdId" ) + return iCmdIds[aIndex]; + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::UpdateToolbar +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::UpdateToolbarL() + { + __VTPRINTENTER( "Toolbar.UpdateToolbar" ) + TVtUiStates& uiStates = iFeatureManager.UiStates(); + + // Zoom mode can be activated also from options menu + // therefore set zoom buttons state to latched + if ( uiStates.IsZoomModeOn() && + IsCommandInToolbar( EVtUiCmdZoom )&& + FindToolbarItemByCommandId( EVtUiCmdZoom ) + ->StateIndex() == 0 ) + { + FindToolbarItemByCommandId( EVtUiCmdZoom ) + ->SetCurrentState ( 1, ETrue ); + } + + + if ( uiStates.IsCaptureModeOn() && IsCommandInToolbar( EVtUiCmdZoom ) ) + { + __VTPRINT( DEBUG_GEN, "Toolbar.UpdateToolbarL.IsCaptureModeOn" ) + // remove zoom mode button tooltip + FindToolbarItemByCommandId( EVtUiCmdZoom ) + ->State( 0 )->SetHelpTextL( KNullDesC() ); + // set zoom mode button to be focused + iToolbar->SetFocusedItemL( EVtUiCmdZoom ); + } + + TInt count = iCmdStates.Count(); + for( TInt i = 0; i < count; i++ ) + { + // no need to do anything + if ( iCmdStates[ i ].iOldState == iCmdStates[ i ].iNewState ) + { + if ( ( iCmdStates[ i ].iCmdId == EVtUiCmdDisableVideo || + iCmdStates[ i ].iCmdId == EVtUiCmdEnableVideo ) && + iCmdStates[ i ].iNewState != EShown && + !( iFeatureManager.UiStates().MediaState().IsSharing() ) ) + { + CVtUiToolbarButton* tbButton = static_cast< CVtUiToolbarButton* >( + FindToolbarItemByCommandId( EVtUiCmdToolbarToggleVideo ) ); + tbButton->SetCurrentState( + iFeatureManager.UiStates().MediaState().IsVideo() ? 0 : 2 , ETrue ); + } + // for the case that EVtUiCmdDisableVideo and + // EVtUiCmdActivateBT command + // need to be shown but it is not visible in + // toogle button. + if ( ( iCmdStates[ i ].iCmdId == EVtUiCmdSwitchFromBTToIHF || + iCmdStates[ i ].iCmdId == EVtUiCmdActivateBT || + iCmdStates[ i ].iCmdId == EVtUiCmdActivateLoudspeaker || + iCmdStates[ i ].iCmdId == EVtUiCmdDeactivateLoudspeaker || + iCmdStates[ i ].iCmdId == EVtUiCmdDisableAudio || + iCmdStates[ i ].iCmdId == EVtUiCmdEnableAudio || + iCmdStates[ i ].iCmdId == EVtUiCmdDisableVideo || + iCmdStates[ i ].iCmdId == EVtUiCmdEnableVideo) && + iCmdStates[ i ].iNewState == EShown ) + { + // Nothing goes here. + } + else + { + continue; + } + } + // dim item + if ( iCmdStates[ i ].iNewState == EDimmed ) + { + DimToolbarButton( iCmdStates[ i ].iCmdId, ETrue, EFalse ); + } + // hide item + // currently used only for toggle buttons + // otherwise EDrawNow parameter must be updated for last element + else if ( iCmdStates[ i ].iNewState == EHidden ) + { + HideToolbarButton( iCmdStates[ i ].iCmdId, ETrue, EFalse ); + } + // show item + else if ( iCmdStates[ i ].iNewState == EShown ) + { + // items are undimmed if they were dimmed + // iCmdStates[ i ].iOldState == EDimmed comparison does + // not work with toggle buttons. + // That is why all buttons are undimmed. + DimToolbarButton( iCmdStates[ i ].iCmdId, EFalse, EFalse ); + + HideToolbarButton( iCmdStates[ i ].iCmdId, EFalse, EFalse ); + } + } + + // capture mode ended remove zoom button's latched state + if ( !uiStates.IsZoomModeOn() && + IsCommandInToolbar( EVtUiCmdZoom )&& + FindToolbarItemByCommandId( EVtUiCmdZoom )->StateIndex() == 1 ) + { + FindToolbarItemByCommandId( EVtUiCmdZoom ) + ->SetCurrentState ( 0, ETrue ); + } + + // if capture mode was activated set zoom mode button active + if ( uiStates.IsCaptureModeOn() && IsCommandInToolbar( EVtUiCmdZoom ) ) + { + // set latched (selected) state + FindToolbarItemByCommandId( EVtUiCmdZoom ) + ->SetCurrentState ( 1, ETrue); + } + else + { + // tooltip must be returned to zoom mode button + // only after zoom mode buttons latched state is changed + // because changing the buttons state will draw the tooltip + if ( IsCommandInToolbar( EVtUiCmdZoom ) && + ( KNullDesC() == ( FindToolbarItemByCommandId( EVtUiCmdZoom ) + ->State(0)->HelpText() ) ) ) + { + HBufC* tooltip = StringLoader::LoadLC( R_VIDEOTELUI_TOOLTIP_ZOOM ); + FindToolbarItemByCommandId( EVtUiCmdZoom ) + ->State(0)->SetHelpTextL( *tooltip ); + CleanupStack::PopAndDestroy( ); // tooltip + } + } + + // draw toolbar + //iToolbar->DrawDeferred(); + iToolbar->DrawNow(); + __VTPRINTEXIT( "Toolbar.UpdateToolbar" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::SetCmdIdVisibilityStateL +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::SetCmdIdVisibilityStateL( TInt aCmdId, + TCmdStateFlags aNewState ) + { + __VTPRINTENTER( "Toolbar.SetCmdIdVisibilityStateL" ) + __VTPRINT2( DEBUG_GEN, "Toolbar.SetCmdIdVbStateL.aCmdId=%d", aCmdId ) + __VTPRINT2( DEBUG_GEN, "Toolbar.SetCmdIdVbStateL.aNewState=%d", aNewState ) + + TInt result = KErrNotFound; + for ( TInt i = 0; i < iCmdStates.Count(); i++ ) + { + if ( iCmdStates[ i ].iCmdId == aCmdId ) + { + // command found + result = i; + break; + } + } + // new item + // add to array + if( result == KErrNotFound ) + { + TCommandState state; + state.iCmdId = aCmdId; + state.iOldState = ENotInitialized; + state.iNewState = aNewState; + iCmdStates.AppendL( state ); + } + else // old item + { + iCmdStates[ result ].iOldState = iCmdStates[ result ].iNewState; + iCmdStates[ result ].iNewState = aNewState; + } + + __VTPRINTEXIT( "Toolbar.SetCmdIdVbStateL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::IsCommandInToolbar +// ----------------------------------------------------------------------------- +// +TBool CVtUiToolbarBase::IsCommandInToolbar( TInt aCmdId ) const + { + __VTPRINTENTER( "Toolbar.SetCmdIdVisibilityStateL" ) + TBool result = EFalse; + for ( TInt i = 0; i < iCmdIds.Count(); i++ ) + { + if ( iCmdIds[ i ] == aCmdId ) + { + result = ETrue; + break; + } + } + __VTPRINTEXITR( "Toolbar.IsCommandInToolbar.result %d", (TInt)result ) + return result; + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::RefreshL +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::RefreshL() + { + __VTPRINTENTER( "Toolbar.RefreshL" ) + iFeatureManager.CommandManager(). + ValidateToolbarItemsL( *iHideToolbarItemAction ); + __VTPRINTEXIT( "Toolbar.RefreshL" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::AddCommandModifier +// ----------------------------------------------------------------------------- +// +TInt CVtUiToolbarBase::AddCommandModifier( CVtUiCommandModifyBase& /*aModifier*/ ) + { + __VTPRINTENTER( "Toolbar.AddCommandModifier" ) + __VTPRINTEXIT( "Toolbar.AddCommandModifier" ) + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::RemoveCommandModifier +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::RemoveCommandModifier( CVtUiCommandModifyBase& /*aModifier*/ ) + { + __VTPRINTENTER( "Toolbar.RemoveCommandModifier" ) + __VTPRINTEXIT( "Toolbar.RemoveCommandModifier" ) + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::ComponentId +// ----------------------------------------------------------------------------- +// +MVtUiComponent::TComponentId CVtUiToolbarBase::ComponentId() const + { + __VTPRINTENTER( "Toolbar.ComponentId" ) + __VTPRINTEXIT( "Toolbar.ComponentId" ) + return MVtUiComponent::EComponentIdToolbar; + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::ComponentAsControl +// ----------------------------------------------------------------------------- +// +CCoeControl* CVtUiToolbarBase::ComponentAsControl() + { + __VTPRINTENTER( "Toolbar.ComponentAsControl" ) + __VTPRINTEXIT( "Toolbar.ComponentAsControl" ) + return NULL; + } + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::DoActivateL +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::DoActivateL() + { + __VTPRINTENTER( "Toolbar.DoActivateL" ) + // add command ui to commandmanager + User::LeaveIfError( + iFeatureManager.CommandManager().AddCommandUi( *this ) ); + // add command modifier + User::LeaveIfError( iFeatureManager. + CommandManager().AddCommandModifier( *iToolbarSKModifier ) ); + // add validator + User::LeaveIfError( iFeatureManager.CommandManager(). + AddValidator( *iToolbarCmdPolicy ) ); + // refresh + iFeatureManager.CommandManager().RefreshL(); + __VTPRINTEXIT( "Toolbar.DoActivateL" ) + } + + +// ----------------------------------------------------------------------------- +// CVtUiToolbarBase::DoDeactivateL +// ----------------------------------------------------------------------------- +// +void CVtUiToolbarBase::DoDeactivateL() + { + __VTPRINTENTER( "Toolbar.DoDeactivateL" ) + // remove command modifier + iFeatureManager.CommandManager(). + RemoveCommandModifier( *iToolbarSKModifier ); + // remove command validator + iFeatureManager.CommandManager().RemoveValidator( *iToolbarCmdPolicy ); + // remove commandui + iFeatureManager.CommandManager().RemoveCommandUi( *this ); + if ( iToolbar ) + { + __VTPRINT(DEBUG_GEN, "Toolbar.DoDeactivateL, iToolbar is not null" ) + iToolbar->DrawNow(); + } + __VTPRINTEXIT( "Toolbar.DoDeactivateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarBase::HandleLayoutChangeL +// --------------------------------------------------------------------------- +// +void CVtUiToolbarBase::HandleLayoutChangeL() + { + __VTPRINTENTER( "CVtUiToolbarBase.HandleLayoutChangeL" ) + TBool isLandscape = Layout_Meta_Data::IsLandscapeOrientation(); + CEikMenuBar* menuBar = CEikonEnv::Static()->AppUiFactory()->MenuBar(); + + // This check prevents toolbar from drawing over the dialer + // when orientation is changed from landscape to portrait + + // Transition from landsacpe to portrait + // toolbar must be hided + if ( !isLandscape && IsDialerActive() ) + { + __VTPRINT( DEBUG_GEN, "ToolbarBase::HandleLayoutChangeL DialerActive." ) + SetToolbarVisibilityAfterLayoutChangeL( EFalse ); + } + else if ( !isLandscape && iFeatureManager.UiStates().IsCaptureModeOn() ) + { + __VTPRINT( DEBUG_GEN, "ToolbarBase::HandleLayoutChangeL CaptureOn." ) + SetToolbarVisibilityAfterLayoutChangeL( EFalse ); + } + else if ( iFeatureManager.UiStates().IsSelectingShare() ) + { + __VTPRINT( DEBUG_GEN, "ToolbarBase::HandleLayoutChangeL ShareImage." ) + SetToolbarVisibilityAfterLayoutChangeL( EFalse ); + } + else if ( !isLandscape && iFeatureManager.UiStates().IsVideoQualityModeOn() ) + { + __VTPRINT( DEBUG_GEN, "ToolbarBase::HandleLayoutChangeL Video Quality." ) + SetToolbarVisibilityAfterLayoutChangeL( EFalse ); + } + else if ( !isLandscape && iFeatureManager.UiStates().IsWhiteBalanceModeOn() ) + { + __VTPRINT( DEBUG_GEN, "ToolbarBase::HandleLayoutChangeL White Balance." ) + SetToolbarVisibilityAfterLayoutChangeL( EFalse ); + } + else if ( !isLandscape && iFeatureManager.UiStates().IsColorToneModeOn() ) + { + __VTPRINT( DEBUG_GEN, "ToolbarBase::HandleLayoutChangeL Color Tone." ) + SetToolbarVisibilityAfterLayoutChangeL( EFalse ); + } + else if ( !isLandscape && iFeatureManager.UiStates().IsVolumeModeOn() ) + { + SetToolbarVisibilityAfterLayoutChangeL( EFalse ); + } + else if ( !isLandscape && menuBar && menuBar->IsDisplayed() ) + { + __VTPRINT( DEBUG_GEN, "ToolbarBase::HandleLayoutChangeL Menu Displayed." ) + SetToolbarVisibilityAfterLayoutChangeL( EFalse ); + } + // Transition from portrait to landsacpe + // toolbar must be set to visible + else if ( isLandscape && ( + IsDialerActive() || + iFeatureManager.UiStates().IsCaptureModeOn() || + iFeatureManager.UiStates().IsVideoQualityModeOn() || + iFeatureManager.UiStates().IsWhiteBalanceModeOn() || + iFeatureManager.UiStates().IsColorToneModeOn() || + iFeatureManager.UiStates().IsVolumeModeOn() || + menuBar && menuBar->IsDisplayed() ) ) + { + __VTPRINT(DEBUG_GEN, "CVtUiToolbarBase.LayoutChangeL.StartL" ) + SetToolbarVisibilityAfterLayoutChangeL( ETrue ); + } + __VTPRINTEXIT( "CVtUiToolbarBase.HandleLayoutChangeL" ) + } + +// End of File + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/toolbar/cvtuitoolbarbutton.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/toolbar/cvtuitoolbarbutton.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,191 @@ +/* +* Copyright (c) 2006 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: CVtUiToolbarButton implementation. +* +*/ + + +// INCLUDE FILES +#include +#include "cvtuitoolbarbutton.h" +#include "CVtUiAppUi.h" +#include "videotelui.hrh" + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::NewL +// ----------------------------------------------------------------------------- +// +CVtUiToolbarButton* CVtUiToolbarButton::NewL( TInt aResourceId, + CVtUiAppUi& aAppUi, TInt aCmdId ) + { + __VTPRINTENTER( "CVtUiToolbarButton.NewL" ) + CVtUiToolbarButton* self = CVtUiToolbarButton::NewLC( aResourceId, aAppUi, + aCmdId ); + CleanupStack::Pop( self ); + __VTPRINTEXIT( "CVtUiToolbarButton.NewL" ) + return self; + } + +// ----------------------------------------------------------------------------- +// CVtUiNaviPane::NewLC +// ----------------------------------------------------------------------------- +// +CVtUiToolbarButton* CVtUiToolbarButton::NewLC( TInt aResourceId, + CVtUiAppUi& aAppUi, TInt aCmdId ) + { + __VTPRINTENTER( "CVtUiToolbarButton.NewLC" ) + CVtUiToolbarButton* self = new ( ELeave ) CVtUiToolbarButton( aAppUi, + aCmdId ); + CleanupStack::PushL( self ); + self->ConstructL(); + self->ConstructFromResourceL( aResourceId ); + __VTPRINTEXIT( "CVtUiToolbarButton.NewLC" ) + return self; + } + +// ---------------------------------------------------------------------------- +// CVtUiToolbarButton::~CVtUiToolbarButton +// ---------------------------------------------------------------------------- +// +CVtUiToolbarButton::~CVtUiToolbarButton() + { + __VTPRINTENTER( "CVtUiToolbarButton.~" ) + __VTPRINTEXIT( "CVtUiToolbarButton.~" ) + } + +// ---------------------------------------------------------------------------- +// CVtUiToolbarButton::CVtUiToolbarButton +// ---------------------------------------------------------------------------- +// +CVtUiToolbarButton::CVtUiToolbarButton( CVtUiAppUi& aAppUi, TInt aCmdId ) +: CAknButton( 0 ), iAppUi( aAppUi ), iCmdId ( aCmdId ), + iIsBlockingKeyEvents ( EFalse ), iIsBlockingPointerEvents( EFalse ) + { + __VTPRINTENTER( "CVtUiToolbarButton.CVtUiToolbarButton" ) + __VTPRINTEXIT( "CVtUiToolbarButton.CVtUiToolbarButton") + } + +// ---------------------------------------------------------------------------- +// CVtUiToolbarButton::ShowHelpL +// ---------------------------------------------------------------------------- +// +void CVtUiToolbarButton::ShowHelpL() + { + __VTPRINTENTER( "CVtUiToolbarButton.ShowHelpL" ) + CAknButton::ShowHelpL(); + __VTPRINTEXIT( "CVtUiToolbarButton.ShowHelpL") + } + +// ---------------------------------------------------------------------------- +// CVtUiToolbarButton::CmdId +// ---------------------------------------------------------------------------- +// +TInt CVtUiToolbarButton::CmdId() const + { + __VTPRINTENTER( "CVtUiToolbarButton.CmdId" ) + __VTPRINTEXIT( "CVtUiToolbarButton.CmdId") + return iCmdId; + } + +// ---------------------------------------------------------------------------- +// CVtUiToolbarButton::BlockPointerEvents +// ---------------------------------------------------------------------------- +// +void CVtUiToolbarButton::BlockPointerEvents( TBool aIsBlocking ) + { + __VTPRINTENTER( "CVtUiToolbarButton.BlockPointerEvents" ) + iIsBlockingPointerEvents = aIsBlocking; + __VTPRINTEXITR( "CVtUiToolbarButton.BlockPointerEvents=%d", aIsBlocking ) + } + +// ---------------------------------------------------------------------------- +// CVtUiToolbarButton::BlockKeyEvents +// ---------------------------------------------------------------------------- +// +void CVtUiToolbarButton::BlockKeyEvents( TBool aIsBlocking ) + { + __VTPRINTENTER( "CVtUiToolbarButton.BlockKeyEvents" ) + iIsBlockingKeyEvents = aIsBlocking; + __VTPRINTEXITR( "CVtUiToolbarButton.BlockKeyEvents=%d", aIsBlocking ) + } + +// ---------------------------------------------------------------------------- +// CVtUiToolbarButton::OfferKeyEventL +// ---------------------------------------------------------------------------- +// +TKeyResponse CVtUiToolbarButton::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + __VTPRINTENTER( "CVtUiToolbarButton.OfferKeyEventL" ) + if ( IsCommandActive() && iIsBlockingKeyEvents ) + { + __VTPRINTEXIT( "CVtUiToolbarButton.OfferKeyEventL.Blocked" ) + return EKeyWasConsumed; + } + __VTPRINTEXIT( "CVtUiToolbarButton.OfferKeyEventL" ) + return CAknButton::OfferKeyEventL( aKeyEvent, aType); + } + +// ---------------------------------------------------------------------------- +// CVtUiToolbarButton::HandlePointerEventL +// ---------------------------------------------------------------------------- +// +void CVtUiToolbarButton::HandlePointerEventL( const + TPointerEvent& aPointerEvent ) + { + __VTPRINTENTER( "CVtUiToolbarButton.HandlePointerEventL" ) + if ( IsCommandActive() && iIsBlockingPointerEvents ) + { + __VTPRINTEXIT( "CVtUiToolbarButton.HandlePointerEventL.Blocked" ) + return; + } + __VTPRINTEXIT( "CVtUiToolbarButton.HandlePointerEventL.To.AknButton" ) + return CAknButton::HandlePointerEventL( aPointerEvent ); + } + +// ---------------------------------------------------------------------------- +// CVtUiToolbarButton::StatesCount +// ---------------------------------------------------------------------------- +// +TInt CVtUiToolbarButton::StatesCount() const + { + return iStates->Count(); + } + +// ---------------------------------------------------------------------------- +// CVtUiToolbarButton::IsCommandActive +// ---------------------------------------------------------------------------- +// +TBool CVtUiToolbarButton::IsCommandActive() const + { + __VTPRINTENTER( "CVtUiToolbarButton.IsCommandActive" ) + TBool value( EFalse ); + value = ( iAppUi.IsActiveCommand( EVtUiCmdDisableVideo ) || + iAppUi.IsActiveCommand( EVtUiCmdEnableVideo ) || + iAppUi.IsActiveCommand( EVtUiCmdEnableAudio ) || + iAppUi.IsActiveCommand( EVtUiCmdDisableAudio ) || + iAppUi.IsActiveCommand( EVtUiCmdUsePrimaryCamera ) || + iAppUi.IsActiveCommand( EVtUiCmdUseSecondaryCamera ) || + // Audio routing to blocking + iAppUi.IsActiveCommand( EVtUiCmdActivateBT ) || + iAppUi.IsActiveCommand( EVtUiCmdSwitchFromBTToIHF ) || + iAppUi.IsActiveCommand( EVtUiCmdActivateLoudspeaker ) || + iAppUi.IsActiveCommand( EVtUiCmdDeactivateLoudspeaker ) + ); + + __VTPRINTEXITR( "CVtUiToolbarButton.IsCommandActive=%d", value ) + return value; + } +// End of File + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/toolbar/cvtuitoolbarcmdpolicy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/toolbar/cvtuitoolbarcmdpolicy.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2006 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: Toolbar command policy implementation. +* +*/ + + +#include + +#include "cvtuitoolbarcmdpolicy.h" +#include "cvtuicmdvalidationactionbase.h" +#include "tvtuicmdvalidatorcallback.h" +#include "cvtuitoolbarbase.h" +#include "videotelui.hrh" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiToolbarCmdPolicy::NewL +// --------------------------------------------------------------------------- +// +CVtUiToolbarCmdPolicy* CVtUiToolbarCmdPolicy::NewL( CVtUiToolbarBase& aToolbar ) + { + __VTPRINTENTER( "ToolbarCmdPolicy.NewL" ) + CVtUiToolbarCmdPolicy* self = new ( ELeave ) CVtUiToolbarCmdPolicy( + aToolbar ); + __VTPRINTEXIT( "ToolbarCmdPolicy.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarCmdPolicy::ValidateMenuItemsL +// --------------------------------------------------------------------------- +// +void CVtUiToolbarCmdPolicy::ValidateMenuItemsL( + CVtUiCmdValidationActionBase& aAction, TInt /*aReferencePriority*/ ) + { + __VTPRINTENTER( "ToolbarCmdPolicy.ValidateMenuItemsL" ) + aAction.ProcessL( + TVtUiCmdValidatorCallBack< CVtUiToolbarCmdPolicy >( *this, + ValidateMenuCommand ) ); + __VTPRINTEXIT( "ToolbarCmdPolicy.ValidateMenuItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarCmdPolicy::ValidateSoftkeyItemsL +// --------------------------------------------------------------------------- +// +void CVtUiToolbarCmdPolicy::ValidateSoftkeyItemsL( + CVtUiCmdValidationActionBase& /*aAction*/, TInt /*aReferencePriority*/ ) + { + __VTPRINTENTER( "ToolbarCmdPolicy.ValidateSoftkeyItemsL" ) + __VTPRINTEXIT( "ToolbarCmdPolicy.ValidateSoftkeyItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarCmdPolicy::ValidateToolbarItemsL +// --------------------------------------------------------------------------- +// +void CVtUiToolbarCmdPolicy::ValidateToolbarItemsL( + CVtUiCmdValidationActionBase& /*aAction*/, TInt /*aReferencePriority*/ ) + { + __VTPRINTENTER( "ToolbarCmdPolicy.ValidateToolbarItemsL" ) + __VTPRINTEXIT( "ToolbarCmdPolicy.ValidateToolbarItemsL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarCmdPolicy::CustomValidationL +// --------------------------------------------------------------------------- +// +void CVtUiToolbarCmdPolicy::CustomValidationL( + CVtUiCmdCustomValidationActionBase&, TInt ) + { + __VTPRINTENTER( "ToolbarCmdPolicy.CustomValidationL" ) + __VTPRINTEXIT( "ToolbarCmdPolicy.CustomValidationL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarCmdPolicy::ValidatesContext +// --------------------------------------------------------------------------- +// +TBool CVtUiToolbarCmdPolicy::ValidatesContext( + const TVtUiCmdContextType& aCtxType ) const + { + __VTPRINTENTER( "ToolbarCmdPolicy.ValidatesContext" ) + + TBool result( EFalse ); + + switch ( aCtxType ) + { + case EVtUiCmdContextTypeMenu: + case EVtUiCmdContextTypeSoftkey: + case EVtUiCmdContextTypeToolbar: + result = ETrue; + break; + + default: + break; + } + + __VTPRINTEXITR( "ToolbarCmdPolicy.ValidatesContext %d", result ) + + return result; + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarCmdPolicy::CVtUiToolbarCmdPolicy +// --------------------------------------------------------------------------- +// +CVtUiToolbarCmdPolicy::CVtUiToolbarCmdPolicy( CVtUiToolbarBase& aToolbar ) + : CVtUiCmdValidatorBase( EVtUiCmdPolicyPriorityToolbar ), + iToolbar( aToolbar ) + { + __VTPRINTENTER( "ToolbarCmdPolicy.ctor" ) + __VTPRINTEXIT( "ToolbarCmdPolicy.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarCmdPolicy::ValidateMenuCommand +// --------------------------------------------------------------------------- +// +TBool CVtUiToolbarCmdPolicy::ValidateMenuCommand( TInt /*aCommandId*/ ) const + { + __VTPRINTENTER( "ToolbarCmdPolicy.ValidateMenuCommand" ) + // all commands are also in options menu + __VTPRINTEXIT( "ToolbarCmdPolicy.ValidateMenuCommand") + return EFalse; + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/toolbar/cvtuitoolbarcontext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/toolbar/cvtuitoolbarcontext.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2006 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: Toolbar context implementation. +* +*/ + + +#include + +#include "cvtuitoolbarcontext.h" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiToolbarContext::~CVtUiToolbarContext +// --------------------------------------------------------------------------- +// +CVtUiToolbarContext::~CVtUiToolbarContext() + { + __VTPRINTENTER( "ToolbarCtx.~" ) + UnregisterCommandContext(); + __VTPRINTEXIT( "ToolbarCtx.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarContext::NewL +// --------------------------------------------------------------------------- +// +CVtUiToolbarContext* CVtUiToolbarContext::NewL( + MVtUiCommandManager& aCommandManager ) + { + __VTPRINTENTER( "ToolbarCtx.NewL" ) + CVtUiToolbarContext* self = + new ( ELeave ) CVtUiToolbarContext( aCommandManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "ToolbarCtx.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarContext::ValidateL +// --------------------------------------------------------------------------- +// +void CVtUiToolbarContext::ValidateL( CVtUiCmdValidationActionBase& aAction ) + { + __VTPRINTENTER( "ToolbarCtx.ValidateL" ) + ValidateToolbarItemsL( aAction ); + __VTPRINTEXIT( "ToolbarCtx.ValidateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarContext::CVtUiToolbarContext +// --------------------------------------------------------------------------- +// +CVtUiToolbarContext::CVtUiToolbarContext( + MVtUiCommandManager& aCommandManager ) + : CVtUiCmdContext( aCommandManager, EVtUiCmdContextTypeToolbar, + KVtUiToolbarContextPriority ) + { + __VTPRINTENTER( "ToolbarCtx.ctor" ) + __VTPRINTEXIT( "ToolbarCtx.ctor" ) + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarContext::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiToolbarContext::ConstructL() + { + __VTPRINTENTER( "ToolbarCtx.ConstructL" ) + RegisterCommandContextL(); + __VTPRINTEXIT( "ToolbarCtx.ConstructL" ) + } + +// End of File + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/toolbar/cvtuitoolbarskmodifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/toolbar/cvtuitoolbarskmodifier.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2006 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: Softkey modifier class implementation. +* +*/ + + +#include +#include "cvtuitoolbarskmodifier.h" +#include "mvtuicommandsetting.h" +#include "tvtuicommandmodifierpriority.h" +#include "CVtUiAppUi.h" +#include "tvtuistates.h" +#include +#include + + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CVtUiToolbarSKModifier::NewL +// --------------------------------------------------------------------------- +// +CVtUiToolbarSKModifier* CVtUiToolbarSKModifier::NewL( CVtUiAppUi& aAppUi, + const TVtUiStates& aUiStates ) + { + __VTPRINTENTER( "CVtUiToolbarSKModifier.NewL" ) + CVtUiToolbarSKModifier* self = + new ( ELeave ) CVtUiToolbarSKModifier( aAppUi, aUiStates ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + __VTPRINTEXIT( "CVtUiToolbarSKModifier.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarSKModifier::~CVtUiToolbarSKModifier +// --------------------------------------------------------------------------- +// +CVtUiToolbarSKModifier::~CVtUiToolbarSKModifier() + { + __VTPRINTENTER( "CVtUiToolbarSKModifier.~" ) + __VTPRINTEXIT( "CVtUiToolbarSKModifier.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarSKModifier::CVtUiToolbarSKModifier +// --------------------------------------------------------------------------- +// +CVtUiToolbarSKModifier::CVtUiToolbarSKModifier( CVtUiAppUi& aAppUi, + const TVtUiStates& aUiStates ) : + CVtUiCommandModifyBase ( EVtUiCmdModifierPriorityToolbar ), + iAppUi ( aAppUi ), iUiStates ( aUiStates ) + { + __VTPRINTENTER( "CVtUiToolbarSKModifier.Ctr" ) + __VTPRINTEXIT( "CVtUiToolbarSKModifier.Ctr" ) + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarSKModifier::CVtUiToolbarSKModifier +// --------------------------------------------------------------------------- +// +void CVtUiToolbarSKModifier::ConstructL() + { + __VTPRINTENTER( "CVtUiToolbarSKModifier.ConstructL" ) + __VTPRINTEXIT( "CVtUiToolbarSKModifier.ConstructL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiToolbarSKModifier::CVtUiToolbarSKModifier +// --------------------------------------------------------------------------- +// +void CVtUiToolbarSKModifier::ModifyCommandsL( + MVtUiCommandSetting& aCommandSettings ) + { + __VTPRINTENTER( "CVtUiToolbarSKModifier.ModifyCommandsL" ) + aCommandSettings.DoDefineCommandsL(); + + // No need to change MSK during snapshot + if ( iUiStates.IsCaptureModeOn() ) + { + return; + } + + CEikButtonGroupContainer* cba = iAppUi.GetCba(); + const TInt mskIndex = 3; + // Set selection key to msk + cba->SetCommandL( mskIndex, R_VIDEOTELUI_SELECT_CBA_BUTTON ); + __VTPRINTEXIT( "CVtUiToolbarSKModifier.ModifyCommandsL" ) + } +// --------------------------------------------------------------------------- +// CVtUiToolbarSKModifier::CVtUiToolbarSKModifier +// --------------------------------------------------------------------------- +// +TBool CVtUiToolbarSKModifier::Supports( MVtUiCommandSetting::Type aType ) const + { + __VTPRINTENTER( "CVtUiToolbarSKModifier.Supports" ) + __VTPRINTEXIT( "CVtUiToolbarSKModifier.Supports" ) + return ( aType == MVtUiCommandSetting::ECommandTypeSoftkeys ); + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/toolbar/tvtuitoolbarcommanditerator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/toolbar/tvtuitoolbarcommanditerator.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,53 @@ +/* +* 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: Toolbar command iterator implementation. +* +*/ + + +#include "cvtuitoolbarbase.h" +#include "tvtuitoolbarcommanditerator.h" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// TVtUiToolbarCommandIterator::TVtUiToolbarCommandIterator +// --------------------------------------------------------------------------- +// +TVtUiToolbarCommandIterator::TVtUiToolbarCommandIterator( CVtUiToolbarBase& + aToolbar ) : iToolbar( &aToolbar ), iCurrent( 0 ) + { + } + +// --------------------------------------------------------------------------- +// TVtUiToolbarCommandIterator::HasNext +// --------------------------------------------------------------------------- +// +TBool TVtUiToolbarCommandIterator::HasNext() const + { + return ( iCurrent < iToolbar->NumberOfToolbarControls() ); + } + +// --------------------------------------------------------------------------- +// TVtUiToolbarCommandIterator::Next +// --------------------------------------------------------------------------- +// +TInt TVtUiToolbarCommandIterator::Next() + { + return iToolbar->CommandIdByCmdIdsArrayIndex( iCurrent++ ); + } + +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/volume/cvtuivolume.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/volume/cvtuivolume.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 2006 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: Volume feature implementation. +* +*/ + + +#include +#include "cvtuivolume.h" +#include "tvtuifeatureids.h" +#include "cvtuivolumepopup.h" +#include "cvtuifeaturemanager.h" +#include "tvtuifeatureids.h" +#include "tvtuistates.h" + +// --------------------------------------------------------------------------- +// CVtUiVolume::NewL +// --------------------------------------------------------------------------- +// +CVtUiVolume* CVtUiVolume::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "CVtUiVolume.NewL" ) + CVtUiVolume* self = + new ( ELeave ) CVtUiVolume( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + __VTPRINTEXIT( "CVtUiVolume.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiVolume::~CVtUiVolume +// --------------------------------------------------------------------------- +// +CVtUiVolume::~CVtUiVolume() + { + __VTPRINTENTER( "CVtUiVolume.~" ) + __VTPRINTEXIT( "CVtUiVolume.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVolume::RefreshL +// --------------------------------------------------------------------------- +// +void CVtUiVolume::RefreshL() + { + __VTPRINTENTER( "CVtUiVolume.RefreshL" ) + if ( State() == EActive ) + { + __VTPRINT( DEBUG_GEN, "CVtUiPopupBase.RefreshL.EActive" ) + static_cast< CVtUiVolumePopup& >( Popup() ).RefreshL(); + } + else + { + __VTPRINT( DEBUG_GEN, "CVtUiVolume.RefreshL.Else" ) + static_cast< CVtUiVolumePopup& >( Popup() ).UpdateVolumeAndRoutingL(); + } + __VTPRINTEXIT( "CVtUiVolume.RefreshL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVolume::StartL +// --------------------------------------------------------------------------- +// +void CVtUiVolume::StartL() + { + __VTPRINTENTER( "CVtUiVolume.StartL" ) + // if brightness or contrast slider is active stop those + MVtUiFeature* br = iFeatureManager. + GetFeatureById( EVtUiFeatureIdBrightness ); + if ( br && br->State() == EActive ) + { + __VTPRINT( DEBUG_GEN, "CVtUiPopupBase.StartL.br->Stop" ) + br->Stop(); + } + + MVtUiFeature* cr = iFeatureManager. + GetFeatureById( EVtUiFeatureIdContrast ); + if ( cr && cr->State() == EActive ) + { + __VTPRINT( DEBUG_GEN, "CVtUiPopupBase.StartL.cr->Stop" ) + cr->Stop(); + } + + if ( State() == EActive ) + { + // need to refresh when already active to replenish the close timer + RefreshL(); + } + else + { + iFeatureManager.UiStates().SetIsFloatingToolbarVisible( ETrue ); + CVtUiSliderBase::StartL(); + iFeatureManager.UiStates().SetVolumeModeOn( ETrue ); + // Toolbar needs to be refreshed if contrat and brightness were dismissed + + } + __VTPRINTEXIT( "CVtUiVolume.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVolume::Stop +// --------------------------------------------------------------------------- +// +void CVtUiVolume::Stop() + { + __VTPRINTENTER( "CVtUiVolume.Stop" ) + iFeatureManager.UiStates().SetVolumeModeOn( EFalse ); + CVtUiSliderBase::Stop(); + __VTPRINTEXIT( "CVtUiVolume.Stop" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVolume::GetVolumeValue +// --------------------------------------------------------------------------- +// +TInt CVtUiVolume::GetVolumeValue() + { + __VTPRINTENTER( "CVtUiVolume.GetVolumeValue" ) + __VTPRINTEXITR( "CVtUiVolume.GetVolumeValue%d", Popup().Value() ) + return Popup().Value(); + } + +// --------------------------------------------------------------------------- +// CVtUiVolume::CVtUiVolume +// --------------------------------------------------------------------------- +// +CVtUiVolume::CVtUiVolume( CVtUiFeatureManager& aFeatureManager ) + : CVtUiSliderBase( aFeatureManager, EVtUiFeatureIdVolume ) + { + + __VTPRINTENTER( "CVtUiVolume.CVtUiVolume" ) + __VTPRINTEXIT( "CVtUiVolume.CVtUiVolume" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVolume::CVtUiVolume +// --------------------------------------------------------------------------- +// +void CVtUiVolume:: ConstructL() + { + __VTPRINTENTER( "CVtUiVolume.ConstructL" ) + BaseConstructL(); + SetPopup( CVtUiVolumePopup::NewL( iFeatureManager ) ); + __VTPRINTEXIT( "CVtUiVolume.ConstructL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/volume/cvtuivolumecontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/volume/cvtuivolumecontrol.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,157 @@ +/* +* Copyright (c) 2008 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: Implementation of the cvtuivolumecontrol class. +* +*/ + + +#include "cvtuivolumecontrol.h" +#include "MVtUiEngineCommandManager.h" +#include +#include +#include "cvtuivolume.h" +#include "cvtuifeaturemanager.h" + +// ----------------------------------------------------------------------------- +// CVtUiVolumeControl::CVtUiVolumeControl +// ----------------------------------------------------------------------------- +// +CVtUiVolumeControl::CVtUiVolumeControl( + MVtEngCommandHandler& aCommandHandler, + MVtEngAudio& aAudio, + MVtUiEngineCommandManager& aCommandManager, + CVtUiFeatureManager& aFeatureManager ) + : iCommandHandler( aCommandHandler ), + iAudio( aAudio ), + iCommandManager( aCommandManager ), + iVolumePtr( (TUint8*)&iVolume, sizeof( TVolume ) ), + iFeatureManager( aFeatureManager ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiVolumeControl::~CVtUiVolumeControl +// ----------------------------------------------------------------------------- +// +CVtUiVolumeControl::~CVtUiVolumeControl() + { + if ( iIsActive ) + { + iCommandHandler.CancelCommand( KVtEngSetAudioVolume ); // ignore error + } + iCommandManager.RemoveObserver( *this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiVolumeControl::ExecuteDialogLD +// ----------------------------------------------------------------------------- +// +void CVtUiVolumeControl::ConstructL() + { + CleanupStack::PushL( this ); + iCommandManager.AddObserverL( *this ); + CleanupStack::Pop( this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiVolumeControl::SetVoAdjustVolumeL +// ----------------------------------------------------------------------------- +// +void CVtUiVolumeControl::AdjustVolumeL( TVolume aVolume ) + { + __VTPRINTENTER( "VtUiVolCtrl.AdjustVolumeL") + if ( iIsActive ) + { + __VTPRINTENTER( "VtUiVolCtrl.AdjustVolumeL.Isactive") + return; + } + iIsActive = ETrue; + iVolume = aVolume; + iCommandHandler.ExecuteL( KVtEngSetAudioVolume, &iVolumePtr ); + __VTPRINTEXIT( "VtUiVolCtrl.AdjustVolumeL") + } + +// ----------------------------------------------------------------------------- +// CVtUiVolumeControl::HandleVTCommandPerformedL +// ----------------------------------------------------------------------------- +// +void CVtUiVolumeControl::HandleVTCommandPerformedL( + TVtEngCommandId aCommand, + const TInt aError ) + { + __VTPRINTENTER( "VtUiVolCtrl.HandleVTCommandPerformedL") + if ( aCommand == KVtEngSetAudioVolume ) + { + __VTPRINT( DEBUG_GEN, "VtUiVolCtrl.perf" ) + TInt error = aError; + // If volume has been changed, then try to set volume again. + //iIsActive = ETrue; + if ( IsVolumeChangedL() ) + { + __VTPRINT( DEBUG_GEN, "VtUiVolCtrl.retry" ) + TRAP( error, + iCommandHandler.ExecuteL( + KVtEngSetAudioVolume, + &iVolumePtr ) ); + __VTPRINT2( DEBUG_GEN, "VtUiVolCtrl.err.%d", error ) + iIsActive = ( error == KErrNone ); + } + else + { + __VTPRINT( DEBUG_GEN, + "VtUiVolCtrl.HandleVTCommandPerformedL iIsActive = EFalse; " ) + iIsActive = EFalse; + } + + } + __VTPRINTEXIT( "VtUiVolCtrl.HandleVTCommandPerformedL") + } + +// ----------------------------------------------------------------------------- +// CVtUiVolumeControl::IsVolumeChangedL +// ----------------------------------------------------------------------------- +// +TBool CVtUiVolumeControl::IsVolumeChangedL() + { + __VTPRINTENTER( "VtUiVolCtrl.IsVolumeChangedL" ) + MVtEngAudio::TAudioRoutingState audioRouting; + User::LeaveIfError( iAudio.GetRoutingState( audioRouting ) ); + const TInt volume( iAudio.OutputVolume( + !( audioRouting == MVtEngAudio::EAudioLoudspeaker ) ) ); + + CVtUiVolume* vp = static_cast< CVtUiVolume* >( + iFeatureManager.GetFeatureById( EVtUiFeatureIdVolume ) ); + TInt sliderVolume( volume ); + if ( vp ) + { + sliderVolume = vp->GetVolumeValue(); + // update correct volume + if ( audioRouting == MVtEngAudio::EAudioLoudspeaker ) + { + __VTPRINT( DEBUG_GEN, "VtUiVolCtrl.IsVolumeChangedL.LS") + iVolume.iHandsfreeVolume = sliderVolume; + } + else + { + __VTPRINT( DEBUG_GEN, "VtUiVolCtrl.IsVolumeChangedL.HS") + iVolume.iHandsetVolume = sliderVolume; + } + } + + __VTPRINT2( DEBUG_GEN, "VtUiVolCtrl.vol %d", volume ) + __VTPRINT2( DEBUG_GEN, "VtUiVolCtrl.slidvol %d", sliderVolume ) + __VTPRINTEXITR( "VtUiVolCtrl.IsVolumeChangedL %d", sliderVolume == volume ) + return sliderVolume == volume ? EFalse : ETrue; + } +// End of File diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/volume/cvtuivolumepopup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/volume/cvtuivolumepopup.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,277 @@ +/* +* Copyright (c) 2006 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: Volume popup implementation. +* +*/ + + +#include +#include +#include "cvtuivolumepopup.h" +#include "cvtuifeaturemanager.h" +#include "tVtuifeaturevariation.h" +#include "CVtUiAppUi.h" +#include "cvtengmodel.h" + +// --------------------------------------------------------------------------- +// CVtUiVolumePopup::NewL +// --------------------------------------------------------------------------- +// +CVtUiVolumePopup* CVtUiVolumePopup::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "CVtUiVolumePopup.NewL" ) + CVtUiVolumePopup* self = + new ( ELeave ) CVtUiVolumePopup( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + __VTPRINTEXIT( "CVtUiVolumePopup.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiVolumePopup::~CVtUiVolumePopup +// --------------------------------------------------------------------------- +// +CVtUiVolumePopup::~CVtUiVolumePopup() + { + __VTPRINTENTER( "CVtUiVolumePopup.~" ) + __VTPRINTEXIT( "CVtUiVolumePopup.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVolumePopup::UpdateVolumeAndRouting +// --------------------------------------------------------------------------- +// +void CVtUiVolumePopup::UpdateVolumeAndRoutingL() + { + __VTPRINTENTER( "CVtUiVolumePopup.UpdateVolumeAndRoutingL" ) + MVtEngAudio& audio( iModel.Audio() ); + MVtEngAudio::TAudioRoutingState audioRouting; + User::LeaveIfError( audio.GetRoutingState( audioRouting ) ); + //update routing and volume for this routing + iAudioRouting = audioRouting; + iVolume = OutputVolume( iAudioRouting ); + SetValue( iVolume ); + __VTPRINTEXIT( "CVtUiVolumePopup.UpdateVolumeAndRoutingL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVolumePopup::RefreshL +// --------------------------------------------------------------------------- +// +void CVtUiVolumePopup::RefreshL() + { + __VTPRINTENTER( "CVtUiVolumePopup.RefreshL" ) + MVtEngAudio& audio( iModel.Audio() ); + MVtEngAudio::TAudioRoutingState audioRouting; + User::LeaveIfError( audio.GetRoutingState( audioRouting ) ); + + // Check if audio routing has changed + if ( audioRouting != iAudioRouting ) + { + __VTPRINT( DEBUG_GEN, + "CVtUiVolumePopup.RefreshL audio routing changed" ) + // Audio routing changed -> update routing and volume for this routing + iAudioRouting = audioRouting; + iVolume = OutputVolume( iAudioRouting ); + SetValue( iVolume ); + __VTPRINT2( DEBUG_GEN, "CVtUiVolumePopup.RefreshL routing = %d", + iAudioRouting ) + __VTPRINT2( DEBUG_GEN, "CVtUiVolumePopup.RefreshL volume = %d", + iVolume ) + ClosePopup(); + } + else + { + // No change in audio routing + const TInt volume( OutputVolume( iAudioRouting ) ); + if ( volume != iVolume ) + { + __VTPRINT( DEBUG_GEN, "CVtUiVolumePopup.RefreshL volume changed" ) + iVolume = volume; + SetValue( iVolume ); + __VTPRINT2( DEBUG_GEN, "CVtUiVolumePopup.RefreshL volume = %d", + iVolume ) + if ( !IsPopUpVisible() ) + { + __VTPRINT( DEBUG_GEN, "CVtUiVolumePopup.RefreshL OpenPopupL" ) + OpenPopupL(); + } + else + { + __VTPRINT( DEBUG_GEN, "CVtUiVolumePopup.RefreshL ShowPopupL" ) + ShowPopupL(); + } + } + else + { + __VTPRINT( DEBUG_GEN, "CVtUiVolumePopup.RefreshL ShowPopupL2" ) + ShowPopupL(); + } + } + __VTPRINTEXIT( "CVtUiVolumePopup.RefreshL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVolumePopup::DoActivateL() +// --------------------------------------------------------------------------- +// +void CVtUiVolumePopup::DoActivateL() + { + __VTPRINTENTER( "CVtUiVolumePopup.DoActivateL" ) + CVtUiPopupBase::DoActivateL(); + // In order to refresh softkey. + iFeatureManager.AppUi().RefreshSoftkeysL(); + __VTPRINTEXIT( "CVtUiVolumePopup.DoActivateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVolumePopup::OfferKeyEventL() +// --------------------------------------------------------------------------- +// +TKeyResponse CVtUiVolumePopup::OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode /*aCode*/ ) + { + __VTPRINTENTER( "CVtUiVolumePopup.OfferKeyEventL" ) + TKeyResponse response( EKeyWasNotConsumed ); + TVtUiSideVolumeKeysVariation svkvariation; + if ( !svkvariation.IsSideVolumeKeysSupported() && + ( aEvent.iScanCode == EStdKeyLeftArrow || + aEvent.iScanCode == EStdKeyRightArrow ) ) + { + ShowPopupL(); + UpdateVolumeL(); + } + __VTPRINTEXITR( "CVtUiVolumePopup.OfferKeyEventL %d", response ) + return response; + } + +// --------------------------------------------------------------------------- +// CVtUiVolumePopup::HandleControlEventL +// --------------------------------------------------------------------------- +// +void CVtUiVolumePopup::HandleControlEventL( CCoeControl* aControl, + TCoeEvent aEventType ) + { + __VTPRINTENTER( "CVtUiVolumePopup.HandleControlEventL" ) + CVtUiPopupBase::HandleControlEventL( aControl, aEventType ); + if ( aEventType == EEventStateChanged ) + { + UpdateVolumeL(); + } + __VTPRINTEXIT( "CVtUiVolumePopup.HandleControlEventL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVolumePopup::CVtUiVolumePopup +// --------------------------------------------------------------------------- +// +CVtUiVolumePopup::CVtUiVolumePopup( CVtUiFeatureManager& aFeatureManager ) + : CVtUiPopupBase( aFeatureManager.ComponentManager(), + TVtUiBlockListBitField( + MVtUiComponent::EComponentIdToolbar | + MVtUiComponent::EComponentIdNumberEntry | + MVtUiComponent::EComponentIdZoom | + MVtUiComponent::EVComponentIdContrast | + MVtUiComponent::EVComponentIdBrightness ), + EComponentIdVolume ), + iModel( aFeatureManager.AppUi().Model() ), + iFeatureManager ( aFeatureManager ) + { + __VTPRINTENTER( "CVtUiVolumePopup.CVtUiVolumePopup" ) + __VTPRINTEXIT( "CVtUiVolumePopup.CVtUiVolumePopup" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVolumePopup::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiVolumePopup::ConstructL() + { + __VTPRINTENTER( "CVtUiVolumePopup.ConstructL" ) + BaseConstructL(); + // set default value + MVtEngAudio& audio( iModel.Audio() ); + MVtEngAudio::TAudioRoutingState audioRouting; + User::LeaveIfError( audio.GetRoutingState( audioRouting ) ); + SetValue( OutputVolume( audioRouting ) ); + // set default audiorouting + iAudioRouting = audioRouting; + __VTPRINTEXIT( "CVtUiVolumePopup.ConstructL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiVolumePopup::OutputVolume +// --------------------------------------------------------------------------- +// +TInt CVtUiVolumePopup::OutputVolume( + MVtEngAudio::TAudioRoutingState aRouting ) const + { + __VTPRINTENTER( "CVtUiVolumePopup.OutputVolume" ) + const MVtEngAudio& audio( iModel.Audio() ); + const TInt volume( audio.OutputVolume( + !( aRouting == MVtEngAudio::EAudioLoudspeaker ) ) ); + __VTPRINTEXITR( "CVtUiVolumePopup.OutputVolume %d", volume ) + return volume; + } + +// --------------------------------------------------------------------------- +// CVtUiVolumePopup::UpdateVolumeL +// --------------------------------------------------------------------------- +// +void CVtUiVolumePopup::UpdateVolumeL() + { + __VTPRINTENTER( "CVtUiVolumePopup.UpdateVolumeL" ) + + MVtEngAudio& audio( iModel.Audio() ); + MVtEngAudio::TAudioRoutingState audioRouting; + User::LeaveIfError( audio.GetRoutingState( audioRouting ) ); + + const TInt volume( OutputVolume( iAudioRouting ) ); + + __VTPRINT2( DEBUG_GEN, "CVtUiVolumePopup.UpdateVolumeL volume = %d", + volume ) + __VTPRINT2( DEBUG_GEN, "CVtUiVolumePopup.UpdateVolumeL Value() = %d", + Value() ) + if ( volume != Value() ) + { + MVtEngAudio::TVtEngOutputVolume newVolume; + + // Get current audio values from engine + // and set new audio volume to right routing + if ( iAudioRouting == MVtEngAudio::EAudioLoudspeaker ) + { + __VTPRINT( DEBUG_GEN, "CVtUiVolumePopup.UpdateVolumeL.LS") + // changed value + newVolume.iHandsfreeVolume = Value(); + // old value + TInt volume = audio.OutputVolume( ETrue ); + newVolume.iHandsetVolume = volume; + } + else + { + __VTPRINT( DEBUG_GEN, "CVtUiVolumePopup.UpdateVolumeL.HS") + // changed value + newVolume.iHandsetVolume = Value(); + // old value + TInt volume = audio.OutputVolume( EFalse ); + newVolume.iHandsfreeVolume = volume; + } + + iFeatureManager.AppUi().CmdUpdateVolumeL( newVolume ); + } + __VTPRINTEXIT( "CVtUiVolumePopup.UpdateVolumeL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/zoom/cvtuizoom.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/zoom/cvtuizoom.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2006 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: Zoom feature implementation. +* +*/ + + +#include +#include "cvtuizoom.h" +#include "tvtuifeatureids.h" +#include "cvtuizoompopup.h" +#include "cvtuifeaturemanager.h" +#include "tvtuistates.h" + +// --------------------------------------------------------------------------- +// CVtUiZoom::NewL +// --------------------------------------------------------------------------- +// +CVtUiZoom* CVtUiZoom::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "CVtUiZoom.NewL" ) + CVtUiZoom* self = + new ( ELeave ) CVtUiZoom( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + __VTPRINTEXIT( "CVtUiZoom.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiZoom::~CVtUiZoom +// --------------------------------------------------------------------------- +// +CVtUiZoom::~CVtUiZoom() + { + __VTPRINTENTER( "CVtUiZoom.~" ) + __VTPRINTEXIT( "CVtUiZoom.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoom::RefreshL +// --------------------------------------------------------------------------- +// +void CVtUiZoom::RefreshL() + { + __VTPRINTENTER( "CVtUiZoom.RefreshL" ) + if ( State() == EActive ) + { + static_cast< CVtUiZoomPopup& >( Popup() ).RefreshL(); + } + __VTPRINTEXIT( "CVtUiZoom.RefreshL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoom::StartL +// --------------------------------------------------------------------------- +// +void CVtUiZoom::StartL() + { + __VTPRINTENTER( "CVtUiZoom.StartL" ) + if ( State() == EActive ) + { + // need to refresh when already active to replenish the close timer + RefreshL(); + } + else + { + iFeatureManager.UiStates().SetIsFloatingToolbarVisible( ETrue ); + CVtUiSliderBase::StartL(); + iFeatureManager.UiStates().SetZoomModeOn( ETrue ); + } + __VTPRINTEXIT( "CVtUiZoom.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoom::Stop +// --------------------------------------------------------------------------- +// +void CVtUiZoom::Stop() + { + __VTPRINTENTER( "CVtUiZoom.Stop" ) + iFeatureManager.UiStates().SetZoomModeOn( EFalse ); + CVtUiSliderBase::Stop(); + __VTPRINTEXIT( "CVtUiZoom.Stop" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoom::ComponenStateChangedL() +// --------------------------------------------------------------------------- +// +void CVtUiZoom::ComponenStateChangedL() + { + __VTPRINTENTER( "CVtUiZoom.ComponenStateChangedL()" ) + // Close event received stop the feature + // If this was a block event then do not stop the feature + // Currently we can't separate block and stop events from component manager + if ( !iFeatureManager.UiStates().IsCaptureModeOn() ) + { + __VTPRINT( DEBUG_GEN, "CVtUiZoom.ComponenStateChangedL.Stop" ) + Stop(); + } + __VTPRINTEXIT( "CVtUiZoom.ComponenStateChangedL()" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoom::CVtUiZoom +// --------------------------------------------------------------------------- +// +CVtUiZoom::CVtUiZoom( CVtUiFeatureManager& aFeatureManager ) + : CVtUiSliderBase( aFeatureManager, EVtUiFeatureIdZoom ) + { + __VTPRINTENTER( "CVtUiZoom.CVtUiZoom" ) + __VTPRINTEXIT( "CVtUiZoom.CVtUiZoom" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoom::CVtUiZoom +// --------------------------------------------------------------------------- +// +void CVtUiZoom::ConstructL() + { + __VTPRINTENTER( "CVtUiZoom.ConstructL" ) + BaseConstructL(); + SetPopup( CVtUiZoomPopup::NewL( iFeatureManager ) ); + __VTPRINTEXIT( "CVtUiZoom.ConstructL" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/features/zoom/cvtuizoompopup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/features/zoom/cvtuizoompopup.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,282 @@ +/* +* Copyright (c) 2006 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: Zoom popup implementation. +* +*/ + + +#include +#include +#include "cvtuizoompopup.h" +#include "cvtuifeaturemanager.h" +#include "tVtuifeaturevariation.h" +#include "CVtUiAppUi.h" +#include "cvtengmodel.h" + +// Number of zoom steps +static const TInt KZoomStepCount = 10; + +// Minimum zoom factor value +static const TInt KMinZoomFactor = 0; + +// default time out time for zoom popup +const TInt KDefaultZoomTimeOutTime = 5; + +// --------------------------------------------------------------------------- +// CVtUiZoomPopup::NewL +// --------------------------------------------------------------------------- +// +CVtUiZoomPopup* CVtUiZoomPopup::NewL( CVtUiFeatureManager& + aFeatureManager ) + { + __VTPRINTENTER( "CVtUiZoomPopup.NewL" ) + CVtUiZoomPopup* self = + new ( ELeave ) CVtUiZoomPopup( aFeatureManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + __VTPRINTEXIT( "CVtUiZoomPopup.NewL" ) + return self; + } + +// --------------------------------------------------------------------------- +// CVtUiZoomPopup::~CVtUiZoomPopup +// --------------------------------------------------------------------------- +// +CVtUiZoomPopup::~CVtUiZoomPopup() + { + __VTPRINTENTER( "CVtUiZoomPopup.~" ) + __VTPRINTEXIT( "CVtUiZoomPopup.~" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoomPopup::RefreshL +// --------------------------------------------------------------------------- +// +void CVtUiZoomPopup::RefreshL() + { + __VTPRINTENTER( "CVtUiZoomPopup.RefreshL" ) + + UpdateAdjustRangeL(); + + iCurrent = CurrentZoomStep(); + if ( iCurrent < KMinZoomFactor ) + { + User::Leave( KErrArgument ); + } + SetValue( iCurrent ); + ShowPopupL(); + __VTPRINTEXIT( "CVtUiZoomPopup.RefreshL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoomPopup::DoActivateL() +// --------------------------------------------------------------------------- +// +void CVtUiZoomPopup::DoActivateL() + { + __VTPRINTENTER( "CVtUiZoomPopup.DoActivateL" ) + UpdateAdjustRangeL(); + CVtUiPopupBase::DoActivateL(); + // In order to refresh softkey. + iFeatureManager.AppUi().RefreshSoftkeysL(); + __VTPRINTEXIT( "CVtUiZoomPopup.DoActivateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoomPopup::OfferKeyEventL() +// --------------------------------------------------------------------------- +// +TKeyResponse CVtUiZoomPopup::OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode aCode ) + { + __VTPRINTENTER( "CVtUiZoomPopup.OfferKeyEventL" ) + TKeyResponse response( EKeyWasNotConsumed ); + // Don't handle other types here + if ( aCode != EEventKey ) + { + return response; + } + + if ( aEvent.iScanCode == EStdKeyUpArrow || + aEvent.iScanCode == EStdKeyDownArrow || + aEvent.iCode == EKeyZoomIn || + aEvent.iCode == EKeyZoomOut ) + { + __VTPRINT( DEBUG_GEN, "CVtUiZoomPopup.OfferKeyEventL zoom key" ) + TInt step( 1 ); + if ( aEvent.iScanCode == EStdKeyDownArrow || + aEvent.iCode == EKeyZoomOut ) + { + step = -step; + } + const TInt current( Value() ); + TInt value( current + step ); + value = Max( KMinZoomFactor, Min( value, KZoomStepCount ) ); + if ( value != current ) + { + __VTPRINT2( DEBUG_GEN, "CVtUiZoomPopup.OfferKeyEventL zoom = %d", + value ) + SetValue( value ); + iFeatureManager.AppUi().SetZoomFactorL( ScaledValue() ); + response = EKeyWasConsumed; + } + ShowPopupL(); + } + __VTPRINTEXITR( "CVtUiZoomPopup.OfferKeyEventL %d", response ) + return response; + } + +// --------------------------------------------------------------------------- +// CVtUiZoomPopup::HandleControlEventL +// --------------------------------------------------------------------------- +// +void CVtUiZoomPopup::HandleControlEventL( CCoeControl* aControl, + TCoeEvent aEventType ) + { + __VTPRINTENTER( "CVtUiZoomPopup.HandleControlEventL" ) + CVtUiPopupBase::HandleControlEventL( aControl, aEventType ); + + if ( aEventType == EEventStateChanged ) + { + __VTPRINT2( DEBUG_GEN, "CVtUiZoomPopup.HandleControlEventL zoom = %d", ScaledValue() ) + + if ( CurrentZoomStep() != Value() ) + { + iFeatureManager.AppUi().SetZoomFactorL( ScaledValue() ); + } + } + + __VTPRINTEXIT( "CVtUiZoomPopup.HandleControlEventL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoomPopup::CVtUiZoomPopup +// --------------------------------------------------------------------------- +// +CVtUiZoomPopup::CVtUiZoomPopup( CVtUiFeatureManager& aFeatureManager ) + : CVtUiPopupBase( aFeatureManager.ComponentManager(), + TVtUiBlockListBitField( + MVtUiComponent::EComponentIdDialer | + MVtUiComponent::EComponentIdToolbar | + MVtUiComponent::EComponentIdNumberEntry | + MVtUiComponent::EComponentIdVolume | + MVtUiComponent::EVComponentIdBrightness | + MVtUiComponent::EVComponentIdContrast + ), + EComponentIdZoom ), + iFeatureManager( aFeatureManager ), + iMedia( aFeatureManager.AppUi().Model().Media() ), + iCurrent( KErrNotReady ) + { + __VTPRINTENTER( "CVtUiZoomPopup.CVtUiZoomPopup" ) + __VTPRINTEXIT( "CVtUiZoomPopup.CVtUiZoomPopup" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoomPopup::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiZoomPopup::ConstructL() + { + __VTPRINTENTER( "CVtUiZoomPopup.ConstructL" ) + BaseConstructL(); + // Set slider type to percentage + SetValueType( EAknSliderValuePercentage ); + + // Set timeout + SetTimeOut( KDefaultZoomTimeOutTime ); + __VTPRINTEXIT( "CVtUiZoomPopup.ConstructL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoomPopup::UpdateAdjustRangeL +// --------------------------------------------------------------------------- +// +void CVtUiZoomPopup::UpdateAdjustRangeL() + { + __VTPRINTENTER( "CVtUiZoomPopup.UpdateAdjustRangeL" ) + // Get max zoom step from engine + iMax = MaxZoomStep(); + // Set value range to visible slider control + // range 0-10 or 0-iMax if max < 0 + // stepcount = 10 or iMax if max < 10 + SetAdjustRange( KMinZoomFactor, Min( KZoomStepCount, iMax ), Min( KZoomStepCount, iMax ) ); + + // Set value range to baseclass + // range on e.g. 0-20 + SetMinAndMaxValues( KMinZoomFactor, iMax ); + + // Get current zoom step + iCurrent = CurrentZoomStep(); + + if ( iCurrent == KErrNotFound || iMax == KErrNotFound || iCurrent > iMax ) + { + User::Leave( KErrNotFound ); + } + // Set new value + SetValue( iCurrent ); + __VTPRINTEXIT( "CVtUiZoomPopup.UpdateAdjustRangeL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiZoomPopup::CurrentZoomStep +// --------------------------------------------------------------------------- +// +TInt CVtUiZoomPopup::CurrentZoomStep() const + { + __VTPRINTENTER( "CVtUiZoomPopup.CurrentZoomStep" ) + TInt current( KMinZoomFactor ); + const TInt error( iMedia.GetCurrentZoomStep( current ) ); + current = ( error ? KErrNotFound : current ); + + // Value asked from the engine must be scaled. + // If the current asked value is 1 then the scaling formula in the + // popupbase doesn't round the value to 1 there fore value is + // initalized to 1. + TInt val = 1; + if ( current != 1 ) + { + val = SliderValueWithScaling( current ); + } + __VTPRINTEXITR( "CVtUiZoomPopup.CurrentZoomStep %d", val ) + return val; + } + +// --------------------------------------------------------------------------- +// CVtUiZoomPopup::MaxZoomStep +// --------------------------------------------------------------------------- +// +TInt CVtUiZoomPopup::MaxZoomStep() const + { + __VTPRINTENTER( "CVtUiZoomPopup.MaxZoomStep" ) + TInt max( KMinZoomFactor ); + const TInt error( iMedia.GetMaxZoomStep( max ) ); + max = ( error ? KErrNotFound : max ); + __VTPRINTEXITR( "CVtUiZoomPopup.MaxZoomStep %d", max ) + return max; + } + +// --------------------------------------------------------------------------- +// CVtUiZoomPopup::ScaleAndSetZoomFactorL +// --------------------------------------------------------------------------- +// +void CVtUiZoomPopup::ScaleAndSetZoomFactorL( TInt aValue ) + { + __VTPRINTENTER( "CVtUiZoomPopup.ScaleAndSetZoomFactorL" ) + const TInt value = aValue * MaxZoomStep() / 10; // 10 vakioksi count + 1 ei yhtä + iFeatureManager.AppUi().SetZoomFactorL( value ); + __VTPRINTEXITR( "CVtUiZoomPopup.ScaleAndSetZoomFactorL %d", value ) + } + diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/sliders/cvtuipopupbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/sliders/cvtuipopupbase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,509 @@ +/* +* Copyright (c) 2007 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: Base class for video telephone popups +* +*/ + + +#include +#include +#include +#include + +#include "cvtuipopupbase.h" +#include "mvtuicomponentmanager.h" +#include "mvtuicomponentstateobserver.h" +#include "VtUiPanic.h" +#include +#include +#include + +// default time out time for popup +const TInt KDefaultTimeOutTime = 2; + +// max value for slider is 100 (100%) +const TInt KMaxSliderValue = 100; + +// Implementation of TVtUiBaseComponentState + +// --------------------------------------------------------------------------- +// TVtUiBaseComponentState::TVtUiBaseComponentState +// --------------------------------------------------------------------------- +// +TVtUiBaseComponentState::TVtUiBaseComponentState( + MVtUiComponent& aComponent, TVtUiBlockListBitField aBitField ) : + TVtUiComponentState( aComponent, aBitField ) + { + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::~CVtUiPopupBase +// --------------------------------------------------------------------------- +// +CVtUiPopupBase::~CVtUiPopupBase() + { + __VTPRINTENTER( "CVtUiPopupBase.~CVtUiPopupBase" ) + if ( iPopup ) + { + iPopup->CloseVolumePopup(); + } + // unregister component change registration + iComponentManager.ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::EUnregister ); + delete iPopup; + __VTPRINTEXIT( "CVtUiPopupBase.~CVtUiPopupBase" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::ComponentId +// --------------------------------------------------------------------------- +// + MVtUiComponent::TComponentId CVtUiPopupBase::ComponentId() const + { + __VTPRINTENTER( "CVtUiPopupBase.ComponentId" ) + __VTPRINTEXIT( "CVtUiPopupBase.ComponentId" ) + return iComponentId; + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::ComponentAsControl +// --------------------------------------------------------------------------- +// + CCoeControl* CVtUiPopupBase::ComponentAsControl() + { + __VTPRINTENTER( "CVtUiPopupBase.ComponentAsControl" ) + __VTPRINTEXIT( "CVtUiPopupBase.ComponentAsControl" ) + return NULL; + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::DoActivateL +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::DoActivateL() + { + __VTPRINTENTER( "CVtUiPopupBase.DoActivateL" ) + User::LeaveIfError( + iComponentManager.ChangeResourceChangeRegistration( + *this, MVtUiComponentManager::ERegister ) ); + + User::LeaveIfError( iComponentManager.ChangeKeyEventRegistration( + *this, MVtUiComponentManager::ERegister ) ); + + ShowPopupL(); + __VTPRINTEXIT( "CVtUiPopupBase.DoActivateL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::DoDeactivateL() +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::DoDeactivateL() + { + __VTPRINTENTER( "CVtUiPopupBase.DoDeactivateL()" ) + iPopup->CloseVolumePopup(); + //notify observer that popup has been closed + if ( iCompStateObserver ) + { + iCompStateObserver->ComponenStateChangedL(); + } + // unregister resource change registration + iComponentManager.ChangeResourceChangeRegistration( + *this, MVtUiComponentManager::EUnregister ); + + iComponentManager.ChangeKeyEventRegistration( + *this, MVtUiComponentManager::EUnregister ); + __VTPRINTEXIT( "CVtUiPopupBase.DoDeactivateL()" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::HandleResourceChangeL() +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::HandleResourceChangeL( TInt aType ) + { + __VTPRINTENTER( "CVtUiPopupBase.HandleResourceChangeL()" ) + if ( aType == KEikDynamicLayoutVariantSwitch ) + { + iPopup->SetPosition( PopupPosition() ); + } + __VTPRINTEXIT( "CVtUiPopupBase.HandleResourceChangeL()" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::HandleControlEventL +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::HandleControlEventL( CCoeControl* /*aControl*/, + TCoeEvent aEventType ) + { + __VTPRINTENTER( "CVtUiPopupBase.HandleControlEventL" ) + if ( aEventType == EEventStateChanged ) + { + // popup closed + if( !IsPopUpVisible() ) + { + ClosePopup(); + } + } + __VTPRINTEXIT( "CVtUiPopupBase.HandleControlEventL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::OfferKeyEventL() +// --------------------------------------------------------------------------- +// +TKeyResponse CVtUiPopupBase::OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode aCode ) + { + __VTPRINTENTER( "CVtUiPopupBase.OfferKeyEventL" ) + TKeyResponse response( EKeyWasNotConsumed ); + // Don't handle other types here + if ( aCode != EEventKey ) + { + return response; + } + + if ( aEvent.iScanCode == EStdKeyUpArrow || + aEvent.iScanCode == EStdKeyDownArrow ) + { + __VTPRINT( DEBUG_GEN, "CVtUiPopupBase.OfferKeyEventL" ) + TInt step( 1 ); + if ( aEvent.iScanCode == EStdKeyDownArrow ) + { + step = -step; + } + + const TInt current( Value() ); + TInt value( current + step ); + + TInt maxValue; + TInt minValue; + iPopup->GetRange( minValue, maxValue ); + + __VTPRINT2( DEBUG_GEN, "CVtUiPopupBase.OfferKeyEventL iPopup minValue = %d", + minValue ) + __VTPRINT2( DEBUG_GEN, "CVtUiPopupBase.OfferKeyEventL iPopup maxValue = %d", + maxValue ) + + minValue = minValue / iScalingConstant; + value = Max( minValue, Min( value, iStepCount ) ); + if ( value != current ) + { + __VTPRINT2( DEBUG_GEN, "CVtUiPopupBase.OfferKeyEventL Volume value = %d", + value ) + SetValue( value ); + response = EKeyWasConsumed; + } + ShowPopupL(); + } + __VTPRINTEXITR( "CVtUiPopupBase.OfferKeyEventL %d", response ) + return response; + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::SetObserver() +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::SetObserver( MVtUiComponentStateObserver& aCompStateObserver ) + { + __VTPRINTENTER( "CVtUiPopupBase.SetObserver()" ) + iCompStateObserver = &aCompStateObserver; + __VTPRINTEXIT( "CVtUiPopupBase.SetObserver()" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::SetValueType() +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::SetValueType( TInt aValueType ) + { + __VTPRINTENTER( "CVtUiPopupBase.SetValueType" ) + iPopup->SetValueType( aValueType ); + __VTPRINTEXIT( "CVtUiPopupBase.SetValueType" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::SetPermanenVisibility() +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::SetPermanenVisibility( TBool aPermanent ) + { + __VTPRINTENTER( "CVtUiPopupBase.SetPermanenVisibility" ) + __VTPRINT2( DEBUG_GEN, "CVtUiPopupBase = %d", aPermanent ); + const TInt longPeriod( 86400 ); // 24 h + if ( aPermanent ) + { + iPopup->SetTimeOutAsSecond( longPeriod ); + iPopup->ClosePopupWhenTappedOutside( !aPermanent ); + } + else + { + iPopup->ClosePopupWhenTappedOutside( !aPermanent ); + iPopup->SetTimeOutAsSecond( iTimeOutTime ); + } + __VTPRINTEXIT( "CVtUiPopupBase.SetPermanenVisibility" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::CVtUiPopupBase +// --------------------------------------------------------------------------- +// +CVtUiPopupBase::CVtUiPopupBase( MVtUiComponentManager& aComponentManager, + TVtUiBlockListBitField aBitField, TComponentId aComponentId ) : + iComponentManager ( aComponentManager ), iComponentState( *this, aBitField ), + iComponentId( aComponentId ), iScalingConstant( 1 ) + { + __VTPRINTENTER( "CVtUiPopupBase.CVtUiPopupBase" ) + __VTPRINTEXIT( "CVtUiPopupBase.CVtUiPopupBase" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::BaseConstructL +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::BaseConstructL() + { + __VTPRINTENTER( "CVtUiPopupBase.BaseConstructL" ) + iPopup = CAknVolumePopup::NewL( NULL, ETrue ); + iPopup->SetObserver( this ); + + // Initialized to 2 seconds + iTimeOutTime = KDefaultTimeOutTime; + + // set position + iPopup->SetPosition( PopupPosition() ); + + User::LeaveIfError( + iComponentManager.ChangeComponentRegistration( + iComponentState, MVtUiComponentManager::ERegister ) ); + __VTPRINTEXIT( "CVtUiPopupBase.BaseConstructL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::ShowPopupL +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::ShowPopupL() + { + __VTPRINTENTER( "CVtUiPopupBase.ShowPopupL" ) + iPopup->ShowVolumePopupL(); + __VTPRINTEXIT( "CVtUiPopupBase.ShowPopupL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::OpenPopupL +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::OpenPopupL() + { + __VTPRINTENTER( "CVtUiPopupBase.OpenPopupL" ) + TRAPD( error, + iComponentManager.RequestActivationL( ComponentId() ) ); + __VTPRINT2( DEBUG_GEN, "CVtUiPopupBase.OpenPopupL reqAct=%d", error ); + User::LeaveIfError( error ); + __VTPRINTEXIT( "CVtUiPopupBase.OpenPopupL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::ClosePopup +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::ClosePopup() + { + __VTPRINTENTER( "CVtUiPopupBase.ClosePopup" ) + TInt error( KErrNone ); + TRAP( error, iComponentManager.DeActivateComponentL( ComponentId() ) ); + __VTPRINTEXITR( "CVtUiPopupBase.ClosePopup %d", error ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::SetTimeOut +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::SetTimeOut( TInt aTime ) + { + iTimeOutTime = aTime; + iPopup->SetTimeOutAsSecond( aTime ); + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::IsPopUpVisible +// --------------------------------------------------------------------------- +// +TBool CVtUiPopupBase::IsPopUpVisible() + { + return iPopup->IsVisible(); + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::PopupPosition +// --------------------------------------------------------------------------- +// +TPoint CVtUiPopupBase::PopupPosition() const + { + __VTPRINTENTER( "CVtUiPopupBase.PopupPosition" ) + TRect mainPaneRect; + TAknWindowLineLayout popupLineLayout; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect ); + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + popupLineLayout = + AknLayoutScalable_Apps::aid_placing_vt_slider_lsc().LayoutLine(); + } + else + { + popupLineLayout = + AknLayoutScalable_Apps::aid_placing_vt_slider_prt().LayoutLine(); + } + + TAknLayoutRect layoutRect; + layoutRect.LayoutRect( mainPaneRect, popupLineLayout ); + __VTPRINTEXIT( "CVtUiPopupBase.PopupPosition" ) + return layoutRect.Rect().iTl; + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::SetPopupValue +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::SetPopupValue( TInt aValue ) + { + iPopup->SetValue( aValue * iScalingConstant ); + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::SetAdjustRange +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::SetAdjustRange( TInt aMinValue, TInt aMaxValue, + TInt aStepCount ) + { + __VTPRINTENTER( "CVtUiPopupBase.SetAdjustRange" ) + __ASSERT_ALWAYS( aMinValue <= aMaxValue && + ( aMaxValue - aMinValue ) >= aStepCount && + aStepCount > 0, VtUiPanic::Panic( EVtUiPanicOutOfRange ) ); + + // store stepcount + iStepCount = aStepCount; + + // Aknvolumepopup does not do any scaling i.e max value + // must be 100 or otherwise the per cent value is not shown right. + // Scaling constant is used to multiple max value to be 100. + iScalingConstant = KMaxSliderValue / aMaxValue; + iPopup->SetRange( aMinValue, KMaxSliderValue ); + TInt stepSize = KMaxSliderValue / aStepCount; + iPopup->SetStepSize( stepSize ); + __VTPRINTEXIT( "CVtUiPopupBase.SetAdjustRange" ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::SetValue +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::SetValue( TInt aValue ) + { + __VTPRINTENTER( "CVtUiPopupBase.SetValue" ) + SetPopupValue( aValue ); + __VTPRINTEXITR( "CVtUiPopupBase.SetValue %d", Value() ) + } + + // --------------------------------------------------------------------------- +// CVtUiPopupBase::ScaleAndSetValue +// --------------------------------------------------------------------------- +// + void CVtUiPopupBase::ScaleAndSetValue( TInt aValue ) + { + __VTPRINTENTER( "CVtUiPopupBase.ScaleAndSetValue" ) + SetPopupValue( SliderValueWithScaling( aValue ) ); + __VTPRINTEXITR( "CVtUiPopupBase.ScaleAndSetValue %d", Value() ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::ScaledValue +// --------------------------------------------------------------------------- +// + TInt CVtUiPopupBase::ScaledValue() const + { + __VTPRINTENTER( "CVtUiPopupBase.ScaledValue" ) + TInt value = Value() * ( iMax-iMin ) / iStepCount + iMin; + __VTPRINTEXITR( "CVtUiPopupBase.ScaledValue %d", value ) + return value; + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::SliderValueWithScaling +// --------------------------------------------------------------------------- +// + TInt CVtUiPopupBase::SliderValueWithScaling( TInt aValue) const + { + __VTPRINTENTER( "CVtUiPopupBase.SliderValueWithScaling" ) + __VTPRINT2( DEBUG_GEN, "CVtUiPopupBase.aValue=%d", aValue ) + __VTPRINT2( DEBUG_GEN, "CVtUiPopupBase.iStepCount=%d", iStepCount ) + __VTPRINT2( DEBUG_GEN, "CVtUiPopupBase.iMax=%d", iMax ) + + if ( iMax == aValue) + { + return iStepCount; + } + else if ( iMin == aValue ) + { + return 0; + } + TInt modValue = iStepCount * ( aValue - iMin) % ( iMax - iMin ); + TInt value = iStepCount * ( aValue - iMin) / ( iMax - iMin ); + + if ( modValue > ( iMax - iMin ) / 2 ) + { + value++; + } + + __VTPRINTEXITR( "CVtUiPopupBase.SliderValueWithScaling %d", value ) + return value; + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::SetMinAndMaxValues +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::SetMinAndMaxValues( TInt aMin, TInt aMax ) + { + __VTPRINTENTER( "CVtUiPopupBase.SetMaxAndMinValues" ) + __VTPRINT2( DEBUG_GEN, "CVtUiPopupBase..aMax=%d", aMax ) + __VTPRINT2( DEBUG_GEN, "CVtUiPopupBase..aMinV=%d", aMin ) + iMax = aMax; + iMin = aMin; + __VTPRINTEXIT( "CVtUiPopupBase.SetMaxAndMinValues " ) + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::Value +// --------------------------------------------------------------------------- +// +TInt CVtUiPopupBase::Value() const + { + __VTPRINTENTER( "CVtUiPopupBase.Value" ) + __VTPRINTEXITR( "CVtUiPopupBase.Value %d", iPopup->Value() ) + return iPopup->Value() / iScalingConstant; + } + +// --------------------------------------------------------------------------- +// CVtUiPopupBase::UpdatePopupL +// --------------------------------------------------------------------------- +// +void CVtUiPopupBase::UpdatePopupL() + { + __VTPRINTENTER( "CVtUiPopupBase.UpdatePopupL" ) + __VTPRINTEXIT( "CVtUiPopupBase.UpdatePopupL " ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/sliders/cvtuisliderbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/sliders/cvtuisliderbase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 2007 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: Base class implementation for video telephone sliders +* +*/ + + +#include + +#include "cvtuisliderbase.h" +#include "cvtuipopupbase.h" +#include "cvtuifeaturemanager.h" +#include "mvtuicomponentmanager.h" + +// --------------------------------------------------------------------------- +// CVtUiSliderBase::~CVtUiSliderBase +// --------------------------------------------------------------------------- +// +CVtUiSliderBase::~CVtUiSliderBase() + { + __VTPRINTENTER( "CVtUiSliderBase.~CVtUiSliderBase" ) + delete iPopup; + __VTPRINTEXIT( "CVtUiSliderBase.~CVtUiSliderBase" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSliderBase::UpdateSlider +// --------------------------------------------------------------------------- +// +void CVtUiSliderBase::UpdateSlider() + { + __VTPRINTENTER( "CVtUiSliderBase.UpdateSlider" ) + + iPopup->UpdatePopupL(); + + __VTPRINTEXIT( "CVtUiSliderBase.UpdateSlider" ) + } +// --------------------------------------------------------------------------- +// CVtUiSliderBase::StartL +// --------------------------------------------------------------------------- +// +void CVtUiSliderBase::StartL() + { + __VTPRINTENTER( "CVtUiSliderBase.StartL" ) + if ( iFeatureState == MVtUiFeature::EReady ) + { + iFeatureManager.ComponentManager(). + RequestActivationL( iPopup->ComponentId() ); + // set state + iFeatureState = MVtUiFeature::EActive; + } + __VTPRINTEXIT( "CVtUiSliderBase.StartL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSliderBase::Stop +// --------------------------------------------------------------------------- +// +void CVtUiSliderBase::Stop() + { + __VTPRINTENTER( "CVtUiSliderBase.Stop" ) + TRAP_IGNORE( + { + if ( iFeatureState == MVtUiFeature::EActive ) + { + // set state + iFeatureState = MVtUiFeature::EReady; + iFeatureManager.ComponentManager(). + DeActivateComponentL( iPopup->ComponentId() ); + } + } ); + __VTPRINTEXIT( "CVtUiSliderBase.Stop" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSliderBase::InitFeatureL +// --------------------------------------------------------------------------- +// +void CVtUiSliderBase::InitFeatureL() + { + __VTPRINTENTER( "CVtUiSliderBase.InitFeatureL" ) + iFeatureState = EReady; + __VTPRINTEXIT( "CVtUiSliderBase.InitFeatureL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSliderBase::ComponenStateChangedL() +// --------------------------------------------------------------------------- +// +void CVtUiSliderBase::ComponenStateChangedL() + { + __VTPRINTENTER( "CVtUiSliderBase.ComponenStateChangedL()" ) + // Close event received stop the feature + Stop(); + __VTPRINTEXIT( "CVtUiSliderBase.ComponenStateChangedL()" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSliderBase::SetPermanenVisibility() +// --------------------------------------------------------------------------- +// +void CVtUiSliderBase::SetPermanenVisibility( TBool aPermanent ) + { + if ( iPopup ) + { + iPopup->SetPermanenVisibility( aPermanent ); + } + } + +// --------------------------------------------------------------------------- +// CVtUiSliderBase::CVtUiSliderBase +// --------------------------------------------------------------------------- +// +CVtUiSliderBase::CVtUiSliderBase( CVtUiFeatureManager& aFeatureManager, + TVtUiFeatureId aFeatureId ) : CVtUiFeatureBase( + aFeatureId, aFeatureManager ) + { + __VTPRINTENTER( "CVtUiSliderBase.CVtUiSliderBase" ) + __VTPRINTEXIT( "CVtUiSliderBase.CVtUiSliderBase" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSliderBase::ConstructL +// --------------------------------------------------------------------------- +// +void CVtUiSliderBase::ConstructL() + { + __VTPRINTENTER( "CVtUiSliderBase.ConstructL" ) + BaseConstructL(); + __VTPRINTEXIT( "CVtUiSliderBase.ConstructL" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSliderBase::SetPopup +// --------------------------------------------------------------------------- +// +void CVtUiSliderBase::SetPopup( CVtUiPopupBase* aPopup ) + { + __VTPRINTENTER( "CVtUiSliderBase.SetPopup" ) + iPopup = aPopup; + if ( iPopup ) + { + iPopup->SetObserver( *this ); + } + __VTPRINTEXIT( "CVtUiSliderBase.SetPopup" ) + } + +// --------------------------------------------------------------------------- +// CVtUiSliderBase::SetPopup +// --------------------------------------------------------------------------- +// +CVtUiPopupBase& CVtUiSliderBase::Popup() + { + return *iPopup; + } + +// --------------------------------------------------------------------------- +// CVtUiSliderBase::SetPopup +// --------------------------------------------------------------------------- +// +const CVtUiPopupBase& CVtUiSliderBase::Popup() const + { + return *iPopup; + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/tvtuiappstatebase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/tvtuiappstatebase.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,408 @@ +/* +* Copyright (c) 2007 - 2008 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: base class for application states +* +*/ + + +#include "tvtuiappstates.h" +#include "videotelui.hrh" +#include "tvtuistates.h" +#include "cvtuiappshutter.h" +#include "mvtuistatecontext.h" +#include +#include +#include +#include +#include +#include +#include +#include + +// By default call ending command is allowed to send to call handling. + +// Initially no shutdown request +TBool TVtUiAppStateBase::iShutdownRequested = EFalse; + +// ----------------------------------------------------------------------------- +// c++ constructor +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase::TVtUiAppStateBase( + MVtUiStateContext& aCtx, + TVtUiStates& aUiStates ) : iCtx(aCtx), iUiStates( aUiStates ) + { + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase::~TVtUiAppStateBase() + { + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::AppUiStartupPhase1DoneL +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::AppUiStartupPhase1DoneL() + { + // no default behavior + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::AppUiStartupPhase2DoneL +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::AppUiStartupPhase2DoneL() + { + // no default behavior + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::ShutdownDoneL +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::ShutdownDoneL() + { + // no default behavior + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::HandleForegroundChangedL +// ----------------------------------------------------------------------------- +// +TBool TVtUiAppStateBase::HandleForegroundChangedL( + const TBool /*aIsForegroung*/ ) + { + // no default behavior + return EFalse; + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::PreHandleForegroundChangedL +// ----------------------------------------------------------------------------- +// +TBool TVtUiAppStateBase::PreHandleForegroundChangedL( + const TBool /*aIsForegroung*/ ) + { + // no default behavior + return EFalse; + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::StartDtmfTone +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::StartDtmfTone( const TChar& /*aTone*/ ) + { + // no default behavior + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::StopDtmfTone +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::StopDtmfTone() + { + // no default behavior + } + + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::SetInitialStateL +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::SetInitialStateL( + MVtUiStateContext& aCtx, + TVtUiStates& aUiStates ) + { + __VTPRINTENTER( "TVtUiAppStateBase.SetInitialState" ) + TVtUiAppStateBase* initialState = + TVtUiStateStarting::InstanceL( aCtx, aUiStates ); + aCtx.ChangeState( initialState ); + initialState->OpenL(); + __VTPRINTEXIT( "TVtUiAppStateBase.SetInitialState" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::ShutdownRequested +// ----------------------------------------------------------------------------- +// +TBool TVtUiAppStateBase::ShutdownRequested() + { + return iShutdownRequested; + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::AppUiStartupFailedL +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::AppUiStartupFailedL() + { + __VTPRINTENTER( "TVtUiAppStateBase.AppUiStartupFailedL" ) + // Shutdown + ChangeStateL( *TVtUiStateResetting::InstanceL( iCtx, iUiStates ) ); + __VTPRINTEXIT( "TVtUiAppStateBase.AppUiStartupFailedL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::OpenL +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::OpenL() + { + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::Close +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::Close() + { + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::ChangeStateL +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::ChangeStateL( TVtUiAppStateBase& aNewState ) + { + __VTPRINTENTER( "TVtUiAppStateBase.ChangeStateL" ) + + // Check for transition to already active state. + TVtUiAppStateBase* state = &aNewState; + if ( state == this ) + { + __VTPRINTEXITR( "TVtUiAppStateBase.ChangeStateL %d", 0 ) + return; + } + const TVtEngCommandId pending = + iCtx.Model().CommandHandler().PendingCommand(); + if ( pending != KVtEngCommandNone && + state == TVtUiStateResetting::InstanceL( iCtx, iUiStates ) ) + { + // delay shutdown until engine command completes + __VTPRINT2( DEBUG_GEN, "TVtUiAppStateBase.ChangeStateL, pengind command is: %d", pending ); + TVtUiAppStateBase::iShutdownRequested = ETrue; + + if ( pending == KVtEngInitializeShareImage ) + { + iCtx.Model().CommandHandler().CancelCommand( pending ); + } + + __VTPRINTEXITR( "TVtUiAppStateBase.ChangeStateL %d", KErrNotReady ) + return; + } + __VTPRINT( DEBUG_GEN, + " TVtUiAppStateBase.ChangeStateL !! STATE TRANSITION !!" ) + iCtx.ChangeState( &aNewState ); + Close(); + // perform entry action for new state + aNewState.OpenL(); + __VTPRINTEXITR( "TVtUiAppStateBase.ChangeStateL %d", 1 ) + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::CleanupResetPushL +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::CleanupResetPushL() + { + // Shutdown if leave occurs in critical ops. + CleanupStack::PushL( + TCleanupItem( TransitionToReset, this ) ); + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::TransitionToReset +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::TransitionToReset( TAny* aAny ) + { + TVtUiAppStateBase* state = reinterpret_cast< TVtUiAppStateBase* >( aAny ); + TRAP_IGNORE( state->ChangeStateL( *TVtUiStateResetting::InstanceL( + state->iCtx, state->iUiStates ) ) ); + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::HandleVTCommandPerformedL +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase::TEventResponse TVtUiAppStateBase::HandleVTCommandPerformedL( + TVtEngCommandId /*aCommand*/, + const TInt /*aError*/ ) + { + __VTPRINTENTER( "TVtUiAppStateBase.HandleVTCommandPerformedL" ) + // By default all UI is allowed to handle all command completions. + TEventResponse handled = EEventNotHandled; + + // check if shutdown requested while command was pending + const TVtEngCommandId pending = iCtx.Model().CommandHandler().PendingCommand(); + if ( pending == KVtEngCommandNone && + TVtUiAppStateBase::iShutdownRequested ) + { + __VTPRINT( DEBUG_GEN, "Handling delayed shutdown" ); + ChangeStateL( *TVtUiStateResetting::InstanceL( + iCtx, iUiStates ) ); + } + __VTPRINTEXIT( "TVtUiAppStateBase.HandleVTCommandPerformedL" ) + return handled; + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::HandleVtEventL +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase::TEventResponse TVtUiAppStateBase::HandleVtEventL( + const TInt aEvent ) + { + __VTPRINTENTER( "TVtUiAppStateBase.HandleVtEventL" ) + TEventResponse handled = EEventHandled; + switch ( aEvent ) + { + case KVtEngDeviceLockOn: + case KVtEngDeviceLockOff: + HandleDeviceLockEventL( aEvent == KVtEngDeviceLockOn ); + break; + case KVtEngRemoteDisconnect: + /** Don't allow sending of end active call command to call handling + * because requesting disconnect from the network after NW originated + * termination violates standards. + */ + break; + default: + handled = EEventNotHandled; + break; + } + __VTPRINTEXIT( "TVtUiAppStateBase.HandleVtEventL" ) + return handled; + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::HandleCommandL +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase::TEventResponse TVtUiAppStateBase::HandleCommandL( + const TInt /*aCommand*/ ) + { + __VTPRINTENTER( "TVtUiAppStateBase.HandleCommandL" ) + TEventResponse handled = EEventNotHandled; + __VTPRINTEXITR( "TVtUiAppStateBase.HandleCommandL %d", handled ) + return handled; + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::HandleLayoutChangedL +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::HandleLayoutChangedL( ) + { + __VTPRINTENTER( "TVtUiAppStateBase.HandleLayoutChangedL" ) + // By default only indicate that layout change needs to be handled. + iUiStates.SetLayoutChangeNeeded( ETrue ); + __VTPRINTEXIT( "TVtUiAppStateBase.HandleLayoutChangedL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::HandleShutdownReady +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::HandleShutdownReady() + { + __VTPRINTENTER( "TVtUiAppStateBase.HandleShutdownReady" ) + // forwarded to AppUi which handles UI framework exit + iCtx.HandleShutdownReady(); + iCtx.ChangeState( NULL ); + // deletes current state + Close(); + __VTPRINTEXIT( "TVtUiAppStateBase.HandleShutdownReady" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::HandleDeviceLockEventL +// +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::HandleDeviceLockEventL( const TBool aDeviceIsLocked ) + { + __VTPRINTENTER( "TVtUiAppStateBase.HandleDeviceLockEventL" ) + iUiStates.SetDeviceLockOn( aDeviceIsLocked ); + if ( aDeviceIsLocked ) + { + iCtx.ChangeApplicationFocus( EFalse ); + } + __VTPRINTEXITR( "TVtUiAppStateBase.HandleDeviceLockEventL lock state=%d", + aDeviceIsLocked ) + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::CheckEndActiveCallL +// ----------------------------------------------------------------------------- +// +TBool TVtUiAppStateBase::CheckEndActiveCallL() + { + __VTPRINTENTER( "TVtUiAppStateBase.CheckEndActiveCallL" ) + const MVtEngSessionInfo::TSessionState state = SessionState( EFalse ); + TBool shutdownStarted( EFalse ); + if ( state == MVtEngSessionInfo::EIdle ) + { + __VTPRINT( DEBUG_GEN, "VtUi.Release bearer" ) + // h.245 session is ended + ChangeStateL( *TVtUiStateResetting::InstanceL( iCtx, iUiStates ) ); + shutdownStarted = ETrue; + } + __VTPRINTEXITR( "TVtUiAppStateBase.CheckEndActiveCallL %d", + shutdownStarted ) + return shutdownStarted; + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::SessionState +// ----------------------------------------------------------------------------- +// +MVtEngSessionInfo::TSessionState TVtUiAppStateBase::SessionState( + const TBool aUpdate ) const + { + const CVtEngModel& model = iCtx.Model(); + const MVtEngSessionInfo& session = model.Session(); + return session.State( aUpdate ); + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::SetLightsState +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::SetLightsState( const TBool aOn ) + { + __VTPRINTENTER( "TVtUiAppStateBase.SetLightsState" ) + const TInt value = aOn ? EForcedLightsOn : EForcedLightsOff; + RProperty::Set( + KPSUidCoreApplicationUIs, + KLightsVTForcedLightsOn, + value ); + __VTPRINTEXIT( "TVtUiAppStateBase.SetLightsState" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiAppStateBase::SetExecState +// ----------------------------------------------------------------------------- +// +void TVtUiAppStateBase::SetExecState( const TVtUiStates::TVtUiExecState aState ) + { + __VTPRINTENTER( "TVtUiAppStateBase.SetExecState" ) + iUiStates.SetExecState( aState ); + __VTPRINTEXITR( "TVtUiAppStateBase.SetExecState %d", aState ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/tvtuistateresetting.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/tvtuistateresetting.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,243 @@ +/* +* Copyright (c) 2007 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: waiting details application state +* +*/ + + +#include "tvtuistates.h" +#include "tvtuiappstates.h" +#include "mvtuistatecontext.h" +#include "cvtuiappshutter.h" +#include +#include + +TVtUiStateResetting* TVtUiStateResetting::iInstance = NULL; + +// c++ constructor +TVtUiStateResetting::TVtUiStateResetting( + MVtUiStateContext& aCtx, + TVtUiStates& aUiStates, + const TVtEngCommandId aCommand ) + : TVtUiAppStateBase( aCtx, aUiStates ), + iCommand( aCommand ) + { + __VTPRINT2( DEBUG_GEN, "TVtUiStateResetting.ctr iCommand=%d", iCommand ) + } + +// Destructor +TVtUiStateResetting::~TVtUiStateResetting() + { + } + +// ----------------------------------------------------------------------------- +// TVtUiStateResetting:: +// ----------------------------------------------------------------------------- +// +TVtUiStateResetting* TVtUiStateResetting::InstanceL( + MVtUiStateContext& aCtx, + TVtUiStates& aUiStates, + const TVtEngCommandId aCommand ) + { + __VTPRINTENTER( "TVtUiStateResetting.InstanceL" ) + if ( iInstance == NULL ) + { + iInstance = new ( ELeave ) TVtUiStateResetting( + aCtx, aUiStates, aCommand ); + } + else if ( aCommand != KVtEngCommandNone ) + { // if call ending is UI originated, command is given + iInstance->iCommand = aCommand; + __VTPRINT2( DEBUG_GEN, "TVtUiStateResetting.InstanceL iCommand=%d", + iInstance->iCommand ) + } + __VTPRINTEXIT( "TVtUiStateResetting.InstanceL" ) + return iInstance; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateResetting::ShutdownDoneL +// AppUi has finished its own shutdown steps. Notify app shutter that it may +// proceed. +// +// ----------------------------------------------------------------------------- +// +void TVtUiStateResetting::ShutdownDoneL() + { + __VTPRINTENTER( "TVtUiStateResetting.ShutdownDone" ) + CVtUiAppShutter* shutter = CVtUiAppShutter::InstanceL( *this ); + if ( shutter ) + { + shutter->StartShutdown(); + } + __VTPRINTEXIT( "TVtUiStateResetting.ShutdownDone" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateResetting::AppUiStartupFailedL +// ----------------------------------------------------------------------------- +// +void TVtUiStateResetting::AppUiStartupFailedL() + { + __VTPRINTENTER( "TVtUiStateResetting.AppUiStartupFailedL" ) + // no-op (overrides default behavior) + __VTPRINTEXIT( "TVtUiStateResetting.AppUiStartupFailedL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateResetting::HandleVTCommandPerformedL +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase::TEventResponse TVtUiStateResetting::HandleVTCommandPerformedL + ( + TVtEngCommandId aCommand, + const TInt /*aError*/ ) + { + __VTPRINTENTER( "TVtUiStateResetting.HandleVTCommandPerformedL" ) + // By default responses to commands are ignored while resetting + TEventResponse handled = EEventHandled; + switch ( aCommand ) + { + case KVtEngResetEngine: + // Allow UI to process reset command response + handled = EEventNotHandled; + break; + case KVtEngTerminateSession: + case KVtEngSwitchToVoice: + // + iCtx.ShutdownL(); + break; + default: + break; + } + __VTPRINTEXIT( "TVtUiStateResetting.HandleVTCommandPerformedL" ) + return handled; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateResetting::HandleVtEventL +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase::TEventResponse TVtUiStateResetting::HandleVtEventL( + const TInt aEvent ) + { + __VTPRINTENTER( "TVtUiStateResetting.HandleVtEventL" ) + TEventResponse handled = EEventHandled; + switch ( aEvent ) + { + // While resetting appUi should not handle these events. + case KVtEngSourceChanged: + case KVtEngCameraChanged: + case KVtEngSourceCapsChanged: + case KVtEngSessionStateChanged: + case KVtEngDurationSettingChanged: + case KVtEngAudioOutputVolumeChanged: + case KVtEngAudioRoutingAvailabilityChanged: + case KVtEngAudioRoutingChanged: + case KVtEngAudioMuted: + case KVtEngAudioUnmuted: + case KVtEngRemoteVideoStopped: + case KVtEngSessionWaitingCallActive: + case KVtEngSessionWaitingCallInactive: + break; + default: + // allow appUi to handle other events + handled = EEventNotHandled; + break; + } + __VTPRINTEXIT( "TVtUiStateResetting.HandleVtEventL" ) + return handled; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateResetting::HandleCommandL +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase::TEventResponse TVtUiStateResetting::HandleCommandL( + const TInt /*aCommand*/ ) + { + __VTPRINTENTER( "TVtUiStateResetting.HandleCommandL" ) + /* All commands ignored while resetting. CAknAppUi::Exit() is called + when shutdown is completed with asistance of CVtUiAppShutter */ + __VTPRINTEXIT( "TVtUiStateResetting.HandleCommandL" ) + return EEventHandled; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateResetting::HandleForegroundChangedL +// ----------------------------------------------------------------------------- +// +TBool TVtUiStateResetting::HandleForegroundChangedL( + const TBool /*aIsForeground*/ ) + { + __VTPRINTENTER( "TVtUiStateResetting.HandleForegroundChangedL" ) + __VTPRINTEXIT( "TVtUiStateResetting.HandleForegroundChangedL" ) + // not on "foreground" while resetting + return EFalse; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateResetting::HandleLayoutChangedL +// ----------------------------------------------------------------------------- +// +void TVtUiStateResetting::HandleLayoutChangedL() + { + __VTPRINTENTER( "TVtUiStateResetting.HandleLayoutChangedL" ) + // no-op (overrides default behavior) + __VTPRINTEXIT( "TVtUiStateResetting.HandleLayoutChangedL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateResetting::OpenL +// ----------------------------------------------------------------------------- +// +void TVtUiStateResetting::OpenL() + { + __VTPRINTENTER( "TVtUiStateResetting.OpenL" ) + SetExecState( TVtUiStates::EExecStateResetting ); + iCtx.StopDtmfTone(); + iCtx.ChangeApplicationFocus( EFalse ); + + if ( iCommand != KVtEngCommandNone ) + { + // Command is either KVtEngTerminateSession or KVtEngSwitchToVoice + // Need to wait for callback before ShutdownL can be called on context. + iCtx.DoExecuteCmdL( iCommand, NULL ); + } + else + { + // This branch is executed when resetting state is opened due + // to emergency call or state change to one causing shutdown. + // No need to wait for any callbacks (emergency call callback + // handled by CVtUiAppShutter). + iCtx.ShutdownL(); + } + __VTPRINTEXIT( "TVtUiStateResetting.OpenL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateResetting::Close +// ----------------------------------------------------------------------------- +// +void TVtUiStateResetting::Close() + { + __VTPRINTENTER( "TVtUiStateResetting.Close" ) + SetExecState( TVtUiStates::EExecStateFinalized ); + if ( TVtUiStateResetting::iInstance ) + { + delete TVtUiStateResetting::iInstance; + TVtUiStateResetting::iInstance = NULL; + } + __VTPRINTEXIT( "TVtUiStateResetting.Close" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/tvtuistaterunning.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/tvtuistaterunning.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,309 @@ +/* +* Copyright (c) 2007 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: running (normal operation) application state +* +*/ + + +#include "tvtuistates.h" +#include "tvtuiappstates.h" +#include "mvtuistatecontext.h" +#include "cvtuiappshutter.h" +#include "videotelui.hrh" +#include +#include +#include +#include +#include + +TVtUiStateRunning* TVtUiStateRunning::iInstance = NULL; + +// c++ constructor +TVtUiStateRunning::TVtUiStateRunning( + MVtUiStateContext& aCtx, TVtUiStates& aUiStates ) + : TVtUiAppStateBase( aCtx, aUiStates ), iCreateVoiceCallDlg( NULL ) + { + } + +// Destructor +TVtUiStateRunning::~TVtUiStateRunning() + { + } + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::InstanceL +// ----------------------------------------------------------------------------- +// +TVtUiStateRunning * TVtUiStateRunning::InstanceL( + MVtUiStateContext& aCtx, + TVtUiStates& aUiStates ) + { + __VTPRINTENTER( "UiStateRunning.InstanceL" ) + if ( iInstance == NULL ) + iInstance = new ( ELeave ) TVtUiStateRunning( aCtx, aUiStates ); + __VTPRINTEXIT( "UiStateRunning.InstanceL" ) + return iInstance; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::HandleVtEventL +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase::TEventResponse TVtUiStateRunning::HandleVtEventL( + const TInt aEvent ) + { + __VTPRINTENTER( "UiStateRunning.HandleVtEventL" ) + // let TVtUiAppStateBase base class do common tasks + TEventResponse handled = TVtUiAppStateBase::HandleVtEventL( aEvent ); + switch ( aEvent ) + { + case KVtEngDeviceLockOn: + case KVtEngDeviceLockOff: + TVtUiAppStateBase::HandleVtEventL( aEvent ); + if ( aEvent == KVtEngDeviceLockOff ) + { + iCtx.ChangeApplicationFocus( ETrue ); + } + break; + case KVtEngSessionStateChanged: + if ( CheckEndActiveCallL() ) + { + // At this point shutdown is in progress. Don't allow + // appUi to do actions due to this event. + handled = EEventHandled; + } + break; + default: + break; + } + __VTPRINTEXIT( "UiStateRunning.HandleVtEventL" ) + return handled; + } + + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::HandleCommandL +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase::TEventResponse TVtUiStateRunning::HandleCommandL( + const TInt aCommand ) + { + __VTPRINTENTER( "UiStateRunning.HandleCommandL" ) + /** By default all commands are enabled by running state. + * Other details command validations are done elsewhere + */ + TEventResponse handled = EEventHandled; + switch ( aCommand ) + { + case EVtUiCmdEndActiveCall: + { + const MVtEngSessionInfo::TSessionState state = SessionState( EFalse ); + if ( state == MVtEngSessionInfo::EOpen ) + { + ShutdownWithEngineCommandL( KVtEngTerminateSession ); + } + } + break; + case EVtUiCmdCreateVoice: + CreateVoiceCallL(); + break; + case EVtUiCmdDialEmergency: + // Attempt emergency call. Note that emergency number check is done + // after calling DialEmergencyCallL and if supplied number is not + // emergency leave occurs. + TRAP_IGNORE( DialEmergencyCallL() ); + break; + default: + handled = TVtUiAppStateBase::HandleCommandL( aCommand ); + break; + } + __VTPRINTEXITR( "UiStateRunning.HandleCommandL %d", handled ) + return handled; + } + + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::HandleForegroundChangedL +// ----------------------------------------------------------------------------- +// +TBool TVtUiStateRunning::HandleForegroundChangedL( const TBool aIsForeground ) + { + __VTPRINTENTER( "UiStateRunning.HandleForegroundChangedL" ) + + // Closes create voice call dialog if it is open + delete iCreateVoiceCallDlg; iCreateVoiceCallDlg = NULL; + + SetLightsState( aIsForeground ); + + iCtx.RefreshL( MVtUiStateContext::ENaviPane ); + + TBool handleAsForeground( aIsForeground ); + TPtrC8 params( reinterpret_cast< TUint8* >( &handleAsForeground ), + sizeof( TBool ) ); + iCtx.DoExecuteCmdL( KVtEngSetUIForeground, ¶ms ); + __VTPRINTEXIT( "UiStateRunning.HandleForegroundChangedL" ) + return handleAsForeground; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::PreHandleForegroundChangedL +// ----------------------------------------------------------------------------- +// +TBool TVtUiStateRunning::PreHandleForegroundChangedL( const TBool aIsForeground ) + { + __VTPRINTENTER( "UiStateRunning.PreHandleForegroundChangedL" ) + TBool handleAsForeground( aIsForeground ); + TPtrC8 params( reinterpret_cast< TUint8* >( &handleAsForeground ), sizeof( TBool ) ); + iCtx.DoExecuteCmdL( KVtEngSetUIForeground, ¶ms ); + __VTPRINTEXIT( "UiStateRunning.PreHandleForegroundChangedL" ) + return handleAsForeground; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::HandleLayoutChangedL +// ----------------------------------------------------------------------------- +// +void TVtUiStateRunning::HandleLayoutChangedL( ) + { + __VTPRINTENTER( "UiStateRunning.HandleLayoutChangedL" ) + iUiStates.SetLayoutChangeNeeded( EFalse ); + iCtx.DoHandleLayoutChangedL(); + __VTPRINTEXIT( "UiStateRunning.HandleLayoutChangedL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::StartDtmfTone +// ----------------------------------------------------------------------------- +// +void TVtUiStateRunning::StartDtmfTone( const TChar& aTone ) + { + iCtx.StartDtmfTone( aTone ); + } + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::StopDtmfTone +// ----------------------------------------------------------------------------- +// +void TVtUiStateRunning::StopDtmfTone() + { + iCtx.StopDtmfTone(); + } + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::CreateVoiceCallL +// ----------------------------------------------------------------------------- +// +void TVtUiStateRunning::CreateVoiceCallL() + { + __VTPRINTENTER( "TVtUiStateRunning.CreateVoiceCallL" ) + HBufC* prompt = + StringLoader::LoadLC( R_VIDEOTELUI_QTN_QUERY_CREATE_VOICE_CALL ); + + // Create and initialize query dialog + CAknQueryDialog* createVoiceCallDlg = CAknQueryDialog::NewL(); + CleanupStack::PushL( createVoiceCallDlg ); + createVoiceCallDlg->SetPromptL( *prompt ); + CleanupStack::Pop(); // createVoiceCallDlg + + iCreateVoiceCallDlg = createVoiceCallDlg; + TInt result( KErrNone ); + TRAPD( error, result = iCreateVoiceCallDlg->ExecuteLD( + R_VIDEOTELUI_CREATE_VOICE_QUERY ) ); + // Just set to NULL because ExecuteLD() deletes instance + iCreateVoiceCallDlg = NULL; + // Leave if ExecuteLD() left + User::LeaveIfError( error ); + CleanupStack::PopAndDestroy( ); // prompt + if ( result ) + { + //user answered yes + iCtx.DoExecuteCmdL( KVtEngSwitchToVoice, NULL ); + } + __VTPRINTEXITR( "TVtUiAppStateBase.CreateVoiceCallL %d", result ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::ShutdownWithEngineCommandL +// Starts shutdown with command to engine. +// ----------------------------------------------------------------------------- +// +void TVtUiStateRunning::ShutdownWithEngineCommandL( const TInt aCommand ) + { + __VTPRINTENTER( + "TVtUiStateRunning.ShutdownWithEngineCommandL" ) + TVtUiAppStateBase* resetState = + TVtUiStateResetting::InstanceL( iCtx, iUiStates, aCommand ); + CVtUiAppShutter* shutter = CVtUiAppShutter::InstanceL( *resetState ); + if ( shutter ) + { + // open resetting state, handles engine command request/reply + ChangeStateL( *resetState ); +#ifdef _DEBUG + __VTPRINTEXIT( + "TVtUiStateRunning.ShutdownWithEngineCommandL 1" ) + return; +#endif + } + + __VTPRINTEXIT( + "TVtUiStateRunning.ShutdownWithEngineCommandL 0" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::DialEmergencyCallL +// ----------------------------------------------------------------------------- +// +void TVtUiStateRunning::DialEmergencyCallL() + { + __VTPRINTENTER( + "TVtUiStateRunning.DialEmergencyCallL" ) + TVtUiAppStateBase* resetState = + TVtUiStateResetting::InstanceL( iCtx, iUiStates ); + CVtUiAppShutter* shutter = CVtUiAppShutter::InstanceL( *resetState ); + if ( shutter ) + { + // Make emergency call and proceed when 1) state has given permission + // and 2) callback from emergency call api is received + shutter->ShutdownWithEmergencyCallL( iCtx ); + ChangeStateL( *resetState ); + } + __VTPRINTEXIT( "TVtUiStateRunning.DialEmergencyCallL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::OpenL +// ----------------------------------------------------------------------------- +// +void TVtUiStateRunning::OpenL() + { + __VTPRINTENTER( "TVtUiStateRunning.OpenL" ) + SetExecState( TVtUiStates::EExecStateRunning ); + iCtx.RefreshStatesL(); + __VTPRINTEXIT( "TVtUiStateRunning.OpenL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateRunning::Close +// ----------------------------------------------------------------------------- +// +void TVtUiStateRunning::Close() + { + __VTPRINTENTER( "TVtUiStateRunning.Close" ) + if ( TVtUiStateRunning::iInstance ) + { + delete TVtUiStateRunning::iInstance; + TVtUiStateRunning::iInstance = NULL; + } + __VTPRINTEXIT( "TVtUiStateRunning.Close" ) + } diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/tvtuistatestarting.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/tvtuistatestarting.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,310 @@ +/* +* Copyright (c) 2007 - 2008 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: waiting details application state +* +*/ + + +#include "tvtuistates.h" +#include "tvtuiappstates.h" +#include "mvtuistatecontext.h" +#include "videotelui.hrh" +#include "cvtuiappshutter.h" +#include +#include +#include +#include +#include + + +TVtUiStateStarting* TVtUiStateStarting::iInstance = NULL; + +// c++ constructor +TVtUiStateStarting::TVtUiStateStarting( + MVtUiStateContext& aCtx, TVtUiStates& aUiStates ) + : TVtUiAppStateBase( aCtx, aUiStates ) + { + iPreconditions.Set( EWaitingCLI ); + iPreconditions.Set( EWaitingPhase1ToComplete ); + } + +// Destructor +TVtUiStateStarting::~TVtUiStateStarting() + { + delete iStartCallback; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::InstanceL +// +// ----------------------------------------------------------------------------- +// +TVtUiStateStarting * TVtUiStateStarting::InstanceL( + MVtUiStateContext& aCtx, TVtUiStates& aUiStates ) + { + __VTPRINTENTER( "TVtUiStateStarting.InstanceL" ) + if ( iInstance == NULL ) + { + iInstance = new ( ELeave ) TVtUiStateStarting( aCtx, aUiStates ); + } + __VTPRINTEXIT( "TVtUiStateStarting.InstanceL" ) + return iInstance; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::AppUiStartupPhase1DoneL +// +// Phase 1 of application startup is completed, check if we can proceed to +// phase 2. +// ----------------------------------------------------------------------------- +// +void TVtUiStateStarting::AppUiStartupPhase1DoneL() + { + __VTPRINTENTER( "TVtUiStateStarting.AppUiStartupPhase1DoneL" ) + // From startup phase point of view we're ready to proceed + // to phase 2. Clear that precondition and proceed if otherwise ready. + CheckPhase2StartupL( EWaitingPhase1ToComplete ); + __VTPRINTEXIT( "TVtUiStateStarting.AppUiStartupPhase1DoneL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::AppUiStartupPhase2DoneL +// +// ----------------------------------------------------------------------------- +// +void TVtUiStateStarting::AppUiStartupPhase2DoneL() + { + __VTPRINTENTER( "TVtUiStateStarting.AppUiStartupPhase2DoneL" ) + // Phase 2 completed, proceed to next state + ChangeStateL( *TVtUiStateRunning::InstanceL( iCtx, iUiStates ) ); + __VTPRINTEXIT( "TVtUiStateStarting.AppUiStartupPhase2DoneL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::HandleVtEventL +// +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase::TEventResponse TVtUiStateStarting::HandleVtEventL( + const TInt aEvent ) + { + __VTPRINTENTER( "TVtUiStateStarting.HandleVtEventL" ) + TEventResponse handled = EEventHandled; + switch ( aEvent ) + { + case KVtEngRemoteDisconnect: + // base class handles this. + handled = TVtUiAppStateBase::HandleVtEventL( aEvent ); + break; + case KVtEngSessionStateChanged: + { + // check if session state is proper for proceeding to next phase + // in startup. + CheckSessionStateL(); + } + break; + case KVtEngRemoteVideoStarted: + // allow to start remote video rendering + case KVtEngSourceChanged: + // allow handling of source changed event + handled = EEventNotHandled; + break; + case KVtEngCLIAvailable: + HandleCLIReceivedL(); + break; + + case KVtEngRemoteUIIIA5StringSupport: + break; + case KVtEngDeviceLockOn: + case KVtEngDeviceLockOff: + default: + handled = TVtUiAppStateBase::HandleVtEventL( aEvent ); + break; + } + __VTPRINTEXIT( "TVtUiStateStarting.HandleVtEventL" ) + return handled; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::HandleCommandL +// +// ----------------------------------------------------------------------------- +// +TVtUiAppStateBase::TEventResponse TVtUiStateStarting::HandleCommandL( + const TInt /*aCommand*/ ) + { + __VTPRINTENTER( "TVtUiStateStarting.HandleCommandL" ) + __VTPRINTEXIT( "TVtUiStateStarting.HandleCommandL" ) + return EEventNotHandled; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::HandleForegroundChangedL +// +// ----------------------------------------------------------------------------- +// +TBool TVtUiStateStarting::HandleForegroundChangedL( const TBool aIsForeground ) + { + __VTPRINTENTER( "TVtUiStateStarting.HandleForegroundChangedL" ) + + SetLightsState( aIsForeground ); + iCtx.RefreshL( MVtUiStateContext::ENaviPane ); + + // behave as in background if CLI (=details) has not yet received + TBool handleAsForeground( aIsForeground && iUiStates.IsDetailsReceived() ); + TVtUiAppStateBase::ExecuteEngineCommand( KVtEngSetUIForeground, + handleAsForeground ); + + __VTPRINTEXIT( "TVtUiStateStarting.HandleForegroundChangedL" ) + return handleAsForeground; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::OpenL +// ----------------------------------------------------------------------------- +// +void TVtUiStateStarting::OpenL() + { + __VTPRINTENTER( "TVtUiStateStarting.OpenL" ) + iStartCallback = new ( ELeave ) CAsyncCallBack ( + TCallBack( &AsynchOpen, this ), + CActive::EPriorityStandard ); + iStartCallback->CallBack(); + __VTPRINTEXIT( "TVtUiStateStarting.OpenL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::AsynchOpen +// asynchronous entry to the state. +// ----------------------------------------------------------------------------- +// +TInt TVtUiStateStarting::AsynchOpen( TAny* aAny ) + { + __VTPRINTENTER( "TVtUiStateStarting.AsynchOpen" ) + TVtUiStateStarting* state = reinterpret_cast( aAny ); + delete state->iStartCallback; + state->iStartCallback = NULL; + TRAPD( res, state->DoOpenL() ); + __VTPRINTEXITR( "TVtUiStateStarting.AsynchOpen err=%d>", res ) + return res; + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::DoOpenL +// ----------------------------------------------------------------------------- +// +void TVtUiStateStarting::DoOpenL() + { + __VTPRINTENTER( "TVtUiStateStarting.DoOpenL" ) + if ( !CheckEndActiveCallL() ) + { + // not shutting down, proceed to phase 1 + iCtx.StartupPhase1L(); + } + __VTPRINTEXIT( "TVtUiStateStarting.DoOpenL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::CheckSessionStateL +// Resolve action based on session state change in the engine. +// ----------------------------------------------------------------------------- +// +void TVtUiStateStarting::CheckSessionStateL() + { + __VTPRINTENTER( "TVtUiStateStarting.CheckSessionStateL" ) + const MVtEngSessionInfo::TSessionState state = SessionState( EFalse ); + switch ( state ) + { + case MVtEngSessionInfo::EConnected: + case MVtEngSessionInfo::ENegotiating: + case MVtEngSessionInfo::EOpen: + // From session state point of view we're ready to proceed. + // Clear precondition and proceed if otherwise ready. + CheckPhase2StartupL( EWaitingSessionState ); + break; + default: + // Is session state such that we need to shutdown? + CheckEndActiveCallL(); + break; + } + __VTPRINTEXIT( "TVtUiStateStarting.CheckSessionStateL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::CheckPhase2StartupL +// +// mark precondition passed and if no more preconditions exist proceed +// in startup. +// ----------------------------------------------------------------------------- +// +void TVtUiStateStarting::CheckPhase2StartupL( + const TPreconditions aCond ) + { + __VTPRINTENTER( "TVtUiStateStarting.CheckPhase2StartupL" ) + // First check that at least one precondition holds + if ( iPreconditions.Value() ) + { + iPreconditions.Clear( aCond ); + if ( !iPreconditions.Value() ) + { + CleanupResetPushL(); // start shutdown if StartupPhase2L leaves + iCtx.StartupPhase2L(); + CleanupStack::Pop(); // CleanupResetPushL + } + } +#ifdef VTDEBUG + else { + __VTPRINT( DEBUG_GEN, "TVtUiStateStarting.CheckPhase2StartupL NoOp!" ) + } +#endif // VTDEBUG + __VTPRINTEXITR( "TVtUiStateStarting.CheckPhase2StartupL cond=%d", + (TInt) iPreconditions.Value() ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::HandleCLIReceivedL +// CLI reception from engine is one of the two preconditions for proceeding +// to phase2 startup. +// ----------------------------------------------------------------------------- +// +void TVtUiStateStarting::HandleCLIReceivedL() + { + __VTPRINTENTER( "TVtUiStateStarting.HandleCLIReceivedL" ) + const MVtEngSessionInfo& session = iCtx.Model().Session(); + MVtEngSessionInfo::TCLI cli; + if ( session.GetCLI( cli ) == KErrNone ) + { + iUiStates.SetDetailsReceived( ETrue ); + iUiStates.SetCLIReceived( cli.iVoiceCallPossible ); + iCtx.SetCallIdL( cli.iCallId ); + iCtx.SetCallNameL( cli.iName ); + } + CheckPhase2StartupL( EWaitingCLI ); + __VTPRINTEXIT( "TVtUiStateStarting.HandleCLIReceivedL" ) + } + +// ----------------------------------------------------------------------------- +// TVtUiStateStarting::Close +// ----------------------------------------------------------------------------- +// +void TVtUiStateStarting::Close() + { + __VTPRINTENTER( "TVtUiStateStarting.Close" ) + if ( TVtUiStateStarting::iInstance ) + { + delete TVtUiStateStarting::iInstance; + TVtUiStateStarting::iInstance = NULL; + } + __VTPRINTEXIT( "TVtUiStateStarting.Close" ) + }